fix(queue): make remote dispatch possible and probe with a login shell - #76
Merged
Conversation
Two defects, both hit dispatching to a registered, reachable host. `dispatch` passed `--parent <lead>` unconditionally. thurbox refuses a parent that lives on another host, and the lead is local, so every remote spawn died after all three probes had passed. `ssh_run` sent a bare command string, which gets a non-interactive, non-login shell: no profile, so no `~/.local/bin` on PATH. Probes that ask "is X installed there" answered no about a host where it is. The two calls that only move bytes stay on a bare shell, so a profile that prints cannot land inside a fetched result. Claude-Session: https://claude.ai/code/session_018PX64cpUAiMSuGv2idn6Cx
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.
Dispatching to
debian-hp— registered inhosts.toml, reachable, all three probes green — could not spawn a worker, and the probes lied about why. Two independent defects.--parentmade every remote dispatch impossibledispatchpassed--parent $THURBOX_SESSIONunconditionally. thurbox validates a parent against the host's own backend and refuses one that lives anywhere else:The lead is local by construction, so the flag could only ever fail — after the three
--hostprobes had already run and passed on a flag that had nothing to do with them.thurbox offers no way to express "child of a session on another host."
spawn_delegated(src/session_ops/spawn.rs:519) comparesparent.backend_typeagainst the host's backend name and errors on any mismatch; there is no cross-host form of the field. So omitting it is the whole fix. A local spawn still gets its parent — that half is asserted too, so the link is not quietly dropped for everyone.Probes ran in a shell that could not see the host's binaries
ssh host 'cmd'gets a shell that is neither login nor interactive. No profile runs, soPATHis the bare system default — while agent and thurbox binaries live in~/.local/bin, which is exactly what the profile puts there. The forge probe'scommand -v gh/command -v glabtherefore answered "not installed" about a machine that has both, and the lead read that as an unprovisioned host.Measured on
debian-hp, whose login shell is zsh:command -v thurbox-clissh debian-hpzsh -lc~/.zshrc/bin/sh -lc/home/thurbox/.local/bin/thurbox-cliSo
/bin/sh -lcis both the simpler answer and the better one, and it is thurbox's own remedy for the same bug (#1100'slogin_wrap_for_remote). Nothing hard-codes zsh;BatchModeandConnectTimeoutare untouched.The two calls that only move bytes stay on a bare shell. The brief push and the result fetch need no binary beyond
cat, and a profile that prints a banner would land it in the middle of a fetchedresult.md. One rule: a login shell to find something, a bare one to carry something.A wrong answer no longer reads as a missing host
no.ghis installed there and not logged in" and "neitherghnorglabis on its login shell's PATH" are different problems, and the second is what the non-loginPATHused to manufacture. Both open with "the host ANSWERED".Verified
A test per defect in
scripts/queue-selftest.sh§11, each failing on the parent commit for its own reason (--parentpresent in the loggedsession create;rc=1fromcommand -v). The login-shell test is a real shell against a fake home whose.profileadds a~/.local/binand also prints — no second machine, and the banner test is what pins the byte-moving half.Live against
debian-hp, through fleet's ownssh_run:./scripts/check.shgreen.Scope held to the POSIX remote path: no psmux/Windows support, and the probes ask exactly what they asked before.
https://claude.ai/code/session_018PX64cpUAiMSuGv2idn6Cx