feat(live): add Reset Live Sessions - #587
Merged
Merged
Conversation
Live panes created without the session host lose agterm attribution when their creating app exits. The plan adds Help > Reset Live Sessions and zmx.reset. A confirmed reset quits cleanly, ends the selected daemons at the next launch, and recreates those panes through the session host, replaying captured commands where possible.
…sessions reset LiveReset joins pane claims to zmx leaders and keeps the orphaned and app-attributed panes; narrow re-checks a marker against the launch's own claims and listing and only ever shrinks it; outcome derives pane counts for suppression and distinct session totals for the notification. The marker store renames before decoding so a crash mid-reset never replays it.
…ons reset The dispatcher refuses without --force before the host is reached, like zmx.kill. The reply carries the confirmed session and pane counts, and the tree top level and the zmx list header gain an optional liveReset read-back for the pending set and the last consumed outcome.
A conflicted claim walk emitted duplicate targets that could reach the marker and trap the no-inventory path's unique-key dictionary. The survivor sentence now speaks only for the surviving commands, since a mixed session's other pane restores normally.
…ive sessions reset The listing keeps unreadable rows so a consumer can tell absent from unreadable, the batched kill takes an explicit timeout and reports only a diagnostic Bool, and leadersExited polls a pid group under an injected clock. ControlServer.liveResetSelection joins the claim walk to the listing through the same host-pid resolution the tree uses.
…ve sessions reset LiveResetCoordinator holds the confirmed selection and refuses in a fixed order; the delegate skips the quit alert for it and arms the marker only after the checked snapshot save, removing it when the relauncher cannot start. The connection thread quits only after the zmx.reset reply frame is written, and only for that request. The relauncher waits on the old pid in a detached shell and reopens the bundle through open with the state directory passed by --env.
…he Live sessions reset The consumer runs once the library exists and before the ordinary reap: it consumes the marker first, narrows it against the current claims and listing, kills the confirmed daemons in one batch and polls every leader whatever the batch reported. A pane whose leader survives is suppressed on the seed policy beside the denylist, so it attaches with neither its replay nor its durable command. The outcome is recorded on the app and posted once notifications are registered. The held-write control tests now wait on entered expectations.
Help > Reset Live Sessions… shows only while Live is both the configured and the launched mode. The tree top level and the zmx list header carry the pending pane count and the last consumed outcome, omitted when neither exists.
The user guide, the command reference, the bundled skill, the troubleshooting pages and the control-api and windows rules describe the Help item, zmx.reset, its refusals, the reply-before-quit rule, the narrowing at launch and the read-back fields.
…show menu refusals A reset confirmed before a switch away from Live no longer arms or skips the quit alert, and a launch that did not get Live discards the marker without killing, since an ordinary seed cannot suppress a survivor. The listing and the batched kill are clamped to the remaining budget and a batch that cannot start in time leaves every selected pane suppressed. The Help item presents a refusal in user words; a cancel stays silent.
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.
Live panes created without the session host, or whose host has exited, can lose agterm's permission attribution and prompt again when a new Claude Code version requests the microphone. Restarting agterm does not repair those panes. #574 added the host for panes created from then on and left earlier panes to be recreated by hand; this is the migration it did not include.
Adds Help > Reset Live Sessions… and
agtermctl zmx reset --force. The reset quits and reopens agterm, preserves the layout, and recreates the affected panes through the session host, replaying captured commands where possible. Already supervised panes keep their processes. Running work in affected panes stops; agent conversations may need manual resume. The reset requires dialog confirmation or--force.result.liveResetcontains the confirmed session and pane counts pluspending: true. The tree andzmx listexposeliveReset.pendingas a pane count andliveReset.lastas this launch's reset outcome, omittingliveResetwhen neither exists. Partial resets are reported.An isolated Debug check reset four affected panes across three sessions, including a split. All five panes were supervised afterward; the unaffected pane kept its leader PID and the host kept its PID.
plan: docs/plans/completed/20260910-reset-live-sessions.md