Repository navigation
fix: reject capability input schemas that exclude objects - #2
Merged
Merged
Conversation
Balanov
approved these changes
Nov 15, 2026
Balanov
left a comment
Owner
There was a problem hiding this comment.
Thank you for this, and for replacing the string match on an error message with a check of the declared type. The old check could not fire: it looked for "must be object" in the error produced by validating {}, and that error only appears for a type that already matches {}. Reading the declared type is the fix, and your error names the capability id and the type, so a provider can correct the card without guessing.
The union case is handled the way the spec needs it: a type array that contains object stays valid, an omitted type stays valid, and SPEC.md now says the same thing the code does.
Merging this. It ships in the next release.
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.
Card validation now checks the declared input schema type directly. Non-object types produce invalid_card with the capability ID and declared type. An omitted type and unions containing object remain accepted.
Fixes #1.
Validation on Linux/Node 24: all 33 tests passed. The three rejection regressions failed before the change. node --check, the six-step local demo, and npm run bench completed. The benchmark measurements were retained as local validation artifacts.
OpenAI Codex assisted with implementation, review, and validation.