TanStack AI version#
main and t3/prepare-v1-release (1.0.0). @tanstack/ai-openai.
Framework/Library version#
Any. Server side.
Describe the bug and the steps to reproduce it#
openaiText sends temperature and top_p to gpt-6.x reasoning models. OpenAI rejects them with 400 Unsupported parameter.
openAIModelRejectsSamplingParams (packages/ai-openai/src/model-meta.ts, about line 2952) matches only /^o\d/, ids that start with gpt-5 (not -chat-latest), and codex-mini-latest. It does not match gpt-6.1-sol and the other gpt-6.x reasoning models in model-meta.ts. The same predicate decides whether the adapter asks for reasoning.encrypted_content (adapters/text.ts, about line 230), so gpt-6.x tool loops also lose encrypted reasoning replay.
Steps:
- Call
chat({ adapter: openaiText('gpt-6.1-sol'), threadId: 't1', messages, modelOptions: { temperature: 0.7 } }).
- OpenAI returns
400 Unsupported parameter: 'temperature'.
Expected: the adapter drops the sampling params for every reasoning model. A fix that uses the model's reasoning metadata in model-meta.ts, not the name prefix, also covers future families.
Found in the full review of #1840. docs/adapters/openai.md now lists the models the code matches today.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
See the steps above.
Do you intend to try to help solve this bug with your own PR?#
Yes, I am also opening a PR that solves the problem this issue identifies.