← Back to PRs

#21558: config: support agents.list[].thinkingDefault

by Uarmagan open 2026-02-20 03:05 View on GitHub →
app: web-ui gateway commands agents size: S
## 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