chore(schema): bump ACP schema to 1.20.0 - #53
Open
lx-wnk wants to merge 3 commits into
Open
Conversation
The protocol repository publishes its schema artifacts under `schema-vX.Y.Z` tags. The Makefile still requested them from `vX.Y.Z`, so every schema target resolved to a 404 and the generator could not be pointed at any release cut under the new scheme. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A definition carrying both `properties` and `anyOf` is emitted as a union wrapper, so the property-based validator referenced fields the wrapper does not have. Suppressing that validator alone is not enough: the request and response dispatchers call Validate unconditionally after unmarshalling, so a union without one fails to compile. Emit the generic union validator for anyOf as well, requiring at least one variant rather than exactly one, which matches anyOf semantics. Types that previously received a property validator over fields the wrapper had dropped had an empty `return nil` body, so this replaces a validator that checked nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Regenerated against the current schema release. Three call sites needed adjusting: - `TerminalId` is now a named type, so `ToolTerminalRef` converts explicitly. - `session/delete` graduated from the experimental surface, so `UnstableDeleteSession*` became `DeleteSession*` and the method moved from `AgentExperimental` to `Agent`. Examples and test doubles implement it. - `README.md` and `version` follow `schema/version`, matching what `make version` produces. Adds tests for the union validators, which had no coverage. A pre-existing generator gap becomes more visible with this schema: a definition carrying both `properties` and `anyOf` is emitted as a union wrapper only, so its sibling scalar properties are dropped. This is not new here. At 0.13.5 the unstable `SetSessionConfigOptionRequest` already declares `sessionId` and `configId` as required, and neither appears on the generated struct. Emitting hybrid definitions faithfully needs work in emitUnion and is left for a follow-up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 14, 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.
Depends on #52 — the first commit here is that PR, so this diff shrinks once it merges.
Regenerating against
schema-v1.20.0needs one generator fix first, then the bump itself.fix(generate): emit Validate for anyOf unions
A definition carrying both
propertiesandanyOfis emitted as a union wrapper, so the property-based validator referenced fields the wrapper does not have. Suppressing that validator alone is not enough: the request and response dispatchers callValidateunconditionally after unmarshalling, so a union without one fails to compile.The generic union validator is now emitted for
anyOfas well, requiring at least one variant rather than exactly one.Behaviour this changes, measured against the current schema (0.13.5) with only the generator patch applied, so the effect is attributable:
Validatethey did not have (AgentResponse,AuthMethod,AvailableCommandInput,ClientResponse,EmbeddedResourceResource,ErrorCode,McpServer,RequestId,SessionConfigSelectOptions,UnstableElicitationFormMode,UnstableElicitationUrlMode,UnstableMcpServer).SetSessionConfigOptionRequest.Validatechanges fromreturn nilto the variant check. Its previous body was empty because the properties it would have validated are not on the wrapper.A zero value now fails validation where it previously passed. A payload off the wire is unaffected:
UnmarshalJSON([]byte("{}"))lands in a variant, so unmarshalled requests always validate. There is a test for that.chore(schema): bump to 1.20.0
Three call sites needed adjusting:
TerminalIdis now a named type, soToolTerminalRefconverts explicitly.session/deletegraduated from the experimental surface, soUnstableDeleteSession*becameDeleteSession*and the method moved fromAgentExperimentaltoAgent. Examples and test doubles implement it.README.mdandversionfollowschema/version, matching whatmake versionproduces.Adds
union_validate_test.go, which covers the union validators — they had no tests.Pre-existing gap, not addressed here
A definition carrying both
propertiesandanyOfis emitted as a union wrapper only, so its sibling scalar properties are dropped. This is not introduced by the bump. At 0.13.5 the unstableSetSessionConfigOptionRequestalready declaressessionIdandconfigIdas required and neither appears on the generated struct, which is why its validator was empty. Emitting hybrid definitions faithfully needs work inemitUnion; happy to open a separate issue or PR if you want it fixed.Verification
make testpasses;go test -racepasses.treefmtreports no changes andgit diff --exit-codeis clean.mdshwas run separately because the version available here has an incompatible CLI;README.mdis a fixpoint under it.actionlintandzizmorreport nothing.GOOS=linux go build ./...passes.