Skip to content

Python a2ui_agent: Support custom cuttable keys configuration#1581

Open
nan-yu wants to merge 4 commits into
a2ui-project:mainfrom
nan-yu:re-arch-8-cuttable-keys
Open

Python a2ui_agent: Support custom cuttable keys configuration#1581
nan-yu wants to merge 4 commits into
a2ui-project:mainfrom
nan-yu:re-arch-8-cuttable-keys

Conversation

@nan-yu

@nan-yu nan-yu commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

It follows up internal discussion in https://chat.google.com/room/AAQAA_wnJC4/s8Cir-DWpYA/s8Cir-DWpYA?cls=10.

Instead of using a hard-coded set of cuttable keys for auto-healing during stream parsing process, it allows configuring a set of custom configuration keys.

Summary of Changes

This pull request enables configurable cuttable keys for the A2UI streaming parser, moving away from a hard-coded set. This change allows users to define custom keys that can be safely auto-healed during stream processing, improving robustness for varied data structures. The implementation spans the core catalog configuration, SDK logic in both Kotlin and Python, and updated conformance tests to ensure consistent behavior.

Highlights

  • Custom Cuttable Keys Configuration: Introduced support for configuring custom cuttable keys in the A2UI catalog, allowing for more flexible auto-healing during stream parsing.
  • Schema and SDK Updates: Updated the conformance schema and both Kotlin and Python SDKs to support the new custom_cuttable_keys configuration property.
  • Conformance Testing: Added new conformance test cases to verify that custom cuttable keys are correctly preserved and respected by the streaming parser.
Activity
  • Initial pull request created by nan-yu.
  • Automated review feedback provided suggestions for improving default value handling for cuttable keys and simplifying constructor calls.
  • The author has addressed the feedback to ensure consistent behavior when no catalog is provided.

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

Copy link
Copy Markdown
Contributor

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 introduces support for custom cuttable keys in both the Kotlin and Python SDKs, allowing users to configure which keys can be safely auto-closed when fragmented in a stream. The changes include updates to the conformance schema, suites, catalog configurations, and streaming parsers. The review feedback highlights critical regressions in both Kotlin and Python where the parser defaults to an empty set of cuttable keys instead of the default set when no catalog is provided. Additionally, several improvements are suggested to simplify redundant conditional logic when instantiating catalogs and configurations.

Comment thread agent_sdks/python/a2ui_agent/src/a2ui/parser/streaming.py
Comment thread agent_sdks/kotlin/src/test/kotlin/com/google/a2ui/conformance/ConformanceTest.kt Outdated
Comment thread agent_sdks/python/a2ui_agent/src/a2ui/schema/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_agent/tests/conformance/test_conformance.py Outdated
@nan-yu

nan-yu commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini summary

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request enables configurable cuttable keys for the A2UI streaming parser, moving away from a hard-coded set. This change allows users to define custom keys that can be safely auto-healed during stream processing, improving robustness for varied data structures. The implementation spans the core catalog configuration, SDK logic in both Kotlin and Python, and updated conformance tests to ensure consistent behavior.

Highlights

  • Custom Cuttable Keys Configuration: Introduced support for configuring custom cuttable keys in the A2UI catalog, allowing for more flexible auto-healing during stream parsing.
  • Schema and SDK Updates: Updated the conformance schema and both Kotlin and Python SDKs to support the new custom_cuttable_keys configuration property.
  • Conformance Testing: Added new conformance test cases to verify that custom cuttable keys are correctly preserved and respected by the streaming parser.
Activity
  • Initial pull request created by nan-yu.
  • Automated review feedback provided suggestions for improving default value handling for cuttable keys and simplifying constructor calls.
  • The author has addressed the feedback to ensure consistent behavior when no catalog is provided.

@nan-yu nan-yu force-pushed the re-arch-8-cuttable-keys branch from 6c36fb9 to 76c322f Compare June 9, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant