fix(python-sdk): support relative data binding paths in v0.9 streaming parser#1179
Open
jacobsimionato wants to merge 4 commits intogoogle:mainfrom
Open
fix(python-sdk): support relative data binding paths in v0.9 streaming parser#1179jacobsimionato wants to merge 4 commits intogoogle:mainfrom
jacobsimionato wants to merge 4 commits intogoogle:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements version-specific path handling in the A2uiStreamParser to allow relative paths in v0.9 while maintaining the leading-slash heuristic for v0.8. It includes new test cases for both versions to verify these behaviors. Feedback indicates that the path placeholder logic remains destructive for v0.9 absolute paths because it clears object metadata, and it is suggested to restrict this logic to v0.8 as well.
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.
Description of Changes
Modified the
A2uiStreamParserin the Python SDK to conditionally skip the heuristic that automatically prepends a leading slash (/) to data bindingpathstrings. This heuristic is now restricted tov0.8catalogs. Forv0.9, the parser accurately preserves relative paths (no leading slash) and absolute paths (leading slash).Also added comprehensive test coverage:
test_v08_path_heuristic_adds_slash: Ensures v0.8 still receives the auto-prefixed slash.test_v09_path_heuristic_relative_path: Ensures v0.9 preserves relative paths natively.test_v09_path_heuristic_absolute_path: Ensures v0.9 still supports explicit absolute paths.Rationale
A2UI Protocol v0.9 introduces relative path resolution for components inside collection scopes (such as templates inside
List,Column, etc.). The previous streaming parser heuristic aggressively forced all paths to be absolute, which broke this core v0.9 feature. This fix properly aligns the streaming parser with the v0.9 specification.Testing/Running Instructions
Reviewers can verify these changes locally by running the test suite:
cd agent_sdks/pythonuv:export PYTHONPATH=$PYTHONPATH:$(pwd)/src && uv run pytest tests/parser/test_streaming_v08.pyandtest_streaming_v09.py.