Repository navigation
Generate Agent request shapes from the pinned schema - #523
Merged
Merged
Conversation
This was referenced Oct 7, 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.
Summary
AGENTS.md says each rule has one authored definition, and that the
/v1schema is the pinned official one. Core used to validate Agent request bodies against a 70-line hand-written shape table. Its enums were also re-checked in the resolvers, and the generated Go tags held a third copy. This change makes the pinned schema the only source. This is T2b in the architecture audit.scripts/generate-public-api.pynow generatesservices/core/internal/api/official_shapes.gen.go. That file holds the request shape trees ofCreateAgentParams,UpdateAgentParamsandSessionAgentConfigParam, taken fromcontracts/agents-api/upstream/openapi.json. It is part ofmake openapiand--check, so a pin bump regenerates it and CI catches drift. The generator refuses forms it can't project, such as an open object or a non-typediscriminator.metadataandheaders. Core-extension shapes (x_agents_core, harness model providers) stay hand-written and reuse it./v1boundary. Resolvers keep only execution limits:tool_searchdeclaration,service_tier=autoonly, the nonempty model, the function count and name limits, and the URL and size limits.programmatic_tool_callingre-checks are deleted.agent_idpath does not re-check their shape. A decode failure there isstoredDataError: logged, and returned as 500internal_errorwithout internals.Behaviour
No input accepted before is rejected now. The blind review checked about 80 bodies against the baseline. The only widening is Session
transport.authorization: null, which the pinned schema allows. Malformed input now gets the official field errors:cwdtransport: {"type":"ws"}"metadata":5invalid_request, updateunsupported_or_invalid_configurationinvalid_request_error, parammetadatanameanddescriptiontools[0].descriptiontools[0].name(schema order)The docs are updated to match:
wire-semantics.md,execution-tools.md, and the coverage ledger inindex.md(MCP is http only, and inlineauthorizationis rejected), each with its zh mirror.official_mcp.pyasserts the new errors.Review
A fresh-context blind review found no must-fix. Its verdict was "merge after fixes".
openapi.jsonby hand.index.md, and mapstoredDataErroron the Agent routes as well.additionalPropertiesguard, test fixtures, a function-order test, and the ledger line.All of these are fixed.
Checks
go build ./..., vet and gofmt.make openapi(no diff),make check-openapiand the generator tests (12).internal/apiand its importers against the DB: 3009 passed.tests/integrationpackage with the pinned SDK: 390 passed.official_schema_test.pyandofficial_client.py.make check-docs, the translation test andcheck-names.Net: hand-written non-test −113, generated +210, tests +33.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.