#21558: config: support agents.list[].thinkingDefault
app: web-ui
gateway
commands
agents
size: S
Cluster:
Agent Thinking Defaults Enhancement
## Summary
- allow `agents.list[].thinkingDefault` in config schema/types
- honor per-agent thinking defaults when resolving default think level
- apply per-agent think default in auto-reply runs
- add regression tests for schema acceptance + per-agent precedence
## Why
Users currently hit config validation errors like:
`agents.list.0: Unrecognized key: "thinkingDefault"`
when trying to set thinking defaults per agent (e.g. Atlas). This makes gateway calls fail during local config checks and is confusing because the runtime already has plumbing for agent-aware think resolution.
## Notes
- This change is focused on `thinkingDefault` only.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added support for per-agent `thinkingDefault` configuration overrides. The PR extends the config schema and types to allow setting thinking defaults on a per-agent basis in `agents.list[].thinkingDefault`, and updates the resolution logic to prefer per-agent values over global defaults.
Key changes:
- Extended `AgentEntrySchema` Zod schema to accept `thinkingDefault` field
- Added `thinkingDefault` to `AgentConfig` type and `ResolvedAgentConfig`
- Updated `resolveThinkingDefault()` to accept optional `agentId` parameter and resolve per-agent overrides
- Modified call sites in gateway, commands, and cron to pass `agentId` when resolving thinking defaults
- Added workaround in `get-reply.ts` to manually construct `agentCfg` with per-agent thinking default
- Added regression test for schema acceptance and unit test for precedence logic
The implementation works correctly with proper precedence (per-agent > global > model-based > "off"), though the approach is somewhat distributed across multiple layers.
<h3>Confidence Score: 4/5</h3>
- Safe to merge with minimal risk - implements a well-scoped feature addition with proper tests
- The changes are focused and implement the stated feature correctly. The implementation includes proper type definitions, schema validation, regression tests, and updates to key call sites. The logic preserves correct precedence order (per-agent > global > model defaults). However, the score is not a 5 because the implementation is somewhat distributed and could benefit from consolidation (e.g., the workaround in `get-reply.ts` and the missing `agentId` in `auto-reply/reply/model-selection.ts`). There's also incomplete coverage - some call sites like `extensions/voice-call` and `auto-reply/reply/model-selection.ts` don't pass `agentId` to `resolveThinkingDefault`, though the feature still works via fallback paths.
- No files require special attention
<sub>Last reviewed commit: 7663bae</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15030: Agents: support per-agent thinking defaults
by sauerdaniel · 2026-02-12
90.0%
#16899: feat(config): per-agent and per-model thinking defaults
by jh280722 · 2026-02-15
89.1%
#18695: feat(agents): add per-agent thinkingDefault override
by cathrynlavery · 2026-02-17
83.8%
#21959: feat(config): add per-agent thinkingDefault, heartbeat thinking ove...
by heyhudson · 2026-02-20
80.8%
#16399: feat: auto-escalate thinking level based on context window usage
by cmfinlan · 2026-02-14
78.3%
#10998: fix(agents): pass session thinking/reasoning levels to session_stat...
by wony2 · 2026-02-07
77.7%
#15264: feat: Dynamic thinking level pre-routing based on message complexity
by phani-D · 2026-02-13
77.7%
#19329: feat: add per-agent compaction and context pruning overrides
by curtismercier · 2026-02-17
77.1%
#16298: feat(xai): switch grok-4-1-fast variants by thinking level
by avirweb · 2026-02-14
77.0%
#10197: fix: add missing allowAgents to agent defaults subagents schema
by Yida-Dev · 2026-02-06
76.9%