openclaw - 💡(How to fix) Fix Auto-compaction fails on Claude Opus 4.7 — thinking.type.enabled unsupported (use adaptive + output_config.effort)

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…

Error Message

Compaction failed: Summarization failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":""thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior."},"request_id":"req_011CaFgYALZ4drNMd6NeEJG1"}

Root Cause

Root cause (likely)

Fix Action

Fix / Workaround

  • Oversized sessions cannot self-recover — compaction is the escape hatch and it's broken.
  • Every subsequent turn in an oversized session either fails or truncates silently.
  • Current workaround is to manually /new and lose transcript history.

Code Example

Compaction failed: Summarization failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":"\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."},"request_id":"req_011CaFgYALZ4drNMd6NeEJG1"}

---

"thinking": { "type": "adaptive" },
"output_config": { "effort": "..." }
RAW_BUFFERClick to expand / collapse

Version: OpenClaw 2026.4.15 (041266a) Model: anthropic/claude-opus-4-7 OS: Linux 6.6.87.2-microsoft-standard-WSL2 (WSL2, x64)

What happened

When a session exceeded the 200K context window, auto-compaction triggered and failed with:

Compaction failed: Summarization failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":"\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."},"request_id":"req_011CaFgYALZ4drNMd6NeEJG1"}

Context at time of failure: 215k/200k (107%).

Root cause (likely)

Anthropic's newer Claude models (including Opus 4.7) no longer accept the thinking: { type: "enabled" } shape. The new API surface is:

"thinking": { "type": "adaptive" },
"output_config": { "effort": "..." }

The summarization/compaction call in OpenClaw appears to still send the old shape.

Impact

  • Oversized sessions cannot self-recover — compaction is the escape hatch and it's broken.
  • Every subsequent turn in an oversized session either fails or truncates silently.
  • Current workaround is to manually /new and lose transcript history.

Requested fix

Update the summarizer request builder to:

  • Send thinking.type: "adaptive" (or omit thinking entirely for summarization — it likely doesn't need it)
  • Add output_config.effort where appropriate
  • Gate the thinking shape by model family so older Claude models still work

Happy to test a fix against this exact failing session if useful.

extent analysis

TL;DR

Update the summarizer request builder to send thinking.type: "adaptive" and add output_config.effort for newer Claude models.

Guidance

  • Verify the model family before sending the summarization request to determine whether to use the old or new thinking shape.
  • Update the request builder to omit thinking entirely for summarization or send thinking.type: "adaptive" for newer Claude models.
  • Add output_config.effort to the request where appropriate to control thinking behavior.
  • Test the fix against the exact failing session to ensure compatibility with older Claude models.

Example

"thinking": { "type": "adaptive" },
"output_config": { "effort": "..." }

This example shows the new API surface for newer Claude models.

Notes

The fix may not apply to older Claude models that still support the old thinking shape. The request builder should be updated to gate the thinking shape by model family to ensure compatibility.

Recommendation

Apply workaround: Update the summarizer request builder to send the new thinking shape and add output_config.effort for newer Claude models, as this will fix the compaction issue for oversized sessions.

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…

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 - 💡(How to fix) Fix Auto-compaction fails on Claude Opus 4.7 — thinking.type.enabled unsupported (use adaptive + output_config.effort)