Repository navigation
fix(restore): a community-harness seat the snapshot saw detached launches its harness, not a bare shell - #4050
Conversation
…rness Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks again, @cavalcanticampos, for the quick fix. I read the source at One change, in the PR description only (no push): please change "Fixes #4047" to "Refs #4047". As your notes say, this fixes reading A, and #4047 also covers the bare shell left when the harness really is missing, recovering an agent that's already stuck, and bringing back part of a running rig, so merging this shouldn't close it. Optional, your call:
This is from reading the source; I haven't run it locally. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the careful read, @mvschwarz.
Ran: 🤖 Generated with Claude Code |
openrig-review
left a comment
There was a problem hiding this comment.
Approved at 8190fa2. A launch-only community-harness seat that the snapshot recorded with no occupant (detached when it was taken, as after a reboot) now starts fresh with the harness its newest saved session names, instead of leaving a bare shell. The selection must still match the seat's runtime, so a newest session naming another harness, or none, keeps today's result. Reviewed independently.
|
Thanks again, @cavalcanticampos, for the quick push. I read The one thing left is the description: it still says "Fixes #4047". Please change it to "Refs #4047", as you said you would, since this covers one part of the issue. The rest of the checks are still running at |
… newer session that lost it (#4053) A community-harness seat left stuck by a failed restore launch now recovers with `rig seat launch <seat> --fresh`. The fresh launch, its folder move and the runtime switch read the seat's harness from its newest session row that recorded one, so a newer row with no harness (left by the failed launch) no longer hides it, whether the bare shell still runs or the seat is detached after a reboot. The harness starts with its startup context and first input. The selection must still match the seat's runtime, and a newer different selection stops the search, so a seat never launched for the harness still gets no adapter. Reported by kwang281 in #4047; #4050 covers the restore side.
What a user gets
Before: after a host reboot,
rig launch <rig> <seat>on a launch-only community-harness seat printedHarness not started: no <preset> runtime adapter for <seat>.It also left a tmux session with only a bare shell, and a new session row with no harness selection (agent_app = NULL). That row then hid the seat's harness, sorig seat launch <seat> --freshwas refused withruntime_adapter_missingand the seat was stuck.After: the seat starts fresh with its community harness, and the new session row keeps the harness selection.
Fixes #4047
Cause. An
auto-periodicsnapshot taken after the reboot sees the seat's session asdetached, so it records the occupant as{ kind: "absent" }.postLaunchRestorethen hassession = null. It usedsession?.communityHarnessboth to resolve the adapter (seatAdapter) and to carry the selection onto the new session. Both gotundefined, so no adapter was found. The fail-closed branch then marked the harness not started and left the shell and its row behind.Fix. When the snapshot records no occupant for the seat (and no history was explicitly selected), the harness selection is read from the seat's newest saved session row in that snapshot. The adapter lookups use it, and so does
recordCommunityHarnessSelectionfor the new session.communityHarnessOfstill requires the selection to match the node's current runtime, so a seat whose runtime changed, or a free-text runtime, still gets no community adapter. When an occupant is resolved, behaviour is unchanged.How you verified it
On
mainat d958809:packages/daemon/test/launch-node-subset.test.ts. It uses a launch-only preset (first_input: true) and a snapshot whose occupant for the seat isabsentwhile the seat's saved session carriescommunityHarness. It then launches the seat with the community resolver fromwithCommunityHarnessResolver. Without the fix the result isattention_required(the "Harness not started" path). With it the result isfresh-primed, the harness launch is called once, and the new session row hasagent_appset to the preset.launch-node-subset,restore-orchestrator,community-harness-runtime,community-harness-snapshot,community-harness-existing,qa-community-harness-snapshot-boundary.npx tsc --noEmit -p packages/daemon/tsconfig.jsonis clean.seat-launch-environmentandclaude-interactive-launch,launch-exited-agentneeds the CLI built, andseat-launch-environment-regressiongets a/tmpreadlink EINVAL. The last two fail the same way without this change.npm test,npm run lintandnpm run build, and a real Antigravity CLI seat. The harness's adapter methods are stubbed in the test.Anything you were unsure about
rig start --last/rig_not_stoppedquestion for a partly running rig is also not addressed here.communityHarnessOfalready guards against a stale selection.If this is security-related
Not security-related.
CHANGELOG.mdedit🤖 Generated with Claude Code
Summary by CodeRabbit