Repository navigation
fix(llm): omit temperature for gpt-6 models - #852
Merged
akitaonrails merged 2 commits intoSep 23, 2026
Merged
Conversation
Codex rejects temperature on gpt-6-* with a 400, so providers and fallbacks configured with gpt-6-luna failed on every call. Closes akitaonrails#851
Give GPT-6 the same reasoning-model handling as gpt-5 on the official openai provider: omit temperature, send max_completion_tokens and skip the local 16,384-token cap. Also drop the duplicate model_uses_default_temperature from copilot and import the identical one from openai_oauth.
felipe-silveira-dev
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The
codex,openai-oauth,copilotandopenaiproviders now leavetemperatureout ofgpt-6-*requests. Codex answers a GPT-6 request that carriestemperaturewith400 Unsupported parameter: temperature. Consolidation, lint and bootstrap all set it, so they failed on a provider or fallback configured withgpt-6-luna,gpt-6-solorgpt-6-astra.openai-oauth,codexandcopilot:model_uses_default_temperaturenow matchesgpt-6as well asgpt-5ando. The function had two identical copies, inopenai_oauth.rsandcopilot.rs;copilot.rsnow imports the one fromopenai_oauth.rs.openai:model_requires_max_completion_tokensnow matchesgpt-6. The same check decides whentemperatureis dropped and whether the local 16,384-token output cap applies, so GPT-6 requests now sendmax_completion_tokens, notemperature, and the caller's token limit unchanged, same asgpt-5.Why
Closes #851.
Test plan
cargo fmt --all -- --checkgit diff --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo test --workspace --all-targets: 3,524 passed, 0 failed, 14 ignored on macOS arm64scripts/check-changelog-sections.shandscripts/check-changelog-frozen.sh upstream/maincargo build --locked --release --bin ai-memoryai-memory llm-test --provider codex --model gpt-6-lunareturnedOK, and the--structuredvariant returned valid JSON. The 2.4.0 release binary still returns the 400 for the same command.Four new unit tests build a request with
temperature: Some(0.2)for a GPT-6 model and check that the field is gone:codex_request_omits_gpt6_temperature,chat_request_omits_gpt6_temperatureandresponses_request_omits_gpt6_temperature(the two Copilot endpoints), andbuild_request_omits_temperature_for_gpt6. The last one asks for 64,000 tokens and checks thatmax_completion_tokenskeeps that value.I couldn't run the
openaiprovider against the live API because my OpenAI account has no active billing. That part is covered only by the unit test.Commit attribution
any unintended identity before requesting merge. See
commit attribution guidance.
Release impact
new agent harness or provider
breaking MCP schema change — called out in "What changed" above
CHANGELOG (merge gate)
CHANGELOG.md[Unreleased]entry.Notes for reviewers
The
openaiprovider keeps its own, narrower check (o1/o3/o4instead of anyoprefix). I left it alone because widening it would change what the official API receives for other models, which is outside this fix.opencodesends only the exact idgpt-5.6-lunato the Responses endpoint. I didn't extend that to GPT-6 because I couldn't confirm which route OpenCode Go uses for it.