Skip to content

config: omit the thinking field when thinking_effort is None - #11

Open
vishkaty wants to merge 1 commit into
anthropics:mainfrom
vishkaty:pr/config-omit-thinking-when-none
Open

vishkaty wants to merge 1 commit into
anthropics:mainfrom
vishkaty:pr/config-omit-thinking-when-none

Conversation

@vishkaty

@vishkaty vishkaty commented Sep 10, 2026 •

Copy link
Copy Markdown

thinking_request_fields sent {"thinking": {"type": "disabled"}} for
thinking_effort=None. Models that always think reject an explicit disabled
with a 400 (Claude Fable 5 and 5.1; Claude Opus 5 at effort xhigh or max), so
a config with no effort could not run on them at all. Omitting the field means the
model's own default, which is what None was meant to say.

Reference: the per-model table and the "thinking.type.disabled" is not supported
entry in https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting
("Omit the thinking parameter; these models think without any configuration").
Reproduced for the Opus 5 case: a request with thinking: {"type": "disabled"} and
effort xhigh is answered 400 output_config.effort 'xhigh' is not supported when thinking is disabled on this model. Use effort 'high' or below, or enable thinking.

Found by running a conformance statement against the reference at fd4d592; the test in this change fails without the fix and passes with it. The full suite, ruff check, ruff format --check and scripts/check.py are clean on this branch.

Amended 2026-09-18. The Models comment in config.py still described None as
"thinking disabled"; it now states what None does. The behavioural consequence, for a
config that sets thinking_effort=None explicitly: the model's default applies (thinking
on for Claude Sonnet 5, Opus 5 and Fable 5.x; off for Opus 4.7 and 4.8) instead of
thinking off. Both role configs default to "low", so the shipped examples are unaffected.
The stale comment was caught by the review in SanHsien's fork (docs/DECISIONS.md there).

SanHsien referenced this pull request in SanHsien/commerce-agents Sep 11, 2026
- #29:demo hosts 的 sessions 可由部署方注入自己的 SessionStore,預設仍是記憶體型。
- #12:demo host 缺憑證時只印一行警告,不再每個 request 噴完整 traceback。
- #11:thinking_effort 為 None 時省略 thinking 欄位而非送 disabled(模型一律思考時
  disabled 會 400),並訂正 config.py 的 Models 區塊註解——None 是「不指定、交由模型
  預設」,省略欄位在 Fable 5/5.1、Opus 5、Sonnet 5 上會開啟 adaptive 思考,不是關閉。

docs/DIVERGENCE.md 新增 8 列登記這批上游持有檔案的分岔,tests/test_fork_divergence.py
釘死集合同步更新。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
SanHsien referenced this pull request in SanHsien/commerce-agents Sep 11, 2026
C 批三筆判決欄改為「已採納(f814ef9)」,並補上移植方式、#11 的語意變更理由與訂正
範圍(config.py 註解 grep 核對結果)、驗證輸出摘要。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
`thinking_request_fields` sent `{"thinking": {"type": "disabled"}}` for
`thinking_effort=None`. Models that always think reject an explicit `disabled`
with a 400 (Fable 5.x; Opus 5 at the highest efforts), so a config with no
effort could not run on them at all. Omitting the field means the model's own
default, which is what None was meant to say.
@vishkaty
vishkaty force-pushed the pr/config-omit-thinking-when-none branch from 0d599b2 to c6c681f Compare September 18, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants