Repository navigation
Conversation
Replace the named SshLeg stub with the full leg, mirroring the Python client's SSH fallback (code#2879): gate on LAPTOP_AGENT_NO_SSH_FALLBACK and ~/tools/laptop-ssh-real.sh, run the daemon's request surface over real SSH (health synthesised from /proc, exec/run/poll/kill/jobs with sshfb- ids spooled under ~/.local/state/laptop-agent/sshfb-jobs/), magic-line proof that the remote shell started, per-op timeouts (exec timeout_s+15, poll 60s, others 30s), 1 MiB/stream tail cap, and the process-group kill on local timeout. The implementation recovers the staged, test-green SSH leg from the 2026-11-17 parity shift on PR #11122 (queue/20682-muse-send worktree), which was never committed before that PR merged; the only change here is a saturating_add for the exec timeout so an absurd timeout_s cannot overflow. Other paths (incl. /file) stay Absent. Refs #10796
…overy The recovered commit 75ddb67 carried the SshLeg tests and call sites but not the helper definitions they use (job_segment, json_reply, find_subslice, query_u64, cap_tail, sh_quote, ssh_inner, b64_decode), so the crate did not compile. The definitions are restored verbatim from the proven staged implementation preserved in the queue-20682 laptop worktree (live parity proofs recorded on #10796), reformatted with cargo fmt. No behaviour change beyond compiling as intended.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #10796
What this is
The SSH leg of the fleet binary's laptop-agent ladder — the last of the four legs (broker → Cloudflare → Tailscale → SSH) to land as real code. PR #11122 merged the domain with the SSH leg as a named stub; this PR replaces the stub in
pkgs/fleet/crates/fleet-laptop-agent/src/legs.rswith the implementation that was proven live in the 2026-11-17 parity shift (forced-leg-down harness: health and exec answered by SSH after broker, Cloudflare, and Tailscale were made to fail; evidence recorded on #10796).The
SshLegshells out to the laptop-ssh script with the Python client's fallback semantics: the request is flattened into a remote shell program (ssh_inner+sh_quote), job paths are validated throughjob_segment, replies are size-capped (cap_tail), and fetch payloads ride base64 (b64_decode). The leg reports Absent when the script is missing, so the ladder degrades exactly as it does for a missing broker socket.Recovery fix (second commit)
The recovered commit
75ddb67efcarried the leg's tests and call sites but not the helper definitions they use — the crate did not compile (20 errors:json_reply,sh_quote,ssh_inner,query_u64,job_segment,cap_tail,b64_decode,find_subsliceall undefined). Commitf1f3678aerestores that section verbatim from the proven staged implementation preserved in the parity shift's laptop worktree, reformatted withcargo fmt. No behaviour change beyond compiling as intended.Verification (laptop, this branch)
cargo test -p fleet-laptop-agent(frompkgs/fleet): 24 passed, 0 failed — including the six SSH-leg tests:sh_quote_matches_shlex,ssh_inner_flattens_env_cwd_and_argv,b64_decode_round_trips_and_tolerates_noise,ssh_leg_is_absent_without_the_script,ssh_leg_carries_no_other_surfaces,ssh_health_answers_through_a_fake_script.cargo fmt -p fleet-laptop-agent -- --check: clean.rustup could not choose a version of cargo-clippy), so CI is the first clippy run. This is a pre-existing laptop toolchain gap, unrelated to this change.Scope / follow-ups
~/tools/laptop-agent.py+laptop-ssh.shat the binary, which the issue's own plan sequences after a fleet build carrying this leg deploys. The fetch-upload decision is already recorded on the issue (no daemon upload route; parity covers the fetch direction)./jobs/sshfb-*routes to the SSH leg (sshfb- job routing gap).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.