← Back to PRs

#18708: feat(messages): add suppressToolErrorWarnings config option

by codexGW open 2026-02-17 00:20 View on GitHub →
agents stale size: XS
## Problem When `messages.suppressToolErrors: true` is configured, non-mutating tool errors are correctly suppressed. However, **mutating tool errors** (`exec`, `write`, `message`, `sessions_send`, etc.) always bypass this setting and emit `⚠️` warnings to the chat channel — even when the agent already handled the error and retried successfully. This is noisy for end users who see raw error output like: ``` ⚠️ 🛠️ Exec: grep pattern file failed: Command exited with code 1 ``` ...for errors the agent already recovered from in the next turn. Closes #18630 ## Solution Add `messages.suppressToolErrorWarnings: true` config option that suppresses **all** tool-error warnings, including mutating tools. The internal `suppressToolErrorWarnings` parameter already existed in the runner pipeline — it was used by heartbeat sessions via `agents.defaults.heartbeat.suppressToolErrorWarnings`. This PR exposes it as a top-level messages config option so regular sessions benefit too. ## Changes 5 files, +15/-7 lines: 1. **Config type** (`types.messages.ts`): Add `suppressToolErrorWarnings?: boolean` 2. **Zod schema** (`zod-schema.session.ts`): Add validation 3. **Labels + help** (`schema.labels.ts`, `schema.help.ts`): Add UI label and description 4. **Payloads** (`payloads.ts`): Fall back to config value when param is not explicitly set by caller ## Backwards compatible - Default is `false` — no behavior change unless explicitly enabled - Existing `messages.suppressToolErrors` behavior is unchanged - `suppressToolErrorWarnings` overrides and suppresses all warnings when enabled <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR exposes an existing internal parameter `suppressToolErrorWarnings` as a user-configurable option under `messages.suppressToolErrorWarnings`. When enabled, it suppresses all tool-error warnings (including mutating tools like `exec`, `write`, `message`) that are shown to end users, allowing agents to handle errors gracefully without noisy `⚠️` warnings appearing in the chat. The implementation adds: - Config type definition in `types.messages.ts` with clear documentation - Zod schema validation in `zod-schema.session.ts` - UI labels and help text in `schema.labels.ts` and `schema.help.ts` - Fallback logic in `payloads.ts` that uses the config value when the parameter isn't explicitly set The change is backwards compatible (default: `false`) and properly integrated with the existing `messages.suppressToolErrors` option, which only suppresses non-mutating tool errors. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is straightforward, well-tested, and follows existing patterns. It exposes an internal parameter that was already being used by heartbeat sessions, extends it to regular sessions via config fallback, includes proper type definitions, validation, documentation, and test coverage. The changes are minimal (5 files, +15/-7 lines), backwards compatible, and the logic correctly implements the nullish coalescing operator to fall back from explicit parameter to config value. - No files require special attention <sub>Last reviewed commit: 3d110d8</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs