Skip to content

Carry on works while the server carries a cut-off turn on - #2810

Merged
davidmckayv merged 4 commits into
mainfrom
fix/carry-on-while-server-carries
Dec 3, 2026
Merged

davidmckayv merged 4 commits into
mainfrom
fix/carry-on-while-server-carries

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Found on OpenBot Cloud (Travis, dogfooding): after "The Bot stopped before it finished because OpenBot's backend stopped answering", pressing Carry on did nothing. No message, no run, nothing on screen.

What happened: the server running the turn went away, and another server took the turn up (carried-turn-claimed). The conversation's work said the server was carrying the turn on, so the conversation was busy. But the stopped notice and its Carry on stayed up over it. Carry on sends a message as the person, a message is refused while the Bot has the turn, and the button dropped that refusal (.catch(() => undefined)).

  • While the server carries a turn on, a cut-off notice is put away. The conversation shows its usual working state (Thinking, Stop), with no Carry on. When the server is done, the notice comes back only if the last of the server's runs followed here did not finish. A turn the server carried to its answer says nothing about having stopped. Other notices stay (a Stop the server refused is about now).
  • Carry on is sent the way a typed message is. Pressed while a turn is in flight, it waits in the queue and shows as queued (Queued, Send now, Remove), then goes once when the turn ends. A send refused because the Bot is still working is parked the same way and sent again once the Bot is free. Any other failure puts it back in the queue instead of dropping it. The button is hidden while its words are waiting or while the send a press of it started is going, so two presses never make two turns. A turn the person typed that is cut off shows its Carry on with its notice at once, as on main, even while its stream is still closing.
  • Pressing Carry on while the server carries the conversation on after an approval no longer starts a second turn racing the server's. On main it ran at once. It now waits as queued.

It works the same for any Bot, a stock AG-UI Bot included. The change is all in the browser and reads only the conversation's work, which the server reports for every Bot's turn.

No visual design change. Only components and states the app already has: the Thinking row, Stop, and the queued message row. No new text.

Where it runs

In the browser only (app/src/components/channels/channel-chat.tsx, conversation-view.tsx).

  • New state that outlives a request? None. The queue is the existing in-tab queue.
  • What happens on the second replica? Nothing new on the server. The page reads the conversation's work and the run's ending through the existing API.
  • Anything serialised? None.
  • Anything fanned out to a browser? None new.
  • New listener, port, or schedule? None.

Boundary and audit

  • Every acting call still goes through the gateway: resolve, decide, audit, then act.
  • New refusals and new failures each write a row. (None added.)
  • Nothing new is trusted from the client that the server can resolve itself.

API and database

  • This changes nothing under api/, no app's requests, no database change and no release-policy.json.

Changelog

Conversations.

  • Carry on works while the server is still carrying a turn on. A turn cut off when its server went away now reads as working while another server carries it on, with no stopped notice and no Carry on. A Carry on pressed while the Bot still has the turn waits as a queued message and is sent once the turn ends, instead of doing nothing.

Proof

Red on 99df719ec (main after #2811, #2813, #2814, #2815 and #2816), green with this change rebased on it:

  • app/tests/carried-turn.test.tsx, "a turn cut off here that the server carries on reads as working, with no notice or Carry on, and ends on its answer". On main it fails: the notice and its Carry on are still up while the server carries the turn.
  • app/tests/carry-on-while-busy.test.tsx, "Carry on pressed while the server still has the turn waits as a queued message, and is sent once when the turn ends". On main it fails: nothing is queued, and the press is not held for the turn.
  • app/tests/carry-on-while-busy.test.tsx, "a typed turn cut off part way says so with its Carry on at once, while its stream is still closing". Found in CI on an earlier version of this change, which hid Carry on while any send from the screen was going: WebKit read the notice before Carry on was drawn (stopped-turn-dismiss-browser). Fails on that version, passes now.
  • app/tests/carry-on-carried-turn-browser.test.tsx (new, in the CI browser job, waiting on the page rather than the clock, with its one wait that proves a single send listed in no-fixed-settle-waits): both scenes in Chromium and WebKit, light and dark, 1280px and 390px. 16 of 16 pass with the change and 16 of 16 fail on main. The fixture stands in for the socket: it puts the conversation's work on its roster row and reads the approvals again when the test's server says so.
  • The conversation suites that touch Carry on, the composer queue or ChannelChat (53 files, 462 tests) pass. tsc and Biome are clean.

Screenshots, main and fix, compared pixel by pixel. The step before the change ("cut off", "interrupted") is identical in every Chromium shot and every WebKit shot but one or two. The WebKit outliers move between runs (a copy button settling a frame late), so they are timing, not this change. The steps after differ only where the state changed:

Step main this change
Server carries the cut-off turn Stopped notice and Carry on over a working conversation (Stop up, sidebar "Working") Thinking, Stop, no notice
Carried turn ends on its answer (main fails before this) The answer, no notice, no Carry on, no extra run
Carry on pressed while the server has the turn Sent at once, beside the server's turn Queued with Send now and Remove; the notice keeps no Carry on
The turn ends (main fails before this) The queued Carry on goes once, one run

@davidmckayv
davidmckayv force-pushed the fix/carry-on-while-server-carries branch 2 times, most recently from ccf7869 to b40521b Compare December 2, 2026 23:09
A turn cut off here ("OpenBot's backend stopped answering") kept its
stopped notice and Carry on while another server carried the turn on, and
Carry on, refused because the Bot still had the turn, was dropped: no
message, no run, nothing on screen.

While the server carries the turn on, a cut-off notice is put away and the
conversation reads as working, with no Carry on. It comes back only if the
last carried run did not finish. Carry on is now sent the way a typed
message is: pressed while a turn is in flight, or refused as still working,
it waits in the queue, drawn as queued, and goes once when the turn ends.
Any other failure puts it back in the queue rather than dropping it.
A browser test of the real conversation in the app's frame: a turn cut off
here and then carried on by the server reads as working, with no notice or
Carry on, and ends on its answer; and Carry on pressed while the server
still has the turn waits as a queued message and goes once. The fixture
stands in for the socket, putting the conversation's work on its roster
row and reading the approvals again when the test's server says so.
…e clock

no-fixed-settle-waits failed on the new browser test's four fixed waits. Three now wait for what
they were standing in for: the stopped notice put away, the run-ending read answered, the queued
row drawn. The fourth proves the queued Carry on goes once, and is listed with why.
Carry on was hidden while any send from this screen was going, so a typed turn that was cut off
said it stopped with no Carry on until its stream had closed. WebKit in CI read the notice in that
gap (stopped-turn-dismiss-browser). It is now held back only while the send a press of it started
is going, which still keeps two presses from making two turns; pressed while a stream is closing,
it waits as queued. A test holds a cut-off turn's stream open and checks Carry on is there.
@davidmckayv
davidmckayv force-pushed the fix/carry-on-while-server-carries branch from 30ee64d to 4b6cedd Compare December 2, 2026 23:51
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit f2decc7 Dec 3, 2026
71 of 77 checks passed
@davidmckayv
davidmckayv deleted the fix/carry-on-while-server-carries branch December 3, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant