Skip to content

Validate Session, Vault, Credential and Template request shapes - #862

Merged
SaladDay merged 3 commits into
mainfrom
fix/validate-request-shapes
Oct 25, 2026
Merged

SaladDay merged 3 commits into
mainfrom
fix/validate-request-shapes

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Official API alignment (ST-07/08/09, VT-01, VT-02/03, VT-04, EC-02 + SES-20).

The pinned-shape walker that already checks Agent bodies now also checks Session create and update, Vault create, Credential create and rotate, Environment Template create and update, and Session events. Field errors carry the JSON path as param with the official message forms (Unknown parameter: 'x'., Missing required parameter: 'x'., Invalid type for 'x': …, Invalid value: …), for example metadata, env.KEY, auth.type, auth.access_token, input[0].role and events[0].input[0].role. Core-local rules that the schema leaves open (HTTPS mcp_server_url, nonempty tokens, name limits, env names) keep Core's message but now name their field. Decoder branches and messages that became unreachable are deleted.

  • scripts/generate-public-api.py projects the eight schemas (members with their own parser, such as Session agent/environment and Template network, are checked as objects only) and a string-or-array union; official_shapes.gen.go regenerated.
  • Docs: wire-semantics.md, vaults.md, sessions-events.md (+ zh).

Checks: go test ./internal/api ./internal/environmentconfig ./internal/environmenttemplates, make check-openapi, integration tests for credentials, MCP credentials, request bodies, input and templates against a test database, go vet ./..., gofmt.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay force-pushed the fix/validate-request-shapes branch from 17298c7 to 52c4f5a Compare October 25, 2026 02:46
@SaladDay
SaladDay merged commit 7d267d7 into main Oct 25, 2026
1 check passed
@SaladDay
SaladDay deleted the fix/validate-request-shapes branch October 25, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant