Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the A2UI protocol specification, blueprint, and conformance tests to ensure that a callRendererFunction message missing a catalogId is rejected as a schema validation error rather than being handled as an invalid function call. In the Swift conformance tests, AgentToRendererMessage.parseAll is now used to enforce these schema checks. The review feedback suggests improving the Swift test assertions by safely unwrapping the expected error and guarding the inbound call execution to prevent redundant or misleading assertions if validation unexpectedly succeeds.
8 tasks
polina-c
requested review from
gspencergoog
and removed request for
jacobsimionato
October 27, 2026 16:34
gspencergoog
approved these changes
Oct 27, 2026
polina-c
enabled auto-merge (squash)
October 27, 2026 17:06
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.
Fixes #3596
Fixes #3555
Fixes #3530
Description
The v1.0 spec gave two answers for a
callRendererFunctionwhosecallFunctionhas nocatalogId. The JSON schema requires the field, so the message is malformed. The protocol doc said the renderer answers it withINVALID_FUNCTION_CALL. This PR goes with the schema: a missingcatalogIdis a malformed message, the same as a missingfunctionCallId.INVALID_FUNCTION_CALLwould mean the renderer reports the error back to the agent. But the message does not follow the schema, and an agent can check this before it sends the message. Agents should validate their messages on the server side, so that a renderer never sees one like this.All four cores (web_core, Python, Swift and Dart) already throw
A2uiValidationErrorfor this message, so no core code changes.Changes
a2ui_protocol.md: thecatalogIdproperty no longer says that an omittedcatalogIdgetsINVALID_FUNCTION_CALL. It says the message is malformed and that agents should validate outgoing messages against the schema. AcatalogIdthat names an unregistered catalog still getsINVALID_FUNCTION_CALL.a2ui_core.blueprint.md: theRpcHandlercatalog resolution no longer falls back to the surface'sdefaultCatalogwhen a call names no catalog. None of theRpcHandlerimplementations had this fallback. A new paragraph says that parsing rejects such a message before the handler sees it, and that norendererFunctionResponseis sent.rpc_functions.yaml: new conformance casetest_rpc_call_renderer_function_invalid_payload_missing_catalog_id. It calls a function that a loaded catalog defines, withoutcatalogId, and expects a validation error that mentionscatalogId. Before this, no conformance case covered an omittedcatalogId.RPCConformanceTests.swift: the Swift conformance runner decoded messages with a plainJSONDecoder, which accepts a missingcatalogId. It also did not fail when an expected error never came, so the new case would have passed without being checked. The runner now parses withAgentToRendererMessage.parseAll, which runs the version adapter's checks, the same ones the message processor runs. It fails when a message the case expects to be rejected parses, and when a message the case expects to parse is rejected.Testing
The RPC conformance tests pass in Swift, Python and Dart. To confirm that each runner checks the new case, I temporarily changed its expected message to a string that does not occur, and all three failed.
web_core does not run this conformance suite. Its
message-processor.test.tsalready asserts the throw.Related
With this decision, #3555 (changes web_core to answer with
INVALID_FUNCTION_CALL) and #3530 (tracks the Swift throw as a bug) can be closed.🤖 Agent-generated