perf(chat): avoid reparsing cumulative A2UI arguments - #1078
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
September 9, 2026 01:54
Contributor
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.
Reverse homepage replay spends excessive time reparsing cumulative A2UI tool arguments. Keep one partial parser per tool call and feed only appended characters; ignore duplicate buffers and rebuild the parser for nonappend replacements. Dispatch and malformed-input handling remain unchanged.
A deterministic regression reduces parser input from 52,212 characters to 228 for a 228-character payload delivered as cumulative prefixes with duplicates. This bounds parser input volume; full-prefix validation and materialization still require production performance verification.
Validation: regression failed before the fix; all 321 focused chat/A2UI tests and 10 homepage browser tests pass. Independent review found no important correctness issues and compared retained/fresh parser results across 259 prefixes. Chrome production traces identified the partial parser as the reverse-playback hotspot; production re-verification follows deployment.