mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
* refactor(terminal): let account-switch pane restarts name their agent The queued account-switch restart only knew how to relaunch Codex. The queue now records which agent each pane restarts as, and the resume startup builder takes that agent, so the same mounted and detached restart paths can move Claude sessions too. Codex behaviour is unchanged. * feat(accounts): offer to move running Claude sessions after an account switch Switching the selected Claude account only reached Claudes started later, so users had to /exit and resume every running session by hand. After a switch from the status bar or Settings, Orca now finds local terminal panes running a resumable Claude session in the switched lane and shows one toast offering to move them. Confirming restarts idle sessions with claude --resume <id> in place; sessions mid-reply move when their turn ends, and are dropped if the pane closes or the user switches again. * fix(accounts): wait out permission prompts and keep hand-started Claude args A Claude session at a permission prompt is mid-turn, so a move now waits for it like a session that is replying. Resuming a Claude pane with no recorded launch config no longer adds the user's default agent arguments or environment, so a hand-started claude is not resumed with a permission bypass. Codex keeps its existing fallback. * feat(accounts): track which Claude account each terminal pane runs on Orca had no record of the account a running Claude used, so an account switch could only assume every session was on the old one. A renderer tracker now attributes sessions that start after launch to their lane's selected account and records the account Orca restarts a session on. Sessions it cannot attribute stay unknown and keep today's behaviour. * feat(accounts): ask in a dialog before restarting Claude sessions on a switch Replaces the move toast. After a Claude account switch, a dialog names the new account and how many sessions are still on the old one, with Keep as is and Restart, plus Remember my choice. Closing or Escape keeps sessions. The remembered choice lives in Settings > Accounts as When you switch accounts while Claude is running: Ask, Always restart, Never restart. * refactor(accounts): read Claude session accounts from their transcripts and use one restart queue Which account a running Claude uses now comes from the transcript path its hooks already report (<CLAUDE_CONFIG_DIR>/projects/...), so the renderer tracker and its guesses are gone and unknown sessions are never counted. Restarts queue straight into the store's pending map through one queuePaneAccountRestarts action; the pane effect and the detached scheduler hold a Claude restart while its turn runs and skip it when the session can no longer be resumed. Codex behaviour is unchanged. * style(accounts): left-align Keep as is in the Claude account switch dialog Co-Authored-By: Claude <noreply@anthropic.com> * copy(accounts): say busy rather than replying, and drop the menu's switching note The deferred restart waits on any working or blocked turn, not only a reply. The switch dialog now covers running sessions, so the menu footer note is redundant. * copy(accounts): say busy sessions wait for idle before restarting * test(accounts): type the switch-session store stub without broad object * fix(accounts): keep a queued Claude restart when Codex restart notices are cleared Codex notice cleanup shares the pending-restart map with Claude switch restarts; it now drops only Codex entries. * fix(accounts): wait out Claude questions and keep accepted restarts across switches - A Claude permission prompt or question reports 'waiting'; a queued restart now waits for 'done' instead of only 'working'/'blocked', so it no longer drops them. - A later switch keeps accepted restarts still waiting on a turn (they relaunch on whatever is selected) and drops only those whose session is already on the new account, scoped to the switch's lane. The blanket replaceQueued option is gone. - A server account switch returns before touching the local dialog or queue. - Pane restart state reads through one selector to stay inside the subscription budget, and the focus-read baseline follows the restart-startup rename. * test(accounts): feed the account-restart e2e fixture the shared restart queue * feat(accounts): make the switch dialog's checkbox one-way, like native chat's resume prompt "Don't ask again (restart automatically)" turns on automatic restarts however the dialog is left, including Escape; Settings → AI Provider Accounts turns it off. * feat(accounts): choose which Claude sessions restart after an account switch With more than one session, the switch dialog lists them by workspace using the native-chat resume tree rows, all ticked; Restart covers only the ticked ones. * Merge origin/main into claude-sign-in and rename the host-twin teardown's restart queue * fix(accounts): localize the session tree's agent label * fix(accounts): restart a pane on the PTY it has when the dialog is answered A reattach can rebind a pane while the dialog is open and a closed pane has no PTY, so the ids it listed may name nothing. * fix(accounts): read a layout's pane PTYs optionally * fix(accounts): offer to move sessions of a saved account that runs on System default A saved account with no login of its own runs on System default, so its sessions' transcripts read as System default. The switch now compares where launches run (runsOnSystemDefault on the account summary) and asks nothing when that is unchanged. * refactor(accounts): give the Claude account switch one boundary and key the whole prompt The post-switch coordinator now takes the before/after account snapshots and derives launch folders and labels itself, so the status bar and Settings stop assembling the same request. The status bar's settings projection reuses the host's row, which keeps runsOnSystemDefault: a covered account switched from the status bar now finds its System default sessions. Never restart returns before any session scan. The outcome collapses to show-confirmation | handled. The dialog keys one component that owns the whole Dialog with a plain boolean. * refactor(terminal): subscribe mounted panes to this tab's ready account restarts Replaces claudeTurnStatus, the whole agent-status map passed through the controller as a re-run signal, with a shallow selector of the PTY ids whose queued restart can run now. Other tabs' status updates no longer re-render or re-run every mounted pane once a Claude restart is queued. The effect re-checks readiness against the current store before consuming. The detached Claude test now runs through the scheduler's real subscription instead of manual sweeps. * docs(accounts): shorten Claude account-move comments to their whys * test(terminal): give the account-restart e2e a callable store and a queued restart The mounted pane now reads its ready restarts from the store through useShallow. --------- Co-authored-by: Claude <noreply@anthropic.com>