Skip to content

fix: omit temperature for Claude models that reject it - #39

Open
ehammond wants to merge 2 commits into
mainfrom
fix-temperature-deprecated
Open

fix: omit temperature for Claude models that reject it#39
ehammond wants to merge 2 commits into
mainfrom
fix-temperature-deprecated

Conversation

@ehammond

Copy link
Copy Markdown
Member

Problem

Running any abc command with the default claude-opus-4-8 model failed:

[abc] [ERROR] An unexpected error occurred: Error code: 400 - {'type': 'error',
'error': {'type': 'invalid_request_error', 'message': '`temperature` is deprecated for this model.'}}

Newer Claude models (Opus 4.7+, Sonnet 5, Fable 5) removed the temperature parameter and return a 400 for any value, including the default 0.0. The Anthropic provider hardcoded temperature=self.temperature into every request, so every call broke.

Fix

  • Make temperature opt-in in the Anthropic provider: only include it in the request when the user explicitly sets one in their config. Omitted otherwise, which works on all current models while still supporting older models for anyone who configures it.
  • Update the stale default model from claude-opus-4-5 to claude-opus-4-8.
  • Bump all version strings to 2026.07.15.

Testing

  • Unit tests updated: temperature defaults to None; added coverage that it's omitted by default and sent when configured.
  • Verified end-to-end against the real API — abc_generate "print hello" now returns a command instead of the 400.

[Created with AI: Claude Code with Opus 4.8]

https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R

ehammond added 2 commits July 15, 2026 20:39
Newer Claude models (Opus 4.7+, Sonnet 5, Fable 5) removed the
temperature parameter and return a 400 for any value, breaking every
request made with the default claude-opus-4-8 model. Make temperature
opt-in: only send it when the user explicitly configures one. Also
update the stale default model to claude-opus-4-8.

[Created with AI: Claude Code with Opus 4.8]

Claude-Session: https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R
[Created with AI: Claude Code with Opus 4.8]

Claude-Session: https://claude.ai/code/session_011AkFCoUHqunn97PjiJKK8R
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.

1 participant