Skip to content

Tool schema projection silently converts non-finite numbers to null #104469

Description

@VectorPeak

Problem

projectRuntimeToolInputSchema() currently serializes runtime tool schemas through JSON.stringify() before validating the projected JSON value. JavaScript non-finite numbers are not JSON values, but JSON.stringify() silently converts them to null.

A schema such as:

projectRuntimeToolInputSchema({
  type: object,
  properties: {
    amount: { type: number, maximum: Number.POSITIVE_INFINITY },
    score: { type: number, default: Number.NaN },
  },
});

can therefore be projected as if the schema explicitly contained null limits/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:current-main-reproClawSweeper found a high-confidence current-main issue reproduction.clawsweeper:linked-pr-openClawSweeper 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.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦀 challenger crabExceptional issue quality: high-confidence current-main reproduction and actionable evidence.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions