Repository navigation
acpmux: resume dead agents and recreate their linked worktree (cx-fbt7f) - #23120
Conversation
… missing worktree) A turn whose agent process died is continued like one a connection error cut off (cause agent_exited); an agent that exits between turns after an answered turn leaves the chat idle; a prompt during the backoff fires the continuation now; a start whose linked worktree is gone adds it back from its branch; Claude's "You've hit your limit" is a limit error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
|
Owned by projects-a4 on cosmic-gray · session |
|
Owned by cx4-au23120 on huge-blue |
|
Bead |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
The worktree record type lives in git_state.rs, the worktree revive under worktree_care/, and TurnUsage's methods with the rest of a turn's cost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
…is told Coordinator scope addition: a missing cwd at respawn or at turn start never kills the session. Its worktree comes back on its branch, else from origin/<branch>, else detached at its last commit or origin/HEAD; otherwise (no record, or the recreate fails) the session moves to the nearest folder above it that exists. The next prompt starts with an [acpmux] line saying which. Remote chains are left as they were (their sandbox), and git runs with no repository hooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
The old test asserted the continuation was dropped; requirement 3 makes the prompt fire it and queue behind it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
…ve-dead-agent # Conflicts: # cmux-tui/crates/acpmux/src/hub/turns.rs
|
Found 14 test failures on Blacksmith runners: Failures
...and 4 more test failures. View all on Blacksmith: run 40043018826, run 40043018876
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2f-72e7-70c0-a474-50025052907f&host=cosmic-gray
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 80beafb to compare; do not merge until green; see lane-rules |
|
From the persistent-machines lane: I had this same item (turns surviving a harness restart) on my plan and dropped my version, so this PR is the one. Three cases my brief called for that I couldn't confirm from the description. They may already be covered:
No reply needed. |
|
Fleet test results at head
CI reds at this head, none in this diff (acpmux Rust only):
|
|
codex-review: SHIP at 146d2b6
|
… output deadline (cx-fbt7f) Agent-Session: https://cmux.com/deeplink/agent?harness=codex&session=01a16a58-ad81-7360-97fc-25aad72be533&host=huge-blue
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (Codex gpt-6.1-sol xhigh): SHIP at 86055a7 Independent final-head review covered dead-agent continuation, linked-worktree recreation and identity checks, archive detached restoration, branch-tip races before exposure, and detached replacement safety. The final focused fleet run passed Linux ACPMUX tests, Rust MSRV, artifact build, and Go checks; remaining Linux lint reds are unchanged base findings, and the macOS job failed during fleet runner acquisition. |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
A session whose agent dies mid-turn can continue on the same conversation, using the existing bounded retry and Stop rules. Before restarting, acpmux recreates a recorded linked worktree from its local branch, origin branch, or last commit. If recovery fails, cwd stays unchanged and the prompt receives the existing retryable
session.folder_missingrefusal.Leo's exact words: "ACPMUX daemons, peer routing and messaging across machines."
The checkout uses the existing configuration-isolated path, with hooks and repository filters disabled. Remote-origin sessions do not recreate worktrees. Usage-limit and sign-in failures are never automatically continued; stderr is drained before classifying a process exit.
This is only the dead-agent/worktree item. Incoming prompts retain the existing transport-continuation policy; this PR adds no idle-status or parent-folder-routing change. No UI surface changed, so there are no gallery variants or screenshot URLs.
Validation
86055a738622d20a1e5d59b32b9544f00e1b9c6b: Linux ACPMUX tests, MSRV, artifact build, and Go checks passed; Linux clippy/panic-ratchet failures are unchanged base findings, and the macOS job failed while acquiring its fleet runner.ec475c71f177e4bb56e4163a25b3c7a8640c7e56.verify-local.py: 10 checks pass; localization parity debt also exists in the unchanged base inputs.pr-overlap 23120inspected overlaps acpmux: forward a Claude Code chat's plan usage limits to clients #24293, cmux NEXT Inspector Connectors: a failed MCP server has Reconnect #24272, acpmux: Claude Code's /context breakdown and MCP reconnect #24223, cmux-next trust: Not now can leave a restricted Claude Code chat instead of a dead end (setting, off by default) #23200 and cmux NEXT sidebar: rows keep their places in the session tree, with a stable/attention toggle #21944: shared agent/session plumbing; this is the existing owner PR for dead-agent/worktree recovery.Changelog
Fixed: Agent chats resume after an agent process exits mid-turn and can recreate their deleted linked worktree before restarting.
Bead:
cx-fbt7f. Owner stop condition: merged.Agent session: huge-blue