← Back to PRs

#20458: feat: per-model thinkingDefault config and /think default directive

by kmixter open 2026-02-18 23:48 View on GitHub →
agents size: S
## 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