[P1] Go harness: ssh argv word-splitting and phase-timeout mis-attribution #253
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens#253
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P1. From the 2026-07-02 audit.
Part A — ssh argv word-splitting (finding confirmed against code; real-world impact needs one check)
Remote commands sent via
Conn.RunCommandlose argument word boundaries: the SDK appends each word to the ssh argv with no quoting, ssh joins them with spaces, and the remote shell re-splits. So:pushBranch(internal/pod/llmwork.go:104-140) sends a multi-word commit message and a multi-worduser.nameconfig value →gitreceives the trailing words as pathspecs / positional args and fails.syncHostCheckout(internal/pod/helpers.go:58→ SDKSyncCheckout) sends-c http.<url>.extraheader=AUTHORIZATION: basic <b64>whose value contains spaces → remote git parsesbasicas a subcommand and fails.Code analysis says this fails deterministically. However, PRs are currently merging (e.g. #244, #245), which contradicts "100% of runs fail." Before rewriting anything, confirm the laptop's
sshdDefaultShell: the two space-containingRunCommandcalls that do work (conn.go:106,cleanup.go:39) survive only because PowerShell-Commandre-joins trailing tokens. If DefaultShell is PowerShell, the real behaviour differs from the POSIX-shell analysis and the exact failure mode must be re-derived.Fix direction (once confirmed): move remote git into host-face subcommands (
push-branch,sync-checkout) invoked viaRunSelfwith single-word flag values, exactly likerun-phasealready does. This also removes a GitHub-token-in-process-listing exposure (the token is currently in a remote command line). Report theextraheader-space bug upstream toglimmung/harnessremotehost.SyncCheckout.Guardrail: a unit test walking every
RunCommandcall site asserting no argv word contains whitespace (documented exemption for thepowershell -NoProfile -Commandpattern).Part B — phase-timeout mis-attribution (confirmed)
A phase timeout returns a harness-layer error (exit 1) though
runphase.go:196-197's own doc says it must become a cleanphase_timeoutverdict, and no code path ever writes aphase_timeoutartifact despite it being in every phase'sAllowedAbortReasons. So a routine slow agent burns the run as an unattributed harness failure — defeating the documented reason for the Go migration. Restore the synthetic-abort-on-timeout: onDeadlineExceeded, write the phase's abort artifact (abort_reason=phase_timeout) and route throughctx.Abortfor clean teardown; keepLayerModelonly for genuine agent failures. Add round-trip tests for both.Uncapped audit pass — additional confirmed Go-harness items beyond the ssh word-splitting (#132):
exit 1so every laptop failure is billedsuspected_cause=host(#133, HIGH) — encode the layer in the exit code.HarnessErrorinstead of a cleanphase_timeoutabort verdict, so a slow agent burns the run and recycle never sees a verdict (#134, HIGH).runDeterministicUnitTestsdiscardsrunCmd's start error, so dotnet-not-on-PATH becomesunit_tests_failedblaming the implementation (#135).RunSelf/GitHub-API errors mapped to definitivebridge_not_ready/implementation_branch_missingaborts (#137); swallowed mkdir/decodeB64 errors (#136, #140).glimmung-workflow.mddescribes a retired pack-evidence flow + a stale SDK-gap list (#138).Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.