Give recursive tool output schemas an object root (#3337) - #3340
Give recursive tool output schemas an object root (#3337)#3340AuraVox-ro wants to merge 1 commit into
Conversation
…ol#3337) Pydantic emits $ref-only roots for self-referential models, which fails 2025-11-25 tools/list validation. Inline the object definition at the root so legacy clients can list tools. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the contribution. This repository only keeps pull requests open when they're linked to an issue that a maintainer has assigned to the author — CONTRIBUTING.md explains why and how we work. This PR has been closed for now because you aren't currently assigned to #3337. If a maintainer would like this change as a PR from you, they'll assign you to #3337 and this PR will reopen automatically — there's nothing more you need to do. (If you opened the issue, this PR already shows up on its timeline.) There's no need to open a new PR — this one will be reopened. While it's closed, please push any updates as new commits rather than force-pushing, since GitHub can't reopen a PR whose branch has been rewritten. Maintainers: reopening this PR, removing the |
Fixes #3337
Recursive BaseModel tool return types made Pydantic emit a $ref-only root with no type: object. That serializes on 2026-07-28, but 2025-11-25 Tool.outputSchema requires an object root, so a legacy tools/list failed validation for the entire listing.
This inlines the referenced object definition at the root and keeps $defs so nested self-references still resolve.
Motivation and Context
See #3337. One recursive tool schema should not fail the entire tools/list for 2025-11-25 sessions.
How Has This Been Tested?
Breaking Changes
None. Recursive output schemas gain a root type: object; nested $refs are unchanged.
Types of changes
Checklist
Additional context
AI-assisted. I own the change and can answer review questions.