Repository navigation
fix(ssh): self-heal daemon bootstrap uploads on remote hosts - #10590
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe upload script now preserves SSH stdin on descriptor 3 for background ChangesRemote daemon upload recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change preserves SSH input during remote daemon uploads and adds regression coverage, preventing empty bootstrap payloads without changing verification or promotion behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes remote daemon bootstrap uploads by preserving SSH stdin before starting the asynchronous payload reader.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security failures identified. The generated command preserves SSH stdin using POSIX shell redirections, retains bounded timeout, verification, and cleanup behavior, and is covered by a behavioral test using real file-backed stdin. Important Files Changed
Sequence DiagramsequenceDiagram
participant Local as cmux
participant SSH as SSH process
participant Shell as Remote sh
participant Cat as Background cat
participant Temp as Temporary payload
Local->>SSH: Start command with binary as stdin
SSH->>Shell: sh -c upload script
Shell->>Shell: "exec 3<&0"
Shell->>Cat: "cat <&3 (background)"
Cat->>Temp: Write complete payload
Shell->>Cat: wait
Shell->>Shell: "exec 3<&-"
Shell->>Shell: Remove writer marker
Shell-->>Local: Exit status
Reviews (1): Last reviewed commit: "fix(ssh): preserve stdin for background ..." | Re-trigger Greptile |
|
CI note: the three failed-job retries all stop before app-host test execution on shared |
|
Final CI retry result (attempt 3): the focused |
Summary
Closes #10587.
This is a transfer bug, not expected fail-closed behavior. PR #10555 correctly computes the local byte count and SHA-256 and refuses to promote an unverified payload, but its backgrounded remote
catloses SSH stdin under a non-interactive POSIX shell and deterministically writes 0 bytes.Read-only evidence from tinybox and the local nightly snapshot:
/home/tiny/.cmux/bin/cmuxd-remote/0.64.22-nightly.3254304245301/linux-amd64/cmuxd-remotewas mode 755 and 0 bytes at2026-08-22T23:19:16Z.0.64.22-nightly.3252776701701remote binary was 6,295,704 bytes and hash-matched its cache. The current0.64.22-nightly.3260048785601final path was absent after the rejected attempt.Fix and coverage
The upload script now uses the portable
exec 3<&0/cat <&3pattern and closes fd 3 after the reader exits. Byte-count/SHA-256 verification, temporary cleanup, atomic promotion, and bounded retry/fingerprint accounting are unchanged. Commit2cc7fcb5ffadds a behavioral regression test first; commitbea3179c4afixes it. The test executes the generated command with real file-backed stdin and verifies the complete temporary payload and writer-marker cleanup.No remote state was modified. No user-facing strings changed, so localization catalogs were unaffected.