feat: implement client data model synchronization#866
Open
jacobsimionato wants to merge 4 commits intogoogle:mainfrom
Open
feat: implement client data model synchronization#866jacobsimionato 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 successfully implements the client data model synchronization feature as per the A2UI v0.9 specification. The changes are comprehensive, covering schema definitions, state management, message processing, and documentation updates. The new tests provide good coverage for the added functionality.
My review includes two main points of feedback:
- A high-severity suggestion to improve type safety in
dispatchActionby validating the action payload before it's emitted. This will prevent potential runtime errors and ensure data integrity. - A medium-severity suggestion to refactor the
getClientDataModelmethod for better readability and simplicity.
Overall, this is a solid implementation that aligns the renderer with the new protocol requirements.
gspencergoog
approved these changes
Mar 16, 2026
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
This PR implements the Client Data Model Synchronization feature according to the A2UI v0.9 specification.
Key additions and modifications:
client-to-server.tsto define Zod schemas forA2uiClientAction,A2uiClientError, andA2uiClientDataModel.SurfaceModelto accept thesendDataModelflag. ModifieddispatchActionto construct a fully validatedA2uiClientActionpayload incorporating thesourceComponentIdand an ISO 8601 timestamp.MessageProcessorto extractsendDataModelupon surface creation and implementedgetClientDataModel()to aggregate data models for eligible surfaces.ComponentContextso it properly passes its ID into dispatched actions.renderer_guide.md.Rationale
To align the web core renderer with the A2UI v0.9 protocol requirements for client-to-server communication. Specifically, this ensures that the client can bundle its data model inside transport metadata whenever an action is triggered, and standardizes the structure of the action events dispatched back to the agent backend.
Testing/Running Instructions
renderers/web_core.npm installto ensure all dependencies are up to date.npm run build:tscthennode --test "dist/**/*.test.js"to run the test suite and confirm that all tests pass.Fixes #864