fix(openai): omit temperature for o1/o1-mini/o1-preview reasoning models#230
fix(openai): omit temperature for o1/o1-mini/o1-preview reasoning models#230zjshen14 wants to merge 1 commit into
Conversation
The o1 family of OpenAI reasoning models does not accept a temperature parameter (it is fixed at 1). Passing temperature to these models causes a 400 API error, which surfaces when a user runs: opencli run "..." --model o1-mini --temperature 0.5 o3 and o4 variants do support temperature and are unaffected. Adds a lacksTemperatureSupport() helper and 6 new tests covering: - temperature is passed for gpt-4o and o3-mini - temperature is omitted for o1, o1-mini, and o1-preview - temperature is omitted when not configured at all Part of #43 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Review: fix(openai): omit temperature for o1/o1-mini/o1-preview reasoning modelsWhat's good: Correct fix, correct regex ( One minor style note: several new test cases re-mock I'm not merging this directly because Recommendation: Merge — the change is correct and the tests are thorough. Generated by Claude Code |
Summary
temperatureparameter (it is fixed at 1 server-side). Passing temperature to these models causes a400 Invalid parameterAPI error.lacksTemperatureSupport()helper that matches the o1 family specifically; o3 and o4 variants do support temperature and are unaffected.opencli run "..." --model o1-mini --temperature 0.5.Related issue
Part of #43
Test plan
npm run typecheck && npm run lint && npm run format:check && npm test— all pass (699 tests)o1,o1-mini,o1-previewgpt-4oando3-minideveloperrole on o-series models still passes🤖 Generated with Claude Code
Generated by Claude Code