Skip to content

Update the streaming parser to support A2UI spec v0.9#962

Open
nan-yu wants to merge 2 commits intogoogle:mainfrom
nan-yu:streaming-parser
Open

Update the streaming parser to support A2UI spec v0.9#962
nan-yu wants to merge 2 commits intogoogle:mainfrom
nan-yu:streaming-parser

Conversation

@nan-yu
Copy link
Copy Markdown
Collaborator

@nan-yu nan-yu commented Mar 24, 2026

Description

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. For larger changes, raising an issue first helps reduce redundant work.

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the A2UI streaming parser to enhance support for both v0.8 and v0.9 message formats, particularly for data model updates and component handling. The changes introduce an abstract A2uiVersionHandler with version-specific implementations for message recognition, surface ID extraction, component wrapping, and data model parsing. The A2uiStreamParser now utilizes these handlers, leading to a more modular and extensible design. Key updates include a new _get_loading_placeholder helper, refined JSON buffer processing, granular v0.9 data model update handling with path-based merging, and improved component dependency tracking. Comprehensive new tests for v0.9 functionality have been added. Review comments indicate a duplicate test function in test_streaming_v09.py, an unused parameter in _get_loading_placeholder, a potentially redundant or problematic lstrip call in _process_json_chunk, a commented-out debug log that should be addressed, and two TODOs in version_handlers.py highlighting architectural debt related to data model parsing and path depth support.

@nan-yu nan-yu force-pushed the streaming-parser branch 2 times, most recently from fcac4be to 9f210f7 Compare March 26, 2026 23:07
@nan-yu nan-yu force-pushed the streaming-parser branch from 9f210f7 to b9dba29 Compare March 26, 2026 23:12
@nan-yu
Copy link
Copy Markdown
Collaborator Author

nan-yu commented Mar 26, 2026

This needs to rebase once #991 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants