原文整理页

Garry Tan 分享了 OpenClaw 适配 Claude Fable 5 的热修复指南,解决因 Anthropic API 参数变更导致的调用失败问题

来源作者:Garry Tan (@garrytan)原始来源:https://x.com/garrytan/status/2064843483396137346

中文导读

Garry Tan 分享了 OpenClaw 适配 Claude Fable 5 的热修复指南,解决因 Anthropic API 参数变更导致的调用失败问题。

正文 Markdown

Here's the instructions on how to get an older version of OpenClaw to use Claude Fable 5 using API key properly - paste this into your Claude Code instance operating on your openclaw.json. Apply the fable-5 adaptive-thinking hotfix to OpenClaw's dist. Context: On 2026-06-10 Anthropic flipped claude-fable-5 to require adaptive-thinking params (thinking.type:"adaptive" + output_config.effort) and now rejects the legacy thinking.type:"enabled"/"disabled" style. OpenClaw hardcodes its adaptive-model list in the dist and doesn't know fable-5, so every fable-5 turn errors. The dist lives in the ephemeral container (/app/node_modules/openclaw/dist) and is wiped on rebuild. Steps: 1. Run cd /data/.openclaw/workspace && node scripts/patch-fable5-adaptive-thinking.mjs. It's idempotent — it patches only if the marker is missing and exits 1 if anchors are gone. 2. If the script is missing, recreate it: it edits TWO dist files (anthropic-*.js and provider-stream-*.js, find by grepping for supportsAdaptiveThinking) with TWO fixes each: (a) append || modelId.includes("fable-5") || modelId.includes("fable5") to the adaptive-model classifier (the line matching modelId.includes("sonnet-4-6") || modelId.includes("sonnet-4.6");), and (b) guard the thinking-off path so params.thinking = { type: "disabled" } is only sent when !supportsAdaptiveThinking(model.id) — omit the param entirely for adaptive models (sessions with thinking:off stay bricked otherwise; /new doesn't clear the override). 3. If it reports MISS (anchor not found), OpenClaw was updated and the dist layout changed — grep the new dist for supportsAdaptiveThinking and re-derive the anchors; or check whether the new build already classifies fable-5 as adaptive, in which case delete the script + the fable5-adaptive-thinking-patch-rearm cron job. 4. Restart the gateway to load the patched dist