#21614: fix: warn when thinking level xhigh falls back for unsupported models
commands
size: XS
Fixes #21582
## Summary
When `thinkingDefault: "xhigh"` is set in config for models that don't support it (e.g., Anthropic Claude), the level silently falls back to `"high"` with no warning in logs or status output.
This leaves users confused when their thinking budget is lower than expected — only discoverable by manually checking `/status` after an upgrade.
## Root Cause
In `src/commands/agent.ts`, config-level `xhigh` settings for unsupported models fall back to `high` without emitting any diagnostic:
```typescript
if (resolvedThinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
const explicitThink = Boolean(thinkOnce || thinkOverride);
if (explicitThink) {
throw new Error(...); // Explicit /thinking xhigh → error
}
resolvedThinkLevel = "high"; // Config xhigh → silent fallback ⚠️
}
```
## Changes
- Added `console.warn` before fallback to `"high"` for config-level `xhigh`
- Warning message includes:
- Unsupported model (e.g., `anthropic/claude-opus-4-6`)
- List of supported models (GPT-5.2, Codex variants)
- Fallback action ("Falling back to 'high'")
- Explicit `/thinking xhigh` commands continue to throw errors (unchanged)
**Example warning:**
```
[openclaw] Thinking level "xhigh" is not supported for anthropic/claude-opus-4-6.
Supported models: openai/gpt-5.2, openai-codex/gpt-5.3-codex, ... Falling back to "high".
```
## Impact
- ✅ Users see clear warning at startup instead of silent runtime downgrade
- ✅ Helps identify config issues immediately (no need to check `/status`)
- ✅ No behavior change: fallback logic remains `high` (just visible now)
- ✅ Existing tests unaffected (only added logging, no logic change)
## Testing
- All existing tests pass (`thinking.test.ts`: 14/14 ✅)
- Fallback behavior unchanged (still `"high"`)
- Warning only emitted for config-level `xhigh`, not explicit commands
## Closes
#21582
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a warning message when the `thinkingDefault: "xhigh"` config setting silently falls back to `"high"` for models that don't support extra-high thinking levels (e.g., Anthropic Claude). Previously, users would only discover this downgrade by checking `/status` output, leading to confusion about lower-than-expected thinking budgets.
The change adds a single `console.warn` call that clearly identifies the unsupported model, lists which models do support `xhigh` (GPT-5.2, Codex variants), and notifies users of the fallback to `"high"`. The warning only appears for config-level `xhigh` settings—explicit `/thinking xhigh` commands continue to throw errors as before.
The implementation is minimal, non-breaking, and improves user experience by making silent configuration issues visible at startup.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change adds only a single `console.warn` statement without modifying any logic or control flow. The fallback behavior remains identical (still uses `"high"`), and the warning provides clear, actionable information. No test changes are needed since the functionality is unchanged. The implementation follows repository conventions (uses `[openclaw]` prefix), and the message accurately reflects the helper functions' output.
- No files require special attention
<sub>Last reviewed commit: 25875d2</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#20620: feat: add anthropic/claude-opus-4-6 to XHIGH_MODEL_REFS
by chungjchris · 2026-02-19
84.0%
#7137: fix: add openai-codex/gpt-5.2 to XHIGH_MODEL_REFS
by sauerdaniel · 2026-02-02
82.2%
#19384: Auto-reply: allow xhigh for OpenAI-compatible provider aliases
by 0x4007 · 2026-02-17
81.5%
#22797: Feat/auto thinking mode
by jrthib · 2026-02-21
78.4%
#15606: LLM Task: add explicit thinking level wiring
by xadenryan · 2026-02-13
77.1%
#16899: feat(config): per-agent and per-model thinking defaults
by jh280722 · 2026-02-15
76.2%
#6685: fix: suppress thinking leak for Synthetic reasoning models
by AkiLetschne · 2026-02-01
76.2%
#13940: fix: suppress low context window warning for explicitly configured ...
by tsukhani · 2026-02-11
75.6%
#19407: fix(agents): strip thinking blocks on cross-provider model switch (...
by lailoo · 2026-02-17
75.3%
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
75.2%