#20458: feat: per-model thinkingDefault config and /think default directive
agents
size: S
Cluster:
Agent Thinking Defaults Enhancement
## Summary
Add per-model thinkingDefault to resolve thinking level based on which
model is active, so users running different models (e.g. gemini-3-pro
for chat, gemini-3-flash for heartbeats) get appropriate thinking levels
automatically without manually toggling /think per session.
Resolution priority: per-model → global → catalog auto-detect (existing
fallback behavior unchanged). Config keys are normalized via parseModelRef
so aliases like "anthropic/opus-4.6" resolve correctly.
Also adds:
- /think default directive to undo a session-level thinking override and
cascade back to the per-model default
- Re-resolve thinking default after inline /model switch for both
directive-only and inline-with-content paths
- Memory flush passes provider/model through for correct resolution
Discussion: #20612
Related: #18152 (built independently, shares the per-model config concept
but adds /think default and model-switch re-resolution)
### Config example
```json
{
"agents": {
"defaults": {
"thinkingDefault": "low",
"models": {
"google/gemini-2.5-pro": {},
"google/gemini-3-flash": { "thinkingDefault": "high" },
"google/gemini-flash-lite-latest": { "thinkingDefault": "off" }
}
}
}
}
```
## Test plan
- [x] `pnpm build` passes
- [x] `pnpm check` passes (clean on changed files)
- [x] `pnpm test` passes (456 tests, 47 files)
- [x] Manually verified `/think default` resets level and per-model config resolves correctly via `openclaw doctor`
- [x] E2E tested with live gateway
AI-assisted (Claude Code), fully tested.
Most Similar PRs
#18695: feat(agents): add per-agent thinkingDefault override
by cathrynlavery · 2026-02-17
79.6%
#16899: feat(config): per-agent and per-model thinking defaults
by jh280722 · 2026-02-15
77.7%
#15030: Agents: support per-agent thinking defaults
by sauerdaniel · 2026-02-12
73.3%
#21558: config: support agents.list[].thinkingDefault
by Uarmagan · 2026-02-20
72.1%
#21959: feat(config): add per-agent thinkingDefault, heartbeat thinking ove...
by heyhudson · 2026-02-20
72.0%
#14323: feat: add forcePrependThinkTag option for reasoning models
by LisaMacintosh · 2026-02-11
69.2%
#16298: feat(xai): switch grok-4-1-fast variants by thinking level
by avirweb · 2026-02-14
69.1%
#20620: feat: add anthropic/claude-opus-4-6 to XHIGH_MODEL_REFS
by chungjchris · 2026-02-19
68.3%
#16399: feat: auto-escalate thinking level based on context window usage
by cmfinlan · 2026-02-14
67.8%
#21614: fix: warn when thinking level xhigh falls back for unsupported models
by lbo728 · 2026-02-20
67.4%