Skip to content

fix(tools): accept null for optional tool parameters - #15

Merged
casparbreloh merged 1 commit into
mainfrom
fix/nullable-thinking-params
Apr 14, 2026
Merged

casparbreloh merged 1 commit into
mainfrom
fix/nullable-thinking-params

Conversation

@casparbreloh

Copy link
Copy Markdown
Owner
  • Providers like OpenRouter/Anthropic send null instead of omitting keys for optional tool parameters
  • The structured output handler converts optionalKey to required T | null in the JSON schema, but the Toolkit decodes with the raw schema that rejects null
  • Wraps all optional fields with Schema.NullOr across WebSearch, CrawlPages, and SequentialThinking
  • Updates shouldReset to use == null to handle both null and undefined

- Providers like OpenRouter/Anthropic send null instead of omitting keys for optional tool parameters
- The structured output handler converts optionalKey to required T|null in the JSON schema, but the Toolkit decodes with the raw schema that rejects null
- Wrap all optional fields with Schema.NullOr across all three tools
- Update shouldReset to use == null (catches both null and undefined)
@casparbreloh
casparbreloh merged commit eab6817 into main Apr 14, 2026
1 check passed
@casparbreloh
casparbreloh deleted the fix/nullable-thinking-params branch April 14, 2026 11:39
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.

1 participant