Repository navigation
Say "Reconnecting…" on the live line while a Bot retries its model - #2942
Merged
Merged
Conversation
A Bot whose model connection drops now tries again by itself. While it waits, its run sends a CUSTOM openbot.reconnecting event, and openbot.reconnected once the retried call answers. The turn's live line reads "Reconnecting…" in place of "Thinking" until then, or until any other event of the run, or its end. Mid-turn it shows under what the Bot already said. Same line and shimmer, nothing new drawn. The two events are documented on AgUiEvent in api/asyncapi.yaml, so any Bot can send them over plain AG-UI.
CI holds every real-browser test to a real-browser job, so the new layout test is listed in the Chromium and WebKit one.
…ing… layout test Browser tests wait for the page, never the clock (no-fixed-settle-waits.test.ts).
davidmckayv
marked this pull request as ready for review
December 4, 2026 16:56
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 4, 2026 16:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
While a Bot waits to try a dropped model call again, the turn's live line says "Reconnecting…" in place of "Thinking". Same line, same place, same shimmer, same
role="status". Nothing new is drawn. If the Bot runs out of tries, the run ends with its error and the existing "connection dropped" notice and Carry on appear, unchanged.Mid-turn, after the Bot has already said something, nothing used to show while the next model call was pending. While reconnecting, the same line now comes back under the Bot's words and goes when the Bot carries on.
Why
A Bot stopped mid-turn when its model connection dropped, and the person had to press Carry on. The engine is being changed to retry transient model failures by itself, with backoff, and carry the turn on. The person should see only a quiet sign that it is reconnecting while it waits.
The contract, plain AG-UI
Any Bot can send it, built in or connected, as
CUSTOMevents on its run:openbot.reconnecting, value{ attempt, attempts, retryInMs }(attempt counted from 1). One per wait, several in a row allowed.openbot.reconnected, value{}, when the retried call starts answering.The line also clears on any later non-CUSTOM event of the run (words, a tool call, reasoning, a step,
RUN_FINISHED,RUN_ERROR), and when the run ends or fails. Other CUSTOM events change nothing. Documented onAgUiEventinapi/asyncapi.yamlas two new optional members,nameandvalue. The change is additive:api:live:diffreports no break, andapi:lintpasses.How
app/src/lib/copilot/reconnecting.ts:watchReconnecting(agent, set)subscribes to the agent's AG-UI events (onEvent,onRunInitialized,onRunFinalized,onRunFailed) and keeps the state per run.useReconnecting(agent)is the hook.channel-chat.tsxreads it from the conversation's agent and passesreconnectingthroughConversationViewtoChatTranscript.chat-transcript.tsx:Thinkingreads "Reconnecting…" while reconnecting, and is drawn whilebusy && reconnectingas well as where it was drawn before.What the leaders do
Most of them retry quietly, with a short status line on the work line, and say something only when the retries run out. This follows that pattern with the quiet "Reconnecting…" wording. The events carry
attempt,attemptsandretryInMs, so a count could be added later.Tests
app/tests/reconnecting-line.test.tsxfeeds real AG-UI events through a realAbstractAgent, the sameuseReconnectingsubscriber the screen uses, and the realChatTranscript. It checks that "Reconnecting…" appears on the live line and goes onopenbot.reconnected, on the next words, at run end, and onRUN_ERROR, including mid-turn under the Bot's words. Red without the transcript change (3 fail: the line still says "Thinking", or nothing mid-turn). Green with it.app/tests/reconnecting-line-layout.test.tsxruns the realConversationViewin a real browser (Chromium and WebKit, light and dark, 1000px and 390px wide). It checks that "Reconnecting…" is drawn exactly where "Thinking" was, at the same size, colour and weight, on one line, with no sideways scroll, under the Bot's words mid-turn, and gone once it carries on.Changelog
Conversations.
API.
CUSTOMeventsopenbot.reconnectingandopenbot.reconnectedwhile it waits to try its model again. Any Bot can send them, built in or connected.