#19624: fix: elevatedDefault should default to off when tools.elevated.enabled is true
size: XS
Cluster:
Elevated Default Configuration Fixes
## Summary
Fixes #19574
When `tools.elevated.enabled` is set to `true` but no explicit `elevatedDefault` is configured, the fallback was `"on"` — causing **all** exec commands to route through the elevated approval gate, which times out silently after 120s.
## Changes
- **`src/auto-reply/reply/get-reply-directives.ts`**: Changed the final fallback in the `resolvedElevatedLevel` resolution chain from `"on"` to `"off"`, making elevated mode opt-in per session.
- **`src/auto-reply/reply/bash-command.ts`**: Changed the hardcoded `defaultLevel: "on"` to `"off"` in the chat bash command elevated config.
- **Updated e2e test**: Adjusted the expected default from `"on"` to `"off"` in the directive behavior test.
## Behavior
- **Before**: Enabling `tools.elevated.enabled` without setting `elevatedDefault` caused all exec commands to require elevated approval (defaulting to `"on"`).
- **After**: Elevated mode defaults to `"off"`. Users must explicitly opt in via `/elevated on`, `/elevated ask`, or by setting `elevatedDefault` in their agent config.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Changed the fallback default for `elevatedDefault` from `"on"` to `"off"` when `tools.elevated.enabled` is `true` but no explicit `elevatedDefault` is configured. This fixes issue #19574 where all exec commands were routing through the elevated approval gate and timing out silently after 120 seconds.
The fix ensures elevated mode is now opt-in through:
- Explicit `/elevated on|ask|full` directives per session
- Setting `elevatedDefault` in agent config
- Inline `/elevated` directives per message
Changes are applied consistently across:
- Main directive resolution logic (`get-reply-directives.ts:356`)
- Chat bash command handler (`bash-command.ts:345`)
- E2E test expectations updated to reflect new default
The logic is correct and well-tested. The change makes elevated mode behavior more explicit and prevents unexpected approval gate timeouts.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk - it fixes a problematic default behavior where enabling elevated mode would cause silent timeouts
- The fix is straightforward, logically sound, and addresses a real UX issue. Score is 4 rather than 5 due to the documentation examples not being updated in this PR, which could cause minor confusion for users referencing the docs.
- No files require special attention - the changes are minimal and well-contained
<sub>Last reviewed commit: cf6fe4f</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19684: fix: change elevatedDefault fallback from 'on' to 'off'
by neipor · 2026-02-18
94.7%
#18193: fix: default elevatedDefault to 'off' instead of 'on' (#18177)
by lailoo · 2026-02-16
93.7%
#19595: fix: elevatedDefault should default to off when tools.elevated.enab...
by guirguispierre · 2026-02-18
89.9%
#23752: Auto-reply: enforce per-session TTL elevated exec grants
by bmendonca3 · 2026-02-22
79.3%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
77.1%
#5992: Fix: /status shows correct think level when used with /think (fixes...
by simran122 · 2026-02-01
77.0%
#21661: fix(agents): treat approval timeout as denial regardless of askFall...
by AI-Reviewer-QS · 2026-02-20
77.0%
#20435: fix(exec): prioritize user 'always allow' config over tool defaults...
by ChisomUma · 2026-02-18
76.5%
#19412: fix(status): prefer configured contextTokens over session entry
by rafaelipuente · 2026-02-17
75.0%
#10998: fix(agents): pass session thinking/reasoning levels to session_stat...
by wony2 · 2026-02-07
74.9%