fix(frontend/sdk): show every tool call the same way, live and after reload - #5932
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Added a second commit: fix(runner) for the empty codex tool outputs. The runner only knew how to read text results; codex reports results as objects, so 100% of codex tool outputs and error messages stored and streamed empty. The runner now reads the object shapes (verified against the pinned codex bridge source), with 10 new unit tests on a path that had none. Proven live on the dev stack with the real payload shapes; a failed call now shows its actual error text. Claude and pi paths are untouched. |
Railway Preview Environment
Updated at 2026-08-11T11:31:30.719Z |
…puts, resolved names, parity goldens
…rs carry their text again
… structure instead of being dropped whole
2dbce76 to
9d072e1
Compare
Context
The same tool call looked different depending on when you looked at it. A commit approval card rendered as a clean "what is changing" view while the turn streamed, then a background refresh rebuilt the chat from the saved records and the same card degraded to a raw JSON blob. The cause: the chat has two builders (one for the live stream, one for the saved records), and they drifted apart with no test forcing them to agree. Found and diagnosed on 2026-08-11, sessions 3d99d178 and f60bc4f8 on the dev stack. This PR stacks on #5919; its base will move to the release branch when that PR merges.
Changes
Four fixes, each making the two builders agree, plus the tests that keep them agreeing.
Replay unwraps the transport envelope. Saved records store a tool call's input as
{tool, server, arguments: {...}}. The cards read the bare arguments. Both replay copies now unwrap conservatively (only when every sibling ofargumentsis a string envelope key), so a replayed commit card findsworkflow_revisionat the top level and renders the real diff view instead of JSON.The live stream shows the bare arguments too (Python SDK). Ordinary tool calls streamed the envelope, and a gated call could show the bare form first and the envelope moments later. The SDK's stream adapter now unwraps with the same rule, so live and reload show the same input, always.
Before (live, ordinary MCP call):
After (live and reload):
Replayed approval cards use the resolved tool name. Replay kept the raw wire name, so a reloaded card said "Mcp.agenta tools.commit revision" where live said "Commit revision". Worse, the raw name slipped past the guard that keeps platform operations ungrantable: a replayed card could offer "Always allow" for
commit_revisionand store a permission key the runner can never match. Both copies now resolve the name the same way the live stream does; live and replayed cards produce the same name, the same grant eligibility, and the same permission key end to end.Golden parity tests from real sessions. Three real sessions (commits, schedules, forms, connects, both interaction-row generations) are captured as fixtures, together with the actual output of the live builder over the same events. New suites assert: the two replay copies stay identical outside three documented, individually-pinned divergences; every replayed part carries the exact shape each card component reads (each assertion cites the component line it protects); and replayed parts equal live parts for the same records. Any future drift between the builders is a red build, not a UI surprise.
Also: the secret scanner config allowlists exactly the uuid-shaped interaction tokens inside the new fixtures (they are join keys, not credentials), verified against the gitleaks version CI pins; planted real-key shapes in the same files are still caught.
Tests
What to QA
{tool, server, arguments}JSON anywhere.