Repository navigation
Say "couldn't reach its backend" only when nothing answered the run - #2891
Open
davidmckayv wants to merge 5 commits into
Open
davidmckayv wants to merge 5 commits into
davidmckayv wants to merge 5 commits into
Conversation
A run the backend answered and refused was told to the person as
"OpenBot couldn't reach its backend, so your message wasn't sent. Try
again, or quit and reopen OpenBot." CopilotKit's Intelligence agent
throws every failed run request as `REST run request failed: <body>`,
status gone, and every such failure was read as the backend being out of
reach.
Found on OpenBot Cloud 1.2.9 with OpenBot Desktop 1.2.0-rc.5: each run
of a public Bot the runtime couldn't build was answered 404 with the
runtime's own `{"error":"Agent not found",...}` while the API still
listed the Bot and read it back, and the person read the false sentence
three times.
Now the body decides. A JSON body is the backend answering:
- an OpenBot problem with a sentence for the person is shown as before;
- "Agent not found" for a Bot the server still reads back says the Bot
can't run because its setup isn't finished, and who can finish it;
- anything else says the backend couldn't start the turn, with "ask an
admin if it keeps happening".
Only a failed fetch ("Failed to fetch", "Load failed"), a proxy's page or
a bare status text keeps "couldn't reach its backend". A later run of a
turn the backend refused no longer says the backend stopped answering.
botNoLongerUsable now throws when the read of the Bot fails any way other
than 404, so a failed read is never taken as the Bot still being there.
…'t start the turn
…efused-run tests Adding run-refused-browser to the WebKit job moved sidebar-current-row from shard 1 to shard 2, among other neighbours. There its first WebKit test failed twice running with "Target page, context or browser has been closed", the WebKit-on-Linux compositor crash under CI's load that renderer-crash.ts runs again. The file took bun's own test, so the crash failed the job. It passes alone, and on that shard locally. Both files now take `test` from renderer-crash.ts. The refused-run test also runs at a phone's width only for the not-built case, the longest sentence: 10 pages where it opened 16.
davidmckayv
marked this pull request as ready for review
December 3, 2026 20:59
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 3, 2026 20:59
This branch has not been deployed
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 this changes
A first message the backend refused was told to the person as "OpenBot couldn't reach its backend, so your message wasn't sent. Try again, or quit and reopen OpenBot." That sentence is false when the backend answered, and quitting and reopening can't help.
Found on OpenBot Cloud 1.2.9 with OpenBot Desktop 1.2.0-rc.5 connected to it. A new conversation with a public Bot the runtime couldn't build: each of three runs was answered 404 with the runtime's own body,
{"error":"Agent not found","message":"Agent '…' does not exist"}, while the API still listed the Bot and read it back. CopilotKit's Intelligence agent throws every failed run request asREST run request failed: <body>, status and headers gone, andstopped-turn.tsread every such failure as the backend being out of reach.Now the body decides (
app/src/lib/copilot/stopped-turn.ts):{ "error": … }, a server fault): "OpenBot's backend couldn't start this turn, so your message wasn't sent. Try again, or ask an admin if it keeps happening." Joining a conversation says "couldn't open this conversation".botNoLongerUsable(app/src/lib/agents/queries.ts) now throws when the read of the Bot fails any way but 404, so a failed read is never taken to mean the Bot is still there and "setup isn't finished" is only said when the server answered both.The raw body still goes to the console and the troubleshooting log, with the request id when the body has one. No new screen, component or style: the same stopped-turn notice, with a true sentence.
Where it runs
Boundary and audit
API and database
api/, no app's requests, no database change and norelease-policy.json.Changelog
Conversations.
Proof
Red on main, green with the fix (
origin/main'sstopped-turn.tsandqueries.tsput back, the new tests run, then the fix restored):app/tests/stopped-turn.test.ts+app/tests/channel-failed-run-restore.test.tsx: main 39 pass, 7 fail; fix 46 pass, 0 fail. On main each failing case received "OpenBot couldn't reach its backend, so your message wasn't sent. Try again, or quit and reopen OpenBot." for the exact 404 body Cloud sent, a 403{"error":"Forbidden"}, a 409 lock body, a non-OpenBot problem and a 500 problem.app/tests/run-refused-browser.test.tsx(new, real browser): the real conversation in the app's frame with the app's runtime client over the Intelligence transport, against a local HTTP server answering the API and runtime addresses. Four cases × Chromium and WebKit × 1280 and 390 px: the 404 Cloud sent, the run gate's 403 problem, a 403 with no sentence, and no answer at all (the run request aborted, so each engine's own fetch error). Main: 8 pass, 8 fail (both refusal cases in both engines showed the false sentence). Fix: 16 pass, 0 fail.Screenshots, before and after, Chromium and WebKit, 1280 and 390: the notice is the same component in the same place, inside the window, nothing sideways. Before, the 404 case read "OpenBot couldn't reach its backend, so your message wasn't sent. Try again, or quit and reopen OpenBot."; after, "This Bot can't run because its setup isn't finished, so your message wasn't sent. Its owner or an admin can finish it in Setup.", wrapping to three lines at 390 px like every other notice. The no-answer case is unchanged in both engines.
Neighbouring suites pass: desktop-problems, organization-unavailable-chat, conversation-access-ended, carried-turn, carry-on-carried-turn-browser, plan-free-trial, too-many-requests-rules, and the copy rules under
tests/.tsc --noEmit,biome formatandbiome lint --error-on-warningsare clean.