Fix streaming top-level objects without list wrapping#1541
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the streaming parser to support parsing single and multiple top-level JSON objects without array wrapping, and adds corresponding unit tests. Feedback suggests simplifying a redundant boolean condition in the parser logic to improve readability, and keeping the validator enabled in the new tests to maintain realistic test coverage.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@selamw1 any update on this issue? when can we expect this to be released? |
Description
A2UI v0.9 streams use consecutive top-level JSON objects (JSON Lines format) instead of wrapping them in a top-level array
[...]. Previously,A2uiStreamParserskipped every character until it saw a[bracket, causing all v0.9 blocks to be silently discarded.Fixes #1527
This PR refactors the streaming parser's guard to use a fall-through design:
{when brace count is 0) directly.test_streaming_v09.pyto ensure single and consecutive top-level objects are parsed successfully without list wrapping.Pre-launch Checklist