Skip to content

Drop temperature for Anthropic models that deprecate it - #286

Merged
grohith327 merged 1 commit into
altic-dev:mainfrom
domdomegg:fix/anthropic-temperature-deprecated
Apr 17, 2026
Merged

grohith327 merged 1 commit into
altic-dev:mainfrom
domdomegg:fix/anthropic-temperature-deprecated

Conversation

@domdomegg

Copy link
Copy Markdown
Contributor

Summary

  • Claude Opus 4.7 rejects the temperature parameter (it uses extended thinking by default), so every request sent to it via the Anthropic provider fails with HTTP 400: temperature is deprecated for this model.
  • Adds SettingsStore.isTemperatureUnsupported(_:) covering reasoning models (o1/o3/gpt-5/...) plus Claude Opus 4.7+, and uses it at the three live call sites that build an LLMClient.Config (ContentView, CommandModeService, RewriteModeService).
  • isReasoningModel still gates max_completion_tokens and the reasoning token budget — those are OpenAI-specific and shouldn't fire for Anthropic models.

Fixes #285.

Test plan

  • Select the Anthropic provider with model claude-opus-4-7 and confirm transcription cleanup, Command Mode, and Rewrite Mode no longer return the HTTP 400 temperature error.
  • Regression-check an OpenAI reasoning model (e.g. gpt-5) still sends no temperature.
  • Regression-check a non-reasoning model (e.g. gpt-4.1, claude-sonnet-4-20250514) still sends temperature: 0.2 / 0.1 / 0.7.

🤖 Generated with Claude Code

Claude Opus 4.7 uses extended thinking by default and rejects the
`temperature` parameter. Sending it causes every request to fail with
HTTP 400: `temperature is deprecated for this model`.

Add `SettingsStore.isTemperatureUnsupported(_:)` that covers both
reasoning models (o1/o3/gpt-5/...) and Claude Opus 4.7+, and use it at
each live call site (ContentView, CommandModeService, RewriteModeService)
to gate the temperature parameter.

`isReasoningModel` still gates `max_completion_tokens` / reasoning token
budgets, which remain OpenAI-specific.

Fixes altic-dev#285

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b66fca6f0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@grohith327 grohith327 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grohith327
grohith327 merged commit 6631dc0 into altic-dev:main Apr 17, 2026
1 check passed
grohith327 pushed a commit that referenced this pull request Jul 7, 2026
Anthropic rejects the `temperature` parameter on adaptive-thinking
models with HTTP 400 "temperature is deprecated for this model".
isTemperatureUnsupported() only matched claude-opus-4-7 (from #286),
so Sonnet 4.6, Sonnet 5, Opus 4.8, and Fable/Mythos 5 all failed in
AI Enhancement, Command Mode, and Rewrite Mode.

Extend the check to the other affected models and add regression
tests covering unsupported models, OpenAI reasoning models, and
models that must keep receiving temperature.

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

[🐞 BUG] Opus 4.7 fails with Anthropic provider — temperature is deprecated for this model

2 participants