openclaw - ✅(Solved) Fix LCM still sends deprecated temperature=0.2 to claude-opus-4-7 on v2026.4.24 [2 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72123Fetched 2026-04-27 05:34:31
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×2closed ×1

Follow-up to #70582.

#70582 was closed as implemented for v2026.4.24, but the issue is still reproducible on a live v2026.4.24 installation. LCM compaction still sends the deprecated temperature=0.2 parameter to claude-opus-4-7 on the first attempt, receives a 400 from Anthropic, then succeeds only through the conservative retry path.

This issue also raises a related design question: if LCM resolves to claude-opus-4-7 by default, what is the expected behavior for users who do not have access to that model/API?

Error Message

finish=error [2026-04-26T18:46:37.649+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"temperature is deprecated for this model."},"request_id":"req_011CaSFPNyTKNnhUKcbg7BMA"}; retrying with conservative settings [2026-04-26T18:47:39.554+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"temperature is deprecated for this model."},"request_id":"req_011CaSFTwUAwSmf2LVeyLzyy"}; retrying with conservative settings [2026-04-26T18:49:39.342+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"temperature is deprecated for this model."},"request_id":"req_011CaSFcmmWpS6fpq753uTAE"}; retrying with conservative settings

  • Retry should not be needed for this avoidable request-shape error. There may be a second issue hiding behind the temperature error.

Root Cause

Follow-up to #70582.

#70582 was closed as implemented for v2026.4.24, but the issue is still reproducible on a live v2026.4.24 installation. LCM compaction still sends the deprecated temperature=0.2 parameter to claude-opus-4-7 on the first attempt, receives a 400 from Anthropic, then succeeds only through the conservative retry path.

This issue also raises a related design question: if LCM resolves to claude-opus-4-7 by default, what is the expected behavior for users who do not have access to that model/API?

Fix Action

Fixed

PR fix notes

PR #72149: fix(agents): omit temperature for anthropic opus 4.7 requests

Description (problem / solution / changelog)

fix(agents): omit Opus 4.7 temperature in Anthropic transport

Summary

Fixes repeated compaction first-attempt failures for Anthropic claude-opus-4-7 by preventing temperature from being sent on that model.

Fixes #72123.

Root Cause

  • OpenClaw can inherit temperature from merged runtime/model extra params.
  • Anthropic transport forwarded that temperature when thinking was not enabled.
  • Anthropic Opus 4.7 rejects sampling parameters in this shape, causing first-attempt 400 errors and fallback retries.

Official Evidence (Anthropic docs)

From Anthropic's migration guide:

"Sampling parameters removed: Setting temperature, top_p, or top_k to any non-default value on Claude Opus 4.7 returns a 400 error. The safest migration path is to omit these parameters entirely from request payloads."

Reference: Anthropic migration guide

What Changed

  • Updated src/agents/anthropic-transport-stream.ts:
    • normalized Opus 4.7 model-id matching;
    • skipped params.temperature injection for Opus 4.7 even if options.temperature is present.
  • Updated src/agents/anthropic-transport-stream.test.ts:
    • added regression test to assert Opus 4.7 payload omits temperature.

Validation

  • pnpm test src/agents/anthropic-transport-stream.test.ts (pass, 9/9)
  • pnpm check:changed was attempted;

Risk / Follow-up

  • Scope is narrow to Anthropic Opus 4.7 request shaping.
  • Other Anthropic models keep existing behavior.

AI-assisted

  • AI-assisted and manually reviewed.

Changed files

  • src/agents/anthropic-transport-stream.test.ts (modified, +21/-0)
  • src/agents/anthropic-transport-stream.ts (modified, +7/-2)

PR #72301: fix(lcm): strip temperature for claude-opus-4-7 in all transport paths

Description (problem / solution / changelog)

Summary

Fixes the remaining LCM compaction path that still sends deprecated temperature to claude-opus-4-7, causing a first-attempt 400 on every compaction even after #70582 was closed as implemented.

Root Cause

#70582 patched the generateSummary() path in pi-coding-agent, but two separate locations in anthropic-transport-stream.ts were still forwarding temperature for claude-opus-4-7:

  1. buildAnthropicParams() — only skipped temperature when thinkingEnabled, not when the model doesn't support it
  2. resolveAnthropicTransportOptions() — no guard at all, passed options?.temperature through unconditionally

Both paths caused request_temperature_sent=true in LCM logs, triggering a 400 from Anthropic on every first attempt, with the system recovering only via the retry path.

Changes

  • buildAnthropicParams() — added !isClaudeOpus47Model(model.id) guard alongside the existing !options.thinkingEnabled check
  • resolveAnthropicTransportOptions() — strip temperature to undefined when model is claude-opus-4-7
  • Reused the existing isClaudeOpus47Model() helper (already typed, covers both opus-4-7 and opus-4.7 naming variants)
  • Removed unused MODELS_WITHOUT_TEMPERATURE constant

Expected outcome after fix

  • No request_temperature_sent=true in LCM logs for claude-opus-4-7
  • No first-attempt 400 with `temperature` is deprecated for this model
  • Retry path no longer needed for this avoidable request-shape error
  • Every LCM compaction succeeds on first attempt

Testing

  • Build passes (npm run build)
  • Manually verified: no request_temperature_sent=true in LCM logs
  • No first-attempt 400 on compaction with claude-opus-4-7

Related

  • Fixes #72123
  • Follow-up to #70582

Changed files

  • src/agents/anthropic-transport-stream.ts (modified, +10/-5)

Code Example

OpenClaw: 2026.4.24
Gateway: running after restart
@mariozechner/pi-ai: 0.70.2
@mariozechner/pi-coding-agent: 0.70.2
Provider/model in failing LCM path: anthropic / claude-opus-4-7

---

request_temperature=0.2
request_temperature_sent=true
finish=error
error_message=400 ... "`temperature` is deprecated for this model."

---

[lcm] retry succeeded ... source=retry
[lcm] summary resolved via non-content path ... source=retry

---

[2026-04-26T18:46:37.649+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFPNyTKNnhUKcbg7BMA"}; retrying with conservative settings
[2026-04-26T18:47:05.256+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:47:05.258+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

[2026-04-26T18:47:39.554+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFTwUAwSmf2LVeyLzyy"}; retrying with conservative settings
[2026-04-26T18:48:05.322+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:48:05.324+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

[2026-04-26T18:49:39.342+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFcmmWpS6fpq753uTAE"}; retrying with conservative settings
[2026-04-26T18:50:05.972+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:50:05.974+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

---

[2026-04-26T18:53:38.698+08:00] ... request_temperature=0.2; request_temperature_sent=true; ... request_id=req_011CaSFvQw8tua5zQUv7n2cP ... retrying with conservative settings
[2026-04-26T18:55:30.057+08:00] ... request_temperature=0.2; request_temperature_sent=true; ... request_id=req_011CaSG4dGGcxosJbFC6Rms2 ... retrying with conservative settings

---

request_temperature=0.2
request_temperature_sent=true
RAW_BUFFERClick to expand / collapse

Summary

Follow-up to #70582.

#70582 was closed as implemented for v2026.4.24, but the issue is still reproducible on a live v2026.4.24 installation. LCM compaction still sends the deprecated temperature=0.2 parameter to claude-opus-4-7 on the first attempt, receives a 400 from Anthropic, then succeeds only through the conservative retry path.

This issue also raises a related design question: if LCM resolves to claude-opus-4-7 by default, what is the expected behavior for users who do not have access to that model/API?

Environment

Verified after upgrading and restarting gateway:

OpenClaw: 2026.4.24
Gateway: running after restart
@mariozechner/pi-ai: 0.70.2
@mariozechner/pi-coding-agent: 0.70.2
Provider/model in failing LCM path: anthropic / claude-opus-4-7

Package versions were checked directly from the installed OpenClaw node_modules tree.

Actual behavior

Fresh LCM compactions after the v2026.4.24 upgrade still log:

request_temperature=0.2
request_temperature_sent=true
finish=error
error_message=400 ... "`temperature` is deprecated for this model."

Then the retry succeeds:

[lcm] retry succeeded ... source=retry
[lcm] summary resolved via non-content path ... source=retry

So the system is functional due to retry, but the original first-attempt failure is still present. This means every affected compaction still pays for one failing request/round trip and keeps the retry-loop/noise/corruption risk surface around.

Reproduction evidence

From /tmp/openclaw/openclaw-2026-04-26.log, after the gateway restart on v2026.4.24:

[2026-04-26T18:46:37.649+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFPNyTKNnhUKcbg7BMA"}; retrying with conservative settings
[2026-04-26T18:47:05.256+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:47:05.258+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

[2026-04-26T18:47:39.554+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFTwUAwSmf2LVeyLzyy"}; retrying with conservative settings
[2026-04-26T18:48:05.322+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:48:05.324+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

[2026-04-26T18:49:39.342+08:00] [lcm] empty normalized summary on first attempt; provider=anthropic; model=claude-opus-4-7; ... request_api=anthropic-messages; request_reasoning=(none); request_has_system=true; request_temperature=0.2; request_temperature_sent=true; ... finish=error; error_message=400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."},"request_id":"req_011CaSFcmmWpS6fpq753uTAE"}; retrying with conservative settings
[2026-04-26T18:50:05.972+08:00] [lcm] retry succeeded; provider=anthropic; model=claude-opus-4-7; block_types=text; source=retry
[2026-04-26T18:50:05.974+08:00] [lcm] summary resolved via non-content path; provider=anthropic; model=claude-opus-4-7; source=retry

Additional fresh occurrences after that:

[2026-04-26T18:53:38.698+08:00] ... request_temperature=0.2; request_temperature_sent=true; ... request_id=req_011CaSFvQw8tua5zQUv7n2cP ... retrying with conservative settings
[2026-04-26T18:55:30.057+08:00] ... request_temperature=0.2; request_temperature_sent=true; ... request_id=req_011CaSG4dGGcxosJbFC6Rms2 ... retrying with conservative settings

Why #70582 may have been closed prematurely

The closing comment on #70582 says current main/v2026.4.24 no longer builds LCM compaction payloads with hardcoded temperature: 0.2, and references pi-coding-agent / pi-ai 0.70.2 generateSummary().

That may be true for one summarization path, but the live LCM compaction path in this installation is still producing telemetry with:

request_temperature=0.2
request_temperature_sent=true

So the remaining caller may be a different LCM/plugin summarization path, not the pi-coding-agent generateSummary() path that was audited.

A quick source check also suggests pi-ai providers still forward a caller-supplied temperature. For example, the installed Anthropic provider only guards temperature when thinking is enabled; it does not strip temperature based on model ID. That means the caller still needs to avoid passing unsupported options for claude-opus-4-7.

Expected behavior

For LCM compaction using claude-opus-4-7:

  • First attempt should omit temperature entirely.
  • Logs should not show request_temperature_sent=true.
  • No first-attempt 400 should be emitted for temperature` is deprecated for this model.
  • Retry should not be needed for this avoidable request-shape error.

Related design question: model fallback

There may be a second issue hiding behind the temperature error.

If LCM's live summarization path resolves to claude-opus-4-7 by default, what is the expected behavior for users who do not have access to that Anthropic model/API?

Ideally:

  1. LCM should choose a summarization model from configured/available models, or from an explicit lcm.summaryModel-style setting if one exists.
  2. If the preferred model is unavailable/unauthorized, LCM should fall back to another available summarization-capable model, e.g. Sonnet/Haiku/Gemini/OpenAI depending on configured providers.
  3. Request options should be filtered by the selected model/provider capability. For example, temperature should be omitted for claude-opus-4-7, regardless of which summarization path invokes the provider.
  4. Logs should make clear which model was selected and whether a fallback occurred.

Question:

Is claude-opus-4-7 currently an intentional hard default for LCM compaction, or is it supposed to be resolved from user config / default model aliases / available providers?

If it is intentional, users without Opus 4.7 access may hit a different failure after this temperature issue is fixed: model unavailable / unauthorized. It would be useful to clarify and test the no-Opus-access path as part of this fix.

extent analysis

TL;DR

The issue can be fixed by modifying the LCM compaction path to omit the temperature parameter when using the claude-opus-4-7 model.

Guidance

  • Review the LCM compaction code to identify where the temperature parameter is being added and modify it to check the model ID before including it.
  • Verify that the pi-ai providers are correctly filtering out unsupported options for each model, such as temperature for claude-opus-4-7.
  • Consider implementing a fallback mechanism for users who do not have access to the default claude-opus-4-7 model, to prevent future failures.
  • Test the LCM compaction path with different models and providers to ensure that request options are being correctly filtered.

Example

No code example is provided as the issue does not include specific code snippets, but the modification should involve checking the model ID before adding the temperature parameter, e.g., if (modelId !== 'claude-opus-4-7') { addTemperatureParameter(); }.

Notes

The issue highlights the importance of testing with different models and providers to ensure that the LCM compaction path is correctly handling various scenarios. Additionally, clarifying the expected behavior for users without access to the default model will help prevent future issues.

Recommendation

Apply a workaround to omit the temperature parameter for the claude-opus-4-7 model, and consider implementing a fallback mechanism for users without access to this model, to prevent future failures and ensure a more robust LCM compaction path.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

For LCM compaction using claude-opus-4-7:

  • First attempt should omit temperature entirely.
  • Logs should not show request_temperature_sent=true.
  • No first-attempt 400 should be emitted for temperature` is deprecated for this model.
  • Retry should not be needed for this avoidable request-shape error.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix LCM still sends deprecated temperature=0.2 to claude-opus-4-7 on v2026.4.24 [2 pull requests, 2 comments, 3 participants]