Summary
Calls to claude-opus-4-7 (configured via provider: anthropic) consistently fail with HTTP 400:
{"error":{"code":"invalid_request_error","message":"temperature is deprecated for this model.","type":"invalid_request_error"}}
The claude-opus-4-7 family no longer accepts the temperature parameter — sending it (even at the picoclaw default 0.7) returns a 400 before the model is invoked. There is no per-model config knob to suppress the field today, so every request to this model fails.
Reproduce
- Add a model entry:
{
"model_name": "claude-opus-4.7",
"provider": "anthropic",
"model": "claude-opus-4-7",
"api_base": "https://api.anthropic.com/v1"
}
- Set a valid
sk-ant-… Anthropic API key for that entry (no auth_method).
- Send any chat message → 400 from Anthropic with the message above.
Where temperature is injected
pkg/agent/instance.go:178 — defaults temperature to 0.7 when agents.defaults.temperature is unset.
pkg/providers/openai_compat/provider.go:178-184 — always writes requestBody["temperature"] for the chat-completions path that the anthropic protocol routes through.
pkg/providers/anthropic_messages/provider.go:176-179 — same unconditional write for the native Messages API.
A workaround exists (set thinking_level: "off" on the model entry — only works in some cases) but the root cause is the unconditional temperature send.
Suggested fix
Skip the field for models that deprecate it, mirroring the existing kimi-k2 special case in openai_compat. PR follows.
Environment
- picoclaw v0.2.7 (
git_commit 71c877a, built 2026-04-22)
- Docker image
sipeed/picoclaw:launcher
- Anthropic API
Summary
Calls to
claude-opus-4-7(configured viaprovider: anthropic) consistently fail with HTTP 400:The claude-opus-4-7 family no longer accepts the
temperatureparameter — sending it (even at the picoclaw default0.7) returns a 400 before the model is invoked. There is no per-model config knob to suppress the field today, so every request to this model fails.Reproduce
{ "model_name": "claude-opus-4.7", "provider": "anthropic", "model": "claude-opus-4-7", "api_base": "https://api.anthropic.com/v1" }sk-ant-…Anthropic API key for that entry (noauth_method).Where temperature is injected
pkg/agent/instance.go:178— defaultstemperatureto0.7whenagents.defaults.temperatureis unset.pkg/providers/openai_compat/provider.go:178-184— always writesrequestBody["temperature"]for the chat-completions path that theanthropicprotocol routes through.pkg/providers/anthropic_messages/provider.go:176-179— same unconditional write for the native Messages API.A workaround exists (set
thinking_level: "off"on the model entry — only works in some cases) but the root cause is the unconditionaltemperaturesend.Suggested fix
Skip the field for models that deprecate it, mirroring the existing kimi-k2 special case in
openai_compat. PR follows.Environment
git_commit71c877a, built 2026-04-22)sipeed/picoclaw:launcher