Restart zmx sessions in place: daemon command, CLI verbs, Loop menu - #241
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0199VUTtyfuWHbu2hHXpHYw2
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0199VUTtyfuWHbu2hHXpHYw2
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0199VUTtyfuWHbu2hHXpHYw2
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.
Why
There was no way to restart every
zmxsession in place. Stop then start is not a restart: every kill path erases the banked session id, so the next launch is a fresh agent with the goal prompt rather than a resume. The only way to get a resume was to let the sessions die without graphcode's kill running and then reboot the daemon. This is what you need after replacingzmxor a backend CLI under a dozen running loops.What
Daemon —
GraphCommand.restartNode(UUID)and.restartSessions.ZmxSessionLauncher.restartiskillminus everything that makes a kill final: the banked id stays (the relaunch resumes the transcript), the first-pass record stays (the loop is not re-briefed), and the name is not condemned (the reaper would otherwise take out the relaunched session). Returnsfalsewhen the old session would not die, so nothing is relaunched on top of it.start. Attended loops come back when a human next opens them, exactly as after a reboot. Composites restart their workers. Remote projects go through the remote kill and ensure.LoopNode.sessionRestartsis bumped only on a confirmed kill. The number means nothing; the change is the daemon's word that the old session is dead, which is what the app waits for before reattaching.CLI —
graphcode node restart <project> <node-id>andgraphcode sessions restart <project>, plusnode restartin the remote shim.App — Loop ▸ Restart Session and Loop ▸ Restart All Sessions… (confirmed). A mounted agent pane reads its process exiting as the loop resolving, and a retained pane keeps that callback after you switch away, so every affected surface is retired before the daemon is asked and the open workspace is remounted only once its counter moves. The two Stop Loop cases moved into the same file to keep
AppFeatureunder the lint budget;openNodeand the history opener now share onemountWorkspace.Verification
xcodebuild buildandtestin the worktree,swiftlint lint(0 errors),swift format lint --strictclean.restartSessionsskips finished loops; a node saved before the counter existed decodes at 0.Not exercised end-to-end against live sessions here. The one window worth knowing about: between the workspace closing and the daemon's kill landing, opening the same loop by hand would attach to the dying session. It is under two seconds locally.
🤖 Generated with Claude Code
https://claude.ai/code/session_0199VUTtyfuWHbu2hHXpHYw2