Skip to content

fix(llm): retry without temperature when the model rejects it - #702

Merged
ajianaz merged 1 commit into
developfrom
fix/701-optional-temperature
Oct 27, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/701-optional-temperature

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

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>
@ajianaz
ajianaz merged commit 075de6a into develop Oct 27, 2026
13 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(llm): temperature is always sent and rejected by claude-opus-5-5 (breaks the #700 federation path)

1 participant