fix: stop sending temperature to Anthropic models that reject it#19
Merged
Conversation
Anthropic's newest thinking models (Opus 4.8, 4.7) deprecated the
`temperature` param and return a 400 ("`temperature` is deprecated for
this model"). The provider sent it unconditionally, breaking any consensus
run that used those models. Older models (Opus 4.6, Sonnet, Haiku) still
accept temperature.
Mirrors the existing OpenAI NO_TEMPERATURE_MODELS approach: a new
ANTHROPIC_NO_TEMPERATURE_MODELS set (verified empirically against the live
API) gates the param in both send() and stream().
Also extends scripts/refresh_catalog.py to probe Anthropic temperature
support (it only probed OpenAI before — which is why this slipped when
Opus 4.8/4.7 were added), so the set stays maintained.
Fixes a test-isolation issue in the Cloudflare config tests exposed once
CLOUDFLARE_* vars are present in .env (load_dotenv repopulates deleted
vars; use empty strings instead).
Verified live: Opus 4.8 send/stream now succeed. 1675 tests pass,
mypy + ruff clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EkrekgzMAQko92UkjnXhHL
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.
The bug
Consensus runs using Opus 4.8 / 4.7 400'd with:
Anthropic's newest thinking models deprecated
temperature;AnthropicProvidersent it unconditionally. (Older models — Opus 4.6, Sonnet, Haiku — still accept it.)Root cause
When Opus 4.8/4.7 were added to the catalog, I probed OpenAI temperature support but not Anthropic — even though the truefoundry data showed
removeParams: temperaturefor them. So it slipped through.Fix
ANTHROPIC_NO_TEMPERATURE_MODELSset (verified empirically against the live API) gatestemperaturein bothsend()andstream()— mirrors the existing OpenAINO_TEMPERATURE_MODELSpattern.scripts/refresh_catalog.pynow also probes Anthropic temperature, so the set stays maintained and this can't recur silently.CLOUDFLARE_*are in.env,load_dotenvrepopulates deleted vars — use empty strings instead).Empirical results (live API)
Validation
AnthropicProvider.sendto Opus 4.8 now succeeds (both send + stream paths covered by tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01EkrekgzMAQko92UkjnXhHL