Skip to content

fix(schema): reject string payloads for v1 boolean config setters - #2981

Merged
benbrandt merged 2 commits into
agentclientprotocol:mainfrom
ChaceLyee2101:fix/v1-boolean-config-schema
Nov 23, 2026
Merged

benbrandt merged 2 commits into
agentclientprotocol:mainfrom
ChaceLyee2101:fix/v1-boolean-config-schema

Conversation

@ChaceLyee2101

Copy link
Copy Markdown
Contributor

The completed Boolean Config Option Type RFD and the config options guide require a boolean value for type: "boolean". However, both published v1 schemas accept this setter payload:

{ "sessionId": "s", "configId": "fast", "type": "boolean", "value": "false" }

The boolean branch rejects the string, but the untagged ID branch accepts it. Both v2 schemas already reject it. This also affects initial config values in the unstable v1 schema.

Exclude the known boolean discriminator from the v1 ID fallback in JSON Schema. Untyped string IDs, explicit ID values, and unknown string value types retain their existing schema behavior. Rust serialization and lenient deserialization stay unchanged, including the existing test that reads a malformed boolean as an ID. The protocol requirement itself does not change. Regenerate the two v1 JSON Schemas. The guides already state the required value shape, and their generated reference pages and all v2 artifacts are unchanged.

Related implementation: #576, stabilized in #1604.

Regression and validation:

  • Run the same node --test scripts/schema-tests/config-values.test.mjs against the upstream schemas: 3 failures and 7 passes. After regeneration: all 10 pass.
  • The tests cover stable and unstable publications for both versions, valid booleans and string IDs, unknown string value types, invalid boolean payloads, and initial config values.
  • npm run generate and npm run check pass. The latter includes Clippy, formatting, spelling, all-feature Rust tests, and all 39 schema/protocol-example tests.
  • Generator tests pass with default features, unstable, and unstable_protocol_v2. Schema crate tests also pass with unstable_protocol_v2 without the unstable umbrella.

Validation scope: v1 assertions use the published method params definitions. Its root envelope schema does not dispatch params by method. The v2 assertions also cover full JSON-RPC request validation. No live Agent calls were made.

AI assistance: OpenAI Codex was used to implement and validate this change.

@ChaceLyee2101
ChaceLyee2101 requested a review from a team as a code owner November 22, 2026 05:51
Keep the string-ID fallback for untagged and unknown values, but do not let it reinterpret an explicitly boolean value. Cover the setter, initial session options, and generated v1 schemas in Rust instead of a JavaScript test matrix.
@benbrandt
benbrandt enabled auto-merge (squash) November 23, 2026 11:31

@benbrandt benbrandt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@benbrandt
benbrandt merged commit 9f2340f into agentclientprotocol:main Nov 23, 2026
8 checks passed
@acp-release-bot acp-release-bot Bot mentioned this pull request Nov 22, 2026
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.

2 participants