Repository navigation
fix(chat): keep typing during an account move - #7992
Conversation
The composer was inert for the whole move and the controller refused sends, so anything typed while the account changed was lost. Once the old agent has stopped, a send is now stored as a queued turn (the path a starting or hibernated chat already uses), the new agent's start keeps it instead of settling it as orphaned work, and it is drained when the move completes or rolls back. Sends made before the old agent stops wait for that point, so nothing reaches the old account. The composer stays editable during the move and hides Stop, since no agent is running to stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The activity row showed the session's last activity next to "Switching account", which read as a switch running for hours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🏆 Review leaderboardNov 1–8, 2026 · UTC
Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded. Show 7 more reviewers
|
illegalcall
left a comment
There was a problem hiding this comment.
Changes requested. The queue path after the old agent stops (store gate on source_stopped..activating, waking on the target Start, drain on complete/rollback) reads correct. One problem: the composer is now editable for the whole move, but the backend only queues once the old agent has stopped, so a send made during a drain-policy move ("wait for the turn") hangs for 20 s and then fails.
Optional: add a test that the queued turn is dispatched after runInterfaceTransition completes (deliverQueuedAfterAccountMove). That is the only code that sends it, and the new test only checks that Start keeps it. A store test that refuses the append in draining would also pin the gate.
A drain-policy account move stays in draining until the running turn ends, which can take minutes. The composer was open for the whole move, so a send during the drain waited 20 s on the backend and then failed with the handoff error. The composer now opens, and a send queues, only from source_stopped on. Before that the composer stays locked as it was before this change, and the backend refuses at once instead of waiting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
illegalcall
left a comment
There was a problem hiding this comment.
Approved. The earlier finding is resolved. The 20 s wait is gone: Send queues only when the move is between source_stopped and activating (a single read, matching the store gate), and the composer opens only from source_stopped on (accountMoveQueues). Sends during draining/source_stopping cannot start from the UI, and the new Go test proves the backend refuses them immediately without queueing. A stale frontend phase is covered by the existing ErrNotProvisioning fallback to the live controller. Rollback keeps the phase at target_starting, so the restarted old agent keeps the queue and drains it after finish.
Optional: there is still no test that deliverQueuedAfterAccountMove dispatches the queued turn when the move completes.
Resolves the conflicts with main's usage-limit reset time (#7991), step names (#7840), keep-typing-during-an-account-move (#7992) and full-history find (#7684): - controller.go: SettleTurnWithFailureCode now takes the usage-limit reset time too; the refused login's auth_required code still goes in. - ChatWorkspace: the composer keeps main's account-move condition and the band's typingLocked; the Timeline gets both findUnavailable and loginLines; the refused message's status moves into main's renderSingleRun. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(chat): queue messages sent during an account move The composer was inert for the whole move and the controller refused sends, so anything typed while the account changed was lost. Once the old agent has stopped, a send is now stored as a queued turn (the path a starting or hibernated chat already uses), the new agent's start keeps it instead of settling it as orphaned work, and it is drained when the move completes or rolls back. Sends made before the old agent stops wait for that point, so nothing reaches the old account. The composer stays editable during the move and hides Stop, since no agent is running to stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(inspector): time an account switch from when it started The activity row showed the session's last activity next to "Switching account", which read as a switch running for hours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(chat): open the composer only once the old agent has stopped A drain-policy account move stays in draining until the running turn ends, which can take minutes. The composer was open for the whole move, so a send during the drain waited 20 s on the backend and then failed with the handoff error. The composer now opens, and a send queues, only from source_stopped on. Before that the composer stays locked as it was before this change, and the backend refuses at once instead of waiting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit db597d9) # Conflicts: # frontend/src/renderer/components/chat/ChatWorkspace.tsx # frontend/src/renderer/hooks/useSessionInterfaceSwitch.test.tsx
Follows the OrchestratorInc#7992 merge: the store change called upstream's transitionRowToDomain; the fork helper is interfaceTransitionToDomain.
Summary
Switching a chat's Claude account made the composer inert for the whole move, and the controller refused sends, so whatever you typed was lost and had to be typed again afterwards.
queueWithoutController). The store accepts it only while an account move is betweensource_stoppedandactivating.source_stopped(preflight, draining, stopping) nothing changes: the composer stays locked and the backend refuses a send at once, so nothing reaches the old account. A drain-policy move can sit indrainingfor minutes while the running turn finishes.Startkeeps that queued turn instead of settling it as orphaned work, the same way a wake does. This covers a rollback restart of the old agent too.source_stoppedon, the composer is editable and hides Stop, since no agent is running.Evidence
Real desktop app, real Claude Code on two accounts (team → personal), isolated lab data. The script types a message and presses Enter about 2 s into the move.
target_starting, ran on the new account 4 ms after the move committedThe move itself is unchanged (3.5–4.4 s in the lab).
Tests
TestSendDuringAccountMoveQueuesForTheNewAgent: a send after the old agent stopped is queued, and starting the new agent keeps it.TestSendWhileAccountMoveDrainsIsRefusedWithoutQueueing: a send duringdrainingis refused at once and queues nothing.useSessionInterfaceSwitchtest: the composer opens forsource_stoppedandtarget_starting, not fordrainingorsource_stopping.go veton the touched packages is clean. The test suite runs in CI.Risks
recovery_requireddoes not deliver the queued message: the next ordinary start settles it as failed, with its text kept in the timeline.🤖 Generated with Claude Code