Skip to content

fix(chat): keep typing during an account move - #7992

Merged
illegalcall merged 3 commits into
mainfrom
ao/unblock-input/account-move-queue
Nov 9, 2026
Merged

illegalcall merged 3 commits into
mainfrom
ao/unblock-input/account-move-queue

Conversation

@illegalcall

@illegalcall illegalcall commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Once the old agent has stopped, a send is stored as a queued turn. This is the same path a starting or hibernated chat uses (queueWithoutController). The store accepts it only while an account move is between source_stopped and activating.
  • Before 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 in draining for minutes while the running turn finishes.
  • The new agent's Start keeps 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.
  • The queue is drained when the move completes or rolls back.
  • From source_stopped on, the composer is editable and hides Stop, since no agent is running.
  • The inspector times "Switching account" from when the move started, not from the session's last activity (it showed "3h ago").

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.

main this PR
Composer during the move inert, aria-disabled; typing lost editable; Enter shows "1 Queued Message"
Message typed mid-move never sent; retyped after the move queued at target_starting, ran on the new account 4 ms after the move committed
Click → answer 10.3 s (with retyping) 7.6 s

The 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 during draining is refused at once and queues nothing.
  • useSessionInterfaceSwitch test: the composer opens for source_stopped and target_starting, not for draining or source_stopping.
  • go vet on the touched packages is clean. The test suite runs in CI.

Risks

  • A move that ends in recovery_required does not deliver the queued message: the next ordinary start settles it as failed, with its text kept in the timeline.

🤖 Generated with Claude Code

illegalcall and others added 2 commits November 8, 2026 19:02
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>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🏆 Review leaderboard

Nov 1–8, 2026 · UTC

Rank Reviewer PRs reviewed Review rounds PR comments
🥇 @ronishrohan @ronishrohan 58 103 17
🥈 @Rishet11 @Rishet11 23 45 19
🥉 @nikhilachale @nikhilachale 12 42 4
4 @somewherelostt @somewherelostt 11 46 1
5 @illegalcall @illegalcall 10 19 3
6 @Meraj-08 @Meraj-08 10 17 0
7 @Prasad-D-Ware @Prasad-D-Ware 10 15 0
8 @Vaibhaav-Tiwari @Vaibhaav-Tiwari 8 9 1
9 @Annieeeee11 @Annieeeee11 7 9 2
10 @Pritom14 @Pritom14 6 7 3

Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded.

Show 7 more reviewers
Rank Reviewer PRs reviewed Review rounds PR comments
11 @mohakchakraborty2004 @mohakchakraborty2004 4 5 2
12 @neversettle17-101 @neversettle17-101 3 4 3
13 @ApexYash11 @ApexYash11 2 3 0
14 @codebanditssss @codebanditssss 2 2 0
15 @wesleymatosdev @wesleymatosdev 1 2 1
16 @harshitsinghbhandari @harshitsinghbhandari 1 2 0
17 @Vansh-Singhal @Vansh-Singhal 1 2 0

@OrcInc OrcInc added bug Something isn't working comp/daemon Go daemon, process lifecycle, and backend control plane. labels Nov 8, 2026
@OrcInc OrcInc added this to the Agents & orchestration milestone Nov 8, 2026

@illegalcall illegalcall left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 illegalcall left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@illegalcall
illegalcall merged commit db597d9 into main Nov 9, 2026
28 checks passed
Annieeeee11 added a commit that referenced this pull request Nov 9, 2026
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>
axisrow pushed a commit to axisrow/agent-orchestrator that referenced this pull request Nov 11, 2026
* 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
axisrow added a commit to axisrow/agent-orchestrator that referenced this pull request Nov 11, 2026
Follows the OrchestratorInc#7992 merge: the store change called upstream's transitionRowToDomain; the fork helper is interfaceTransitionToDomain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working comp/daemon Go daemon, process lifecycle, and backend control plane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants