-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Tool schema projection silently converts non-finite numbers to null #104469
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:current-main-reproClawSweeper found a high-confidence current-main issue reproduction.ClawSweeper found a high-confidence current-main issue reproduction.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦀 challenger crabExceptional issue quality: high-confidence current-main reproduction and actionable evidence.Exceptional issue quality: high-confidence current-main reproduction and actionable evidence.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:current-main-reproClawSweeper found a high-confidence current-main issue reproduction.ClawSweeper found a high-confidence current-main issue reproduction.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦀 challenger crabExceptional issue quality: high-confidence current-main reproduction and actionable evidence.Exceptional issue quality: high-confidence current-main reproduction and actionable evidence.
Type
Fields
Priority
None yet
Problem
projectRuntimeToolInputSchema()currently serializes runtime tool schemas throughJSON.stringify()before validating the projected JSON value. JavaScript non-finite numbers are not JSON values, butJSON.stringify()silently converts them tonull.A schema such as:
can therefore be projected as if the schema explicitly contained
nulllimits/defaults, while reporting no violation.Expected behavior
Non-finite numeric schema values should be treated as non-JSON-serializable and should produce a schema projection violation instead of being silently changed to
null.Impact
The shared projection path feeds OpenAI and Anthropic tool schema construction. A bad tool schema should be quarantined with a clear diagnostic while healthy sibling tools remain available.