Skip to content

fix: preserve root dynamic references in output schemas - #648

Closed
jihtsan wants to merge 1 commit into
modelcontextprotocol:mainfrom
jihtsan:codex/647-preserve-dynamic-output-root
Closed

jihtsan wants to merge 1 commit into
modelcontextprotocol:mainfrom
jihtsan:codex/647-preserve-dynamic-output-root

Conversation

@jihtsan

@jihtsan jihtsan commented Nov 1, 2026

Copy link
Copy Markdown

Summary

Fixes #647, a residual root-defaulting case after #377/#417. Recognize $dynamicRef as an explicit output-schema root, so the SDK preserves valid array/primitive schemas instead of adding an incompatible object type. Update the existing docs keyword list.

Add symbol/string-key and array/string/number/boolean/null target regressions, explicit conflicting-type controls, and a real public Server tools/call regression. Existing input-object defaults, properties-only shorthand, same-document reference restrictions and resource bounds remain covered.

Validation

  • Original output-schema regression:36 tests,10 failures; public Server regression:1 test,1 failure. A first name filter matched0 tests and was corrected; it is not counted as validation.
  • Final focused tests:36 tests/83 assertions and1 Server test/3 assertions passed.
  • Full bundle exec rake:RuboCop200 files clean;2,493 tests/8,204 assertions passed; conformance server73 passed,0 failed; conformance client480 passed plus9 checked-in expected authentication failures. Both conformance baseline checks passed, and rake exited0. The client result is not described as zero failures.
  • Conformance CLI0.2.0-alpha.12; gem build and git diff --check passed.
  • Independent Standards and Spec reviews:0 findings on the submitted SHA.

Ruby4.0.9/macOS arm64, JSONSchemer2.5.0, generated untracked validation lock with subsequent frozen commands. Other Ruby/OS matrices, unrelated external clients/providers and a deployed release were not verified. No model/provider requests, credentials or GPU were required. No release changelog/generated files/dependencies changed.

Checklist

  • Tests added and local checks recorded
  • Related issue linked and documentation updated
  • Hosted CI and maintainer review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T13:13:50.836006Z f0b77d9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@koic

koic commented Nov 1, 2026

Copy link
Copy Markdown
Member

Closing in favor of #649, which adds $dynamicRef to ROOT_SCHEMA_KEYWORDS as well and takes both reference keywords from Tool::Schema::REFERENCE_KEYWORDS, so the list that switches the object default off cannot drift from the same-document reference check again. It also corrects the tools page where the same-document rule named $ref only, while the code has always applied it to $dynamicRef too.

#649 also adds regression tests for the invariant that every reference keyword is a root keyword, and for the tools/list entry being advertised without type: "object" alongside the validated tools/call.

Thank you for the report and the reproduction in #647, which pinned the missing keyword against the $ref control.

@koic koic closed this Nov 1, 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.

Root $dynamicRef output schemas receive an incompatible default object type

2 participants