Kill a husk only on positive evidence of death; never bank a stale Copilot directory - #249
Merged
Merged
Conversation
…e Copilot directory Review of #248 found the pane's husk branch keyed off the liveness check failing, which also happens on a listing row zmx marks `err=` — a busy daemon missing its one-second probe, which zmx itself refuses to clean up on. Opening a loop under load could `zmx kill` a live agent mid-turn. The kill now requires the session's own row to carry `ended=`; the same rule keeps it from racing the daemon, whose relaunch into a husk clears that mark the instant the command is typed in. The daemon's Copilot bank task no longer falls back to the pre-launch directory when no new one appears within the wait: a cold `copilot` still at its trust dialog would have had the old, dead conversation banked over it, recreating the orphaning #248 set out to end. Nothing banked costs nothing — discovery by newest directory already covers it. History lines are appended with O_APPEND rather than seek-then-write, since the daemon's bank task and the app's bank-on-open can now land on the same file at once. The resume tests are serialized: they swap the process-global Copilot state directory. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tqv8Rx8SGsLCjJQYCUjiFr
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.
Summary
Follow-up to #248 from its review, before the fix goes to a wider beta.
err=: a busy daemon missing its one-second probe, which zmx itself refuses to clean up on. Opening a loop under load couldzmx killa live agent mid-turn. The kill now requires the session's own row to carryended=(ZmxSessionLauncher.sessionEndedCheckCommand). The same rule stops it racing the daemon: a relaunch typed into a husk clears the mark at once.copilotstill at its trust dialog would have had the dead conversation banked over it, recreating the orphaning Resume a local Copilot loop instead of relaunching it under the same name #248 ends. An unbanked node falls back to discovery by newest directory.LocalSessionResumeTestsis serialized; it swaps the process-global Copilot state directory.Verification
xcodebuild testin the worktree: 1479 passed, 0 failed.swiftlint lint: 0 errors.swift format lint --strict: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Tqv8Rx8SGsLCjJQYCUjiFr