Give the Bot in the box the fix the other Bot got - #165
Merged
davidmckayv merged 2 commits intoAug 22, 2026
Conversation
A declined take-the-wheel leaves an assistant message holding a tool call that nothing ever answers, and every later turn in that thread dies at the provider with "an assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'". That was fixed in agent-langgraph and only there. agent-bot is the Bot that ships in the box and the one behind the Browser Bot, it builds its history in its own function, and it went on failing in exactly the same way. Driving the release candidate put the error on screen in red, on the Bot a person meets first. Same treatment: unanswered calls are answered when the history is built, immediately after the assistant message that made them, with the truth rather than a fake success. The wording moves to shared/bot-prompt.ts, which both Bots already import, because two implementations telling a model different things about the same situation is how this happened. agent-langgraph re-exports it so its own tests and callers are unchanged. The function moves to agent-bot/src/history.ts for the reason the other one did: index.ts calls serve() at module scope, so a test that imports it to reach one pure function binds a port. Driven in Chrome on a rebuilt container. New chat, ask for a GitHub page behind a sign-in, decline the handover, and the conversation carries on: 17 x 3 = 51, then an honest "No. I opened it, but it redirected to GitHub's sign-in page, so I could not read your display name." Before this, the red 400 banner and nothing else, for every message after.
davidmckayv
requested review from
MikeRyanDev,
guidovizoso and
tylerslaton
as code owners
August 22, 2026 14:30
…x-answers-its-unanswered-calls
davidmckayv
deleted the
fix/the-bot-in-the-box-answers-its-unanswered-calls
branch
August 22, 2026 16:21
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.
A gap in #147, found by driving the release candidate.
What was still broken
A declined take-the-wheel leaves an assistant message holding a tool call that nothing ever answers, and every later turn in that thread dies at the provider:
#147 fixed that in
agent-langgraph. Only there.agent-botis the Bot that ships in the box and the one behind the Browser Bot, it builds its history in its own function, and it went on failing in exactly the same way.So the fix landed on the Bot fewer people meet, and the one a person meets first still destroyed the conversation. It showed up in red across the top of the transcript while driving the release candidate.
The fix
Same treatment, against this Bot's provider shape: collect which
tool_call_ids were ever answered, and for any that were not, append a tool result immediately after the assistant message that made the call — position matters, an answer at the end of the history fixes nothing.It says the truth rather than a fake success, so the Bot does not report work it never did.
The wording moves to
shared/bot-prompt.ts, which both Bots already import forCOMPUTER_GUIDANCE. Two implementations telling a model different things about the same situation is precisely how this happened.agent-langgraph/src/history.tsre-exports it, so its tests and callers are unchanged.The function moves to
agent-bot/src/history.tsfor the reason the other one did:index.tscallsserve()at module scope, so a test importing it to reach one pure function binds a port.Driven in Chrome, on a rebuilt container
New chat → "Open https://github.com/settings/profile and read my display name." → GitHub sign-in wall, help request raised → declined by sending something else:
https://github.com/settings/profile, but it redirected to GitHub's sign-in page, so I could not read your display name."Three turns, all alive, and it does not claim a result it never got. The provenance rule from #153 is visible in the same answer, unprompted.
Tests
agent-bot/tests/history.test.ts, five cases mirroring the other Bot's:Three of the five fail with the fix disabled. Full suite 1204 passing, lint, format and typecheck clean.
agent-bothas no tests directory before this and is not typechecked in CI — worth its own look, but not folded in here.