You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Account switch should also move running native Claude Chat sessions, not only terminal panes #36676
I have three managed Claude accounts in Orca (1.4.245, macOS). When I switch the active account from the status bar, running Claude Code terminal panes follow the switch: the switch dialog lists them and my "When you switch accounts while Claude is running" policy moves them to the new account.
Running native Claude Chat sessions don't follow the switch. They stay on the account they were launched with, the switch dialog never lists them, and nothing is asked or restarted, whatever that policy is set to. The status bar shows the new account, but open chats keep using the old one, and the UI doesn't say so. If the old account has hit its usage limit, every open chat keeps failing after the switch while the terminals work.
src/renderer/src/lib/claude-session-account-move.ts:114 skips panes with structuredHostOwned, so native chats are never candidates for the account move.
src/main/claude/claude-structured-launch-home.ts pins the account environment when the chat process launches.
Proposed solution
Include native Claude Chat sessions in the account switch flow, under the same policy that already applies to terminal panes:
List running chats in the switch dialog next to terminal panes.
Ask / Always restart: restart the chat's Claude process on the new account and resume the same conversation. If the transcript can't be reached from the new account, keep the current historyInOtherAccount behavior and say so in the dialog.
Never restart: leave the chat as is, but show that it is still on the previous account.
If restarting a chat mid-turn is unsafe, restart idle chats right away and busy ones when their turn ends.
Alternatives or additional context
Current workaround: start a new chat after switching. The new chat picks up the newly selected account, but you lose the conversation you were in.
We cover native Claude chats in a local build since 2026-10-30 and would like to line it up with #36649 rather than collide with it, so here is what we did and where the two approaches differ.
on its next message, by stopping the idle agent, carrying the conversation file over, and resuming under the new folder
immediately and without stopping the agent, by re-pointing the chat's auth proxy slot (same mechanism as our terminal-pane move, see #34422)
what moves
the conversation history (file copy into the other account's folder)
nothing on disk; the next API request is billed to the new account
what if the history cannot be copied
chat stays on the old account with the "switch back" message
not applicable, the folder does not change
what the switch dialog / mover sees
unchanged
chats are first-class rows in the pane registry, so the dialog, the mover, the pool, account list and the phone all see them
They compose: #36649's carry-over is still the right answer for a chat that has no slot (started before the proxy, or with a user ANTHROPIC_BASE_URL). For a chat with a slot, no carry-over is needed.
What "first-class row" means
Before: nothing called recordClaudePaneAccount for a structured chat, so the registry never knew it existed. collectClaudeMoverSessions only saw terminal rows and transcript-inferred PTYs; sessions: in account list counted terminals only; the switch dialog skipped structuredHostOwned panes (the line you found at claude-session-account-move.ts:114).
After:
registry key = structuredAgentSessionPaneKey(tabId, sessionId) ← same key the hook status row uses
record = { surface:'chat', worktreeId, providerSessionId, accountId, configDir,
assignedAccountId, proxySlot, launchSelectionId, source:'spawn'|'pool' }
Account order on each turn matches a terminal launch: a remembered resume account wins; while launchSelectionId is still the selected account the recorded account and slot are kept; a selection change follows the new selection (or the pool, if on). A user CLAUDE_CONFIG_DIR skips the pool and is restored after the patch.
Slot reuse. Every acquire runs preparation (setup still happens), but when the recorded slot is live the fresh slot is released and the child env is set back to the recorded URL. Before this, each turn took a new slot and the 30 s unbound-slot prune released the one the child was using.
Close. The slot is forgotten only in finalizeClaudePublishedSession, right after sessions.delete. An unexpected exit does not forget, because the chat can respawn the same session and must reuse the record.
Move. Evaluation uses the proxy strategy only. A chat with no slot is skipped with detail structured-needs-proxy and no hand-off note (we do not relaunch a chat under another folder, that is Native chats follow the account picker and keep the conversation #36649's job). History records strategy:'proxy' and chat:true.
Surfaces.account list prints sessions: 3 (1 chat); recent moves append chat; the chat tab gets the same account chip as a terminal tab; the phone's chatStatus.claudeAccountId carries the billed id.
flowchart LR
subgraph chat turn
A[acquire launch home] --> B{record exists?}
B -- no --> C[prepareLaunch: new slot, record row]
B -- yes, slot live --> D[release fresh slot, reuse recorded URL]
B -- yes, slot dead --> E[keep new slot, update record]
end
M[mover: selected account at limit] --> F{chat has slot?}
F -- yes --> G[flip slot → B, agent keeps running]
F -- no --> H[skip: structured-needs-proxy → #36649 path]
Loading
Tests
81 tests across the structured launch home, pane-account choice, session key, close, registry, mover sessions/evaluation/history, list format, move line, mobile tab status and the tab chip.
Happy to rebase this onto #36649 once it lands and open it as the follow-up, or to open it alongside if the maintainers prefer to review the proxy path first. Either way it depends on the proxy from #34422.
Adding another user report of this workflow problem (2026-11-04):
An agent conversation is using account A.
Account A reaches its usage limit.
I switch to another account B that has available usage.
I return to the same existing conversation and ask it to continue.
That conversation still reports that usage is exhausted. In practice, I have to start a new conversation to use account B.
The main request is to continue the existing conversation under the newly selected account, preserving its history and context. Starting a new conversation should not be the required recovery path after switching accounts.
Please offer a supported "continue this conversation with the selected account" action, or include native chats in the account-switch/resume flow. The chat should clearly show which account it is actually using, especially when that differs from the global account/usage indicator.
Environment and evidence scope:
Current desktop installation verified as Orca 1.4.247 on macOS 27.2.
A local read-only investigation of the same symptom on 2026-10-29, using Orca 1.4.243 and native Claude Chat, found that the global account selection had changed while the existing chat retained its original account-directory binding; the selected account had available usage.
That older observation is supporting history, not a newly verified root cause on 1.4.247. This submission does not claim that a current fix candidate has been tested or that all agent providers behave identically.
This matches the practical impact described in this issue: an account switch appears successful in the UI, but the existing chat cannot continue.
Data point from Windows 11, Orca 1.4.259, Claude Code 2.1.325, four managed Claude accounts, native chats. Since #30955 a chat does follow the picker before its next message, so this is about the chats that still don't. One manual switch tonight, observed live; not a controlled repro.
What happened
Time
Event
18:23:39
Switched from account A (about 85% of its weekly window) to account B in the status bar.
until 19:47
Three chats that had open work at the switch kept running on A. Their turns succeeded and kept spending A.
19:55
A reached its weekly limit. Those chats started ending turns with "Claude hit its weekly limit".
20:19 to 20:21:58
Chat 1 (an orchestration coordinator): four failed turns, one on incoming agent mail and three on my own "Continue".
20:22:13, then 20:22:15
Chat 2: one more failed "Continue", then its process was replaced and the next message ran on B.
20:36
Chat 3 (an orchestration worker) is still on A, with a background command running and an open dispatch. It has not failed yet.
How I checked: CLAUDE_CONFIG_DIR in the environment of each live claude.exe, compared with the selected account, and turn outcomes and failure notices from agent-session-journal.db. Of 10 live Claude processes started by Orca, 8 were on B and these two on A.
Why these chats stayed
In v1.4.259, retireOutgrownStructuredAgentSessionChild (src/main/native-chat/agent-session-wire/recovery/structured-agent-session-outgrown-child.ts) replaces a process launched under another account only when a message is delivered, and returns early while structuredAgentSessionChildOwesWork is true: an active turn, open child work (a background command or subagent), an open dispatch, an actionable prompt, or child work that settled after the last turn ended.
That matches each chat:
Chat 1. A background command started at 19:47:39 and settled at 20:21:51. The sends at 20:19:04, 20:21:27 and 20:21:45 found it open. The send at 20:21:57 found it settled later than the previous turn's end (20:21:46), so a wake-up was still owed. All four ran on A and failed.
Chat 2. First failure at 19:55:56, more limit notices at 19:55:58, 20:00:50 and 20:05:03 with no message from me. The first message after its work had settled failed on A at 20:22:13, and the one after that ran on B.
Chat 3.dispatch_contexts.status is dispatched for its incarnation, and a background wait is alive under its process. As I read structuredWorkerOwesWork, a worker with an open dispatch does not move for as long as the dispatch is open.
Two effects, which may want different answers
Between the switch and the limit, chats with open work keep spending the account that was switched away from. Here that was 92 minutes, and it is what took A from about 85% to its limit.
Once that account is spent, "Continue" cannot help while the work is open. Each send goes to the old process and fails, the failed turn is not sent again after the chat does move, and nothing in the chat says it is still on the previous account or why. The report from Rem021 above reads like the same case.
Cross-reference. Since #30955 a chat follows the picker before its next message, as noted above, and #36649 is open on the same surface.
For the chats that still stay behind because they owe work, my open pull request #43105 has a relevant part. Under its opt-in value "Always restart every session", running native chats move once the new selection is in force, owed work included, and work that was cut off with nothing queued is continued on the new account. A chat is not moved while a send is in flight.
It restarts the chat. It does not move it without a restart, and it is tested on Windows only. A status summary is in #31905.
Activity
nachumi-a2zoperations commentedon Nov 2, 2026
We cover native Claude chats in a local build since 2026-10-30 and would like to line it up with #36649 rather than collide with it, so here is what we did and where the two approaches differ.
Two different problems hiding in one issue
account listand the phone all see themThey compose: #36649's carry-over is still the right answer for a chat that has no slot (started before the proxy, or with a user
ANTHROPIC_BASE_URL). For a chat with a slot, no carry-over is needed.What "first-class row" means
Before: nothing called
recordClaudePaneAccountfor a structured chat, so the registry never knew it existed.collectClaudeMoverSessionsonly saw terminal rows and transcript-inferred PTYs;sessions:inaccount listcounted terminals only; the switch dialog skippedstructuredHostOwnedpanes (the line you found atclaude-session-account-move.ts:114).After:
launchSelectionIdis still the selected account the recorded account and slot are kept; a selection change follows the new selection (or the pool, if on). A userCLAUDE_CONFIG_DIRskips the pool and is restored after the patch.finalizeClaudePublishedSession, right aftersessions.delete. An unexpected exit does not forget, because the chat can respawn the same session and must reuse the record.structured-needs-proxyand no hand-off note (we do not relaunch a chat under another folder, that is Native chats follow the account picker and keep the conversation #36649's job). History recordsstrategy:'proxy'andchat:true.account listprintssessions: 3 (1 chat); recent moves appendchat; the chat tab gets the same account chip as a terminal tab; the phone'schatStatus.claudeAccountIdcarries the billed id.flowchart LR subgraph chat turn A[acquire launch home] --> B{record exists?} B -- no --> C[prepareLaunch: new slot, record row] B -- yes, slot live --> D[release fresh slot, reuse recorded URL] B -- yes, slot dead --> E[keep new slot, update record] end M[mover: selected account at limit] --> F{chat has slot?} F -- yes --> G[flip slot → B, agent keeps running] F -- no --> H[skip: structured-needs-proxy → #36649 path]Tests
81 tests across the structured launch home, pane-account choice, session key, close, registry, mover sessions/evaluation/history, list format, move line, mobile tab status and the tab chip.
Happy to rebase this onto #36649 once it lands and open it as the follow-up, or to open it alongside if the maintainers prefer to review the proxy path first. Either way it depends on the proxy from #34422.
Rem021 commentedon Nov 4, 2026
Adding another user report of this workflow problem (2026-11-04):
The main request is to continue the existing conversation under the newly selected account, preserving its history and context. Starting a new conversation should not be the required recovery path after switching accounts.
Please offer a supported "continue this conversation with the selected account" action, or include native chats in the account-switch/resume flow. The chat should clearly show which account it is actually using, especially when that differs from the global account/usage indicator.
Environment and evidence scope:
This matches the practical impact described in this issue: an account switch appears successful in the UI, but the existing chat cannot continue.
Tauri-EPO commentedon Nov 15, 2026
Data point from Windows 11, Orca 1.4.259, Claude Code 2.1.325, four managed Claude accounts, native chats. Since #30955 a chat does follow the picker before its next message, so this is about the chats that still don't. One manual switch tonight, observed live; not a controlled repro.
What happened
How I checked:
CLAUDE_CONFIG_DIRin the environment of each liveclaude.exe, compared with the selected account, and turn outcomes and failure notices fromagent-session-journal.db. Of 10 live Claude processes started by Orca, 8 were on B and these two on A.Why these chats stayed
In v1.4.259,
retireOutgrownStructuredAgentSessionChild(src/main/native-chat/agent-session-wire/recovery/structured-agent-session-outgrown-child.ts) replaces a process launched under another account only when a message is delivered, and returns early whilestructuredAgentSessionChildOwesWorkis true: an active turn, open child work (a background command or subagent), an open dispatch, an actionable prompt, or child work that settled after the last turn ended.That matches each chat:
dispatch_contexts.statusisdispatchedfor its incarnation, and a background wait is alive under its process. As I readstructuredWorkerOwesWork, a worker with an open dispatch does not move for as long as the dispatch is open.Two effects, which may want different answers
The terminal-pane form of this is #40263.
I can rerun a specific scenario on a given build if that helps.
llewellynvz commentedon Nov 17, 2026
Cross-reference. Since #30955 a chat follows the picker before its next message, as noted above, and #36649 is open on the same surface.
For the chats that still stay behind because they owe work, my open pull request #43105 has a relevant part. Under its opt-in value "Always restart every session", running native chats move once the new selection is in force, owed work included, and work that was cut off with nothing queued is continued on the new account. A chat is not moved while a send is in flight.
It restarts the chat. It does not move it without a restart, and it is tested on Windows only. A status summary is in #31905.