Preserve ToolCallResult input in AG-UI replay fallback - #1037
Merged
Merged
Conversation
The shared AG-UI decoder dropped ToolCallResult.input when replay attached after ToolCallStart/ToolCallArgs were missed. In that case it synthesized a generic tool input of , which erased the tool context that the sender had already provided on the result payload. This change accepts optional result-level input and uses it only when no earlier tool-call state exists. Constraint: Preserve the existing replay path for normal ToolCallStart/ToolCallArgs sequences and only use ToolCallResult.input as a fallback when the decoder lacks prior tool state Rejected: Always trust ToolCallResult.input over accumulated ToolCallArgs | would risk overriding richer streamed args on normal runs Confidence: high Scope-risk: narrow Reversibility: clean Directive: When AG-UI replay lacks prior tool-call state, use ToolCallResult.input as the fallback source of truth instead of inventing an empty input object Tested: deno test src/chat/ag-ui.test.ts; deno check src/chat/ag-ui.ts Not-tested: end-to-end replay through veryfront-studio after publishing the updated package
The failing Quest/CI browser pipeline was not caused by the AG-UI decoder patch. The red job died during Playwright's `--with-deps` install step because the runner could not reach archive.ubuntu.com over IPv6, so Chromium's OS packages never installed. Our browser helpers only require the Chromium executable in CI, and the runner image already has the needed shared libraries for the passing binary browser job. Constraint: Keep the browser test jobs installing the Playwright Chromium binary while removing the flaky apt-based system dependency path Rejected: Retry the same `--with-deps` install step | would keep the pipeline coupled to external apt mirror reachability and IPv6 routing Confidence: medium Scope-risk: narrow Reversibility: clean Directive: CI browser jobs should prefer deterministic browser-binary installs over apt-based dependency bootstrap when runner images already satisfy Playwright runtime libs Tested: Exact failing GitHub job log reviewed (tests rsc browser e2e); local targeted AG-UI decoder tests still green Not-tested: Fresh GitHub CI rerun after workflow update
The first workflow adjustment removed `--with-deps`, which got us past the apt mirror failure but exposed the real browser-launch requirement: the runner still needs shared libraries such as libnspr4.so. The root cause remained runner networking, not AG-UI code. This change restores Playwright's dependency install and forces apt onto IPv4 so the package step no longer depends on broken IPv6 reachability. Constraint: Keep the browser E2E jobs installing the Chromium system dependencies required by Playwright on veryfront-k8s-runners Rejected: Keep binary-only browser installs | browser launch still failed with missing shared libraries (libnspr4.so) Rejected: Keep plain `--with-deps` | apt was failing to reach archive.ubuntu.com over IPv6 on these runners Confidence: high Scope-risk: narrow Reversibility: clean Directive: Browser CI jobs on these runners should force apt to IPv4 before Playwright `--with-deps` installs unless runner networking is fixed upstream Tested: Exact failing GitHub job logs reviewed before and after the first workflow change Not-tested: Fresh GitHub CI rerun after the IPv4-forced apt change
kojiwakayama
enabled auto-merge (squash)
April 14, 2026 16:21
This was referenced Sep 8, 2026
This was referenced Sep 10, 2026
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.
Summary
ToolCallResult.inputwhen AG-UI replay attaches after prior tool events were missedProblem
The shared AG-UI decoder synthesized
{}for tool input when aToolCallResultarrived without a priorToolCallStart/ToolCallArgssequence, even if the result payload already contained the originalinput. That dropped replay fidelity for reconnect and snapshot-restore flows.Testing
deno test src/chat/ag-ui.test.tsdeno check src/chat/ag-ui.ts