← Back to PRs

#15030: Agents: support per-agent thinking defaults

by sauerdaniel open 2026-02-12 22:11 View on GitHub →
commands agents size: XS
## Summary Adds a `thinkingDefault` field to agent config so each agent can have its own default thinking level (`off`, `low`, `medium`, `high`). ### Changes - **Config schema**: Add optional `thinkingDefault` to agent config with validation - **Model selection**: Resolve per-agent thinking default when no explicit level is set - **Chat server**: Thread agent thinking default through reply pipeline - **Lint fix**: Remove unused imports in chat server methods ### Testing - Fully tested, using it in production with 11 agents at different thinking levels --- *Clean rebased branch — 3 commits on current main.* <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds an optional `thinkingDefault` field to per-agent configuration (schema + types), threads it through agent config resolution, and uses it during reply/model selection and in the gateway chat history response. It also includes a small lint-only cleanup in the chat server. Key integration points: - `src/agents/agent-scope.ts` exposes `thinkingDefault` via `resolveAgentConfig`. - `src/auto-reply/reply/get-reply.ts` and `src/commands/agent.ts` merge per-agent values into `cfg.agents.defaults` so the existing reply pipeline can consume them. - `src/auto-reply/reply/model-selection.ts` adjusts default thinking resolution to prefer the per-agent value. Main issue to fix before merge: `getReplyFromConfig` currently uses a truthiness check when merging `thinkingDefault`, which breaks the ability to set a per-agent default of `"off"` to override a global non-off default. <h3>Confidence Score: 3/5</h3> - This PR is close, but there is at least one confirmed precedence bug that can prevent per-agent config from taking effect in common configurations. - Most changes are straightforward schema/plumbing. However, `getReplyFromConfig` will ignore an explicit per-agent `thinkingDefault: "off"` when global defaults set a non-off value, which contradicts the feature intent and will produce wrong runtime behavior for affected agents. There is also a significant precedence behavior change in model-selection that should be confirmed as intended. - src/auto-reply/reply/get-reply.ts, src/auto-reply/reply/model-selection.ts <sub>Last reviewed commit: 804fd10</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> ## AI-Assisted Yes — implemented and reviewed with AI assistance. ## Local Validation ```bash pnpm build && pnpm check && pnpm test ``` All tests pass. TypeScript compilation clean. Lint passes.

Most Similar PRs