Skip to content

A conversation opened on a slow connection says when its last run failed, with Carry on - #2933

Merged
davidmckayv merged 1 commit into
mainfrom
feat/conversation-last-run
Dec 4, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
feat/conversation-last-run

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #2931.

Found on OpenBot Cloud, 2026-12-04. A conversation whose Bot's run failed part way can open with nothing said about the failure: the Bot's last line, no notice and no Carry on. The run's error is not in the stored messages, only in the run's events. Opening the conversation replays those events, but only for 1.5 seconds before the app shows the stored history instead. On a slow link, a reload never reaches the error. #2931 fixed coming back to the conversation in the same page, where the app had heard the error itself. A reload has heard nothing, so only the server can say.

API (additive, read-only, optional). createConversationJoinToken's answer gains lastRun. It is the thread's most recent run and how it ended, in the same shape getConversationRun already answers (ConversationRun: id, outcome, endedAt). It is null when the server keeps no run of the thread, and absent from a server from before it. Nothing is renamed or tightened, and an older app ignores it. oasdiff reports no breaking change.

App. When the join that opens a conversation doesn't finish, the app reads lastRun from the join token it already asks for. If the last run failed and no run is going, the app says so under the turn:

  • In the error's own words, with its code, where this page heard them.
  • Otherwise as a turn that stopped part way: "The Bot stopped before it finished. What it saved is shown here.", with Carry on.

It says nothing in these cases:

  • The last run finished, was stopped, stopped to ask somebody, or is still going.
  • The failed run belongs to a turn the server refused, which is already drawn under its own message.

Against a server without lastRun, #2931's behaviour stands. The same holds for every Bot, built-in or connected over AG-UI: it is read from the server's record of the run, not from anything of the Bot's.

How the leaders do it

A thread's status names its last run's outcome:

lastRun follows both. It is a run object with its id and outcome, like OpenAI's, read with the thread's handle, as LangGraph reads status with the thread. It reuses OpenBot's existing ConversationRun rather than adding a second status vocabulary.

How the leaders show the failure itself is in #2931: Claude Code, ChatGPT and Cursor keep the work and show the error on the turn with one way on, also when you come back.

Tests

app/tests/stopped-turn-return-browser.test.tsx runs in a real browser against a real HTTP server standing in for the API and the runtime, in Chromium and WebKit, light and dark, at 390 and 1280 px.

New in this PR:

  • Reload on a slow link. The conversation is opened again from nothing, with the replay slower than the join's deadline. The server says the last run failed, and the turn shows the notice and Carry on. Red before (no notice at all), green after.
  • A stopped run. Opened the same way, a run that was stopped says nothing.
  • An older server. One that doesn't name the last run: coming back in the same page still says the failure, and a slow reload opens on the history as before.

app/tests/last-run-failure.test.ts holds the rules underneath, one answer each:

  • a failure heard here is said in its own words;
  • a failure of an older run is not said when a later one finished;
  • a finished, stopped, waiting or going run says nothing;
  • a refused turn's run isn't said twice;
  • with an older server, only the kept agent's own failure is said.

Red/green, locally:

  • Browser test, app without this change: 8 fail and 4 pass. The 8 are the slow-reload step in every engine, theme and width, where the notice was missing. The 4 are the stopped-run and older-server guards, which pass both ways.
  • With the change: 12 of 12 pass.
  • The neighbouring conversation tests pass: 140 across 13 files.

The notice and Carry on are the existing components, unchanged.

Changelog

API.

  • Added: a join token names the conversation's last run. createConversationJoinToken answers lastRun: the thread's most recent run and how it ended (id, outcome, endedAt, as getConversationRun says it), or null when the server keeps none. A server from before this leaves it out.

Web app and OpenBot Desktop.

  • Fixed: a conversation opened on a slow connection says when its last run failed, with Carry on. If the Bot's run had failed part way (its model connection dropped, say), opening or reloading the conversation on a slow connection showed the Bot's last line with nothing to say it had stopped. It now says the Bot stopped before it finished and offers Carry on, as it did when the run failed.

…fter a slow reload

A conversation opened on a slow link replays its runs past the join's 1.5 s
deadline, so a reload never heard its last run fail and showed the Bot's last
line with no notice and no Carry on. createConversationJoinToken now answers
lastRun (the thread's most recent run, as getConversationRun says it; null when
there is none, absent from an older server), as LangGraph's thread status and
OpenAI's run status name a thread's last outcome. When the join didn't finish,
the app reads it: a last run that failed is said in its own words where this
page heard them, otherwise as a turn that stopped part way, with Carry on. A
stopped, finished, waiting or refused turn says nothing, and an older server
keeps the kept agent's own failure as before.

Browser test in Chromium and WebKit: the slow reload is red without the app
change and green with it.
@davidmckayv
davidmckayv force-pushed the feat/conversation-last-run branch from 696fc2f to e5da42d Compare December 4, 2026 11:50
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 4a2f308 Dec 4, 2026
26 checks passed
@davidmckayv
davidmckayv deleted the feat/conversation-last-run branch December 4, 2026 12:08
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