TanStack AI version
0.24.0
Framework/Library version
@tanstack/ai-openrouter 0.11.0
Describe the bug and the steps to reproduce it
- User provides a Standard Schema where a field is optional.
- TanStack converts it to JSON Schema.
- OpenRouter adapter rewrites optional fields into required + nullable for strict OpenAI/OpenRouter compatibility.
- Model returns null for that field, which the provider schema allowed.
- TanStack validates the result against the original Standard Schema, which rejects null.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com/edit/dkxh99pz?file=package.json
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms & Code of Conduct
TanStack AI version
0.24.0
Framework/Library version
@tanstack/ai-openrouter 0.11.0
Describe the bug and the steps to reproduce it
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com/edit/dkxh99pz?file=package.json
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms & Code of Conduct