Repository navigation
fix(llm): retry without temperature when the model rejects it - #702
Merged
Merged
Conversation
Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
4 tasks
ajianaz
added a commit
that referenced
this pull request
Oct 27, 2026
## What - A 400 response that names `temperature` is retried once without that key, and the model is remembered for the rest of the process (no repeated failing request, and no extra cost on later chunks). Streaming and non-streaming share the same path. - Any other 400 (and every other status) is returned unchanged; providers that accept `temperature` keep the configured value (default `0.0`, deterministic). ## Why `claude-opus-5-5` answers HTTP 400 "`temperature` is deprecated for this model", so every review through the Anthropic workload identity federation path (#700) ended as "Review could not complete" while the check still turned green. Closes #701. ## Testing - Unit tests: request body without a `temperature` key, recognising the 400, per-model memory. - Two end-to-end tests against a local fake server: the first request carries `temperature`, the retry does not and succeeds; a different 400 is not retried (one request only). - fmt, clippy -D warnings and the full suite pass. Signed-off-by: ajianaz <ajianaz@users.noreply.github.com> Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
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
temperatureis retried once without that key, and the model is remembered for the rest of the process (no repeated failing request, and no extra cost on later chunks). Streaming and non-streaming share the same path.temperaturekeep the configured value (default0.0, deterministic).Why
claude-opus-5-5answers HTTP 400 "temperatureis deprecated for this model", so every review through the Anthropic workload identity federation path (#700) ended as "Review could not complete" while the check still turned green. Closes #701.Testing
temperaturekey, recognising the 400, per-model memory.temperature, the retry does not and succeeds; a different 400 is not retried (one request only).