Repository navigation
Default ChatOptions.Temperature to 0 so newer Claude models accept the request - #19
Merged
Merged
Conversation
…e request
Anthropic deprecated the temperature field for newer Claude models
(Opus 4.7 returns 400: \"\`temperature\` is deprecated for this model.\"
even with a perfectly valid value). The default of 0.7 in
DefaultChatOptions meant the field was always emitted, even when no
caller had explicitly picked a value.
Both the Anthropic and OpenAI request builders already gate the
field on Options.Temperature > 0, so changing the default to 0
('not set') silently omits the field. Callers who want a specific
temperature still set it via Options or config; providers fall back
to their server-side default otherwise, which is what most users
implicitly assumed they were getting.
https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
5 tasks
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.
Summary
Fixes the runtime error from
pasclaw agent:Anthropic deprecated the
temperaturefield for newer Claude models — Opus 4.7 now returns 400 even with a perfectly valid value. The default of0.7inDefaultChatOptionsmeant the field was always emitted, even when no caller had explicitly picked a value.Both the Anthropic and OpenAI request builders already gate the field on
Options.Temperature > 0:PasClaw.Providers.Anthropic.pas:108PasClaw.Providers.OpenAI.pas:79So changing the default to
0("not set") silently omits the field. Callers who want a specific temperature still set it viaOptionsor config; otherwise providers fall back to their server-side default, which is what most users implicitly assumed they were getting from0.7.Test plan
pasclaw agentwith Claude Opus 4.7 model: no more 400; reply streams normally>0, no behavior change unless a caller relied on the implicit 0.7)Options.Temperature := 0.7before callingChat()still sends the fieldhttps://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code