Skip to content

Implement sendDataModel Synchronization #844

@jacobsimionato

Description

@jacobsimionato

Proposal: Implement sendDataModel Synchronization

Reason

The createSurface message includes a sendDataModel flag. When true, the client is obligated to send the full state of the surface's data model back to the server with every user action. This ensures the agent has the latest context (e.g., form inputs) without requiring a server-side state mirror.

Design

  1. State Tracking: Update SurfaceModel to store the sendDataModel boolean from the createSurface message.
  2. Action Enrichment: Modify ComponentContext.dispatchAction to check this flag.
  3. Metadata Payload: If enabled, the dispatcher should call surface.dataModel.get('/') and attach the result to the outgoing action object under a standard key (e.g., a2uiClientDataModel).
  4. Transport Integration: Ensure the MessageProcessor action handler propagates this metadata to the underlying transport (A2A, AG-UI, etc.).

Key Files

  • renderers/web_core/src/v0_9/state/surface-model.ts
  • renderers/web_core/src/v0_9/rendering/component-context.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions