Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge; no blocking issue was found. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
K["Shared schema-child keywords include contentSchema"]
K --> P["Input presentation"]
K --> R["Reference checks"]
K --> C["Client schema checks"]
P --> W["Widen unsupported literals"]
W --> A["Full and compact advertisements"]
C --> L["Check literals and array items"]
Reviews (9) · Last reviewed commit: "fix(mcp): traverse contentSchema in sche..." · Reviewed by Greptile |
c8d53c5 to
7163aaa
Compare
42a75f8 to
12320cb
Compare
|
@codex review |
9d055f6 to
868addd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 868addd5b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
3eeef37 to
f5851c1
Compare
Fixes morluto#7123 Co-authored-by: mawahnnie <[email protected]>
f5851c1 to
378e2df
Compare
|
Rebased onto current |
|
TL;DR: I ran the two test files on head 378e2df on three Node versions, and all 52 tests passed each time. With Findings
The test files were
Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/contracts/toolInputReferences.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
Fixes #7123 Supersedes #7122 Co-authored-by: mawahnnie <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
Fixes #7123 Supersedes #7122 Co-authored-by: mawahnnie <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
|
Thank you for this fix. It landed in #10519 with your authorship kept on the commit (adapted where noted in the PR), so I'm closing this PR as superseded. |
Summary
Fixes #7123.
Closes three gaps in advertised input-schema literal normalization and catalog-wide client-constraint checks:
src/contracts/jsonSchemaKeywords.ts: addcontentSchematoschemaChildrenso schema-valuedcontentSchemasubschemas are traversed during literal normalization, reference checks, and client-constraint checks.tests/fixtures/mcpClientSchemaConstraints.ts&tests/boundary/mcp/toolSchemaValidity.test.ts: extract a sharedschemaChildEntrieshelper sounsupportedInputLiteralSchemaErrortraverses array-valuedschemaChildren(such as draft-07 tupleitems) just likearrayItemSchemaError, and reuse the sharedjsonSchemaKeywordssets inlocalInputReferences.src/contracts/inputSchemaPresentation.ts: preserve every primitive member type vialiteralSchemaTypewhen widening a mixedenumcontaining""(presentinganyOfof the primitive member types rather than an untyped schema).Problem and expected behavior
Trigger:
presentInputJsonSchemaon{ type: "string", contentSchema: { const: "" } }leftconst: ""un-widened becausecontentSchemawas absent fromschemaChildren.unsupportedInputLiteralSchemaErroron{ type: "array", items: [{ type: "string" }, { const: "" }] }returnedundefinedbecause array-valuedschemaChildrenwere only traversed inarrayItemSchemaError.presentInputJsonSchemaon{ enum: ["", 1] }droppedenumwithout retaininganyOf: [{ type: "string" }, { type: "integer" }].Expected: all three positions are normalized and checked consistently across full and compact profiles.
Change and scope
src/contracts/jsonSchemaKeywords.ts: add"contentSchema"toschemaChildren.src/contracts/inputSchemaPresentation.ts: addliteralSchemaTypeso mixed primitive enums containing""widen toanyOfof their member types.tests/fixtures/mcpClientSchemaConstraints.ts: shareschemaChildEntriesbetweenarrayItemSchemaErrorandunsupportedInputLiteralSchemaError.tests/boundary/mcp/toolSchemaValidity.test.ts: import the shared keyword sets inlocalInputReferencesand cover tupleitemsinunsupportedInputLiteralSchemaError.src/contracts/toolInputReferences.test.ts: add regression tests for mixed-enum widening,contentSchemawidening, and the recordedapplicationFeatureSeedSchematrace seed.Follow the contribution scope. Not applicable (ordinary MCP schema projection and test-guard fix within existing boundaries).
Contract and boundary impact
src/contracts/jsonSchemaKeywords.tsandsrc/contracts/inputSchemaPresentation.ts.docs/public/product-catalog.json), package, or installation impact: none.Expected effects:
Evidence and regression coverage
src/contracts/toolInputReferences.test.tsandtests/boundary/mcp/toolSchemaValidity.test.ts.enum: ["", 1]widens toanyOf: [{ type: "string" }, { type: "integer" }],contentSchema: { const: "" }widens to{ type: "string" }, andunsupportedInputLiteralSchemaErrorcatches tupleitems[1].Validation performed
npx vitest run src/contracts/toolInputReferences.test.ts— 37 passednpx vitest run tests/boundary/mcp/compactInputSchemaMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts— 28 passednpm run check:fast(tsc --noEmit,oxlint,verify:module-boundaries) &npm run format:check— clean (0 errors)Compatibility, safety, and release
Author readiness
Human owner: @carcraze
Before merge
type(scope): outcome.