Repository navigation
fix(sessions): make remove, restart and undo recoverable - #311
Merged
Merged
Conversation
Follow-up to the focus/status/shortcut fixes (stacked on that branch).
Renderer and docs only.
Restart all
- Each session's replacement is now started first, takes over the
original's panes (split and Canvas) and sidebar slot, and only then is
the original removed. A session whose replacement cannot start is left
as it was.
- Sessions restart one at a time and each create is awaited. Before,
every session was removed up front and the creates were fired without
awaiting; the Vault login prompt has a single slot, so with an expired
token only the last create resolved and the rest of the sessions were
simply gone.
- The toast reports what happened ("Restarted 3 of 4 sessions; 1 failed:
api (reason). They were left as they were."), instead of announcing
success before any session had been created. A second Restart all on
the same group is ignored while one is running.
Undo
- Clear-all Undo restores sessions in turn with the same awaited path,
and names anything it could not bring back with a Retry action.
- Removing a single ordinary session now shows the same Undo toast.
Worktree sessions keep their confirmation dialog and get no Undo,
since their directory may be removed with them.
Supporting changes
- New layout action REPLACE_SESSION_ID swaps a session id wherever it is
mounted, in both arrangements, keeping pane ids and geometry.
- handleCreateSession's Vault preflight + create moved into
createSessionFromOptions, which returns created / cancelled / failed
instead of reporting it, so batches can summarize. Its own behaviour
and toasts are unchanged.
- utils/session-batch.ts: runBatch (sequential, stops on cancel,
continues past failures) and summarizeBatch, both unit-tested.
Tests: npx tsc --noEmit clean; eslint clean on touched files; vitest
202 files / 2345 tests pass. The one failure,
src/main/usage/remote-command.test.ts "runs the quoted probe through a
real POSIX shell", is the known Windows-host real-shell case.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
maxthomas95
force-pushed
the
fix/session-remove-restart-20261109
branch
from
November 10, 2026 03:17
0fbcbb7 to
6e14625
Compare
|
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
Stacked on #308 (base branch
fix/renderer-workflow-20261109); review and merge that one first. Renderer and docs only: no main-process, IPC or persistence changes.Restart all
Undo
Supporting changes
REPLACE_SESSION_IDswaps a session id wherever it is mounted, in both the split layout and Canvas, keeping pane ids and geometry.handleCreateSession's Vault preflight + create moved intocreateSessionFromOptions, which returnscreated/cancelled/failedinstead of reporting it, so a batch can summarize.handleCreateSessionitself behaves as before, toasts included.utils/session-batch.ts:runBatch(sequential; continues past a failure; a declined Vault login stops the batch and the rest are reported as not attempted) andsummarizeBatch.Test plan
npx tsc --noEmitnpx eslinton every touched filenpx vitest run— 202 files / 2345 tests pass; the one failure,src/main/usage/remote-command.test.ts"runs the quoted probe through a real POSIX shell", is the known Windows-host real-shell case. After a final one-line toast-duration tweak I re-ran typecheck, lint andnpx vitest run src/renderer(69 files / 585 tests pass), not the full suite.runBatchordering, failure and cancel handling;summarizeBatchwording;REPLACE_SESSION_IDin the split reducer, the Canvas reducer and across both arrangementsvault://env vars; one login prompt, then every session restarts. Cancel the prompt instead: nothing is lost and the toast lists the sessions as not attemptedOut of scope
🤖 Generated with Claude Code