fix: don't tie cloud-hypervisor lifetime to the agent's context #11

Closed
opened 2026-07-02 17:04:56 +00:00 by a73x · 2 comments
a73x commented 2026-07-02 17:04:56 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-02] Fixes 34ff61e9. Boot used exec.CommandContext with the agent's root signal context, so a graceful agent stop (systemctl restart, Ctrl-C) SIGKILLed every running VM — contradicting the Setsid survive-restart intent; ephemeral VMs were permanently lost. Change: exec.Command instead, with a doc comment explaining why ctx is deliberately unwired; VM stop remains exclusively the reconcile Shutdown/Kill path. TDD: TestBootedVMSurvivesCtxCancellation written first, watched fail (process died <50ms after cancel), passes after the fix. Full make ci green on the branch (based off main; cloudhv is identical on feat/join-token-enrollment so no conflict either way).


Migrated from git-collab patche e06905ca8a4146dc2cbe5cb784d4d0a17e020a0b.

Original author: a73x dev@a73x.sh.

Fixes git-collab issue 34ff61e9

Historical merged patch. The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed.

Original branches: fix/vm-survives-agent-restart → main.

[claude 2026-07-02] Fixes 34ff61e9. Boot used exec.CommandContext with the agent's root signal context, so a graceful agent stop (systemctl restart, Ctrl-C) SIGKILLed every running VM — contradicting the Setsid survive-restart intent; ephemeral VMs were permanently lost. Change: exec.Command instead, with a doc comment explaining why ctx is deliberately unwired; VM stop remains exclusively the reconcile Shutdown/Kill path. TDD: TestBootedVMSurvivesCtxCancellation written first, watched fail (process died <50ms after cancel), passes after the fix. Full make ci green on the branch (based off main; cloudhv is identical on feat/join-token-enrollment so no conflict either way). --- Migrated from git-collab patche `e06905ca8a4146dc2cbe5cb784d4d0a17e020a0b`. Original author: a73x <dev@a73x.sh>. Fixes git-collab issue `34ff61e9` **Historical merged patch.** The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed. Original branches: `fix/vm-survives-agent-restart` → `main`.
a73x commented 2026-07-02 17:13:57 +00:00 (Migrated from git.a73x.sh)

Original review: comment (revision not recorded)

[claude 2026-07-02] Review findings (recorded as comment, NOT approval — patch is claude-authored this session, so the approve verdict is left to a human reviewer). Independent fresh-context review via code-reviewer subagent. Verification: (1) mutation test — pre-fix Boot against the new test fails in 0.05s with the intended message, so the test genuinely pins the bug; (2) full unit suite + make lint (block tier incl. contextcheck) clean; (3) audited all paths that could rely on the old ctx-kill behavior: harness cleans up CH via explicit sudo pkill (agent.go killCloudHypervisor <- Stack.Close), devstack via st.Close(), and harness RestartAgent actively REQUIRES VMs surviving agent death. reconcile.Provisioner untouched; R6 invariant intact. Reviewer verdict: ready to merge; two minor test-hygiene notes were applied in amended commit ad58682 (exec sleep 60; poll 1s->300ms).

**Original review: comment** (revision not recorded) [claude 2026-07-02] Review findings (recorded as comment, NOT approval — patch is claude-authored this session, so the approve verdict is left to a human reviewer). Independent fresh-context review via code-reviewer subagent. Verification: (1) mutation test — pre-fix Boot against the new test fails in 0.05s with the intended message, so the test genuinely pins the bug; (2) full unit suite + make lint (block tier incl. contextcheck) clean; (3) audited all paths that could rely on the old ctx-kill behavior: harness cleans up CH via explicit sudo pkill (agent.go killCloudHypervisor <- Stack.Close), devstack via st.Close(), and harness RestartAgent actively REQUIRES VMs surviving agent death. reconcile.Provisioner untouched; R6 invariant intact. Reviewer verdict: ready to merge; two minor test-hygiene notes were applied in amended commit ad58682 (exec sleep 60; poll 1s->300ms).
a73x commented 2026-07-03 09:47:05 +00:00 (Migrated from git.a73x.sh)

Original review: approve (revision not recorded)

LGTM

**Original review: approve** (revision not recorded) LGTM
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
a73x/eitri#11
No description provided.