#20209: fix(node): respect tools.exec.notifyOnExit for node exec events
gateway
size: S
experienced-contributor
Cluster:
Tool Execution and Error Handling
## Summary
Fixes #20193
Node exec events (`exec.started`, `exec.finished`, `exec.denied`) were generating system event notifications regardless of the `tools.exec.notifyOnExit` setting. This caused duplicate messages: the inline tool result AND the system event notification.
## Changes
- Check `tools.exec.notifyOnExit` config before generating node exec event notifications
- When `notifyOnExit: false`, skip all node exec event notifications
This makes node exec behavior consistent with gateway exec, which already respects this setting.
---
🤖 Generated with Claude Code
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR fixes #20193 by checking the `tools.exec.notifyOnExit` config setting before generating system event notifications for node exec events (`exec.started`, `exec.finished`, `exec.denied`). Previously, node exec events always emitted system notifications regardless of this setting, causing duplicate messages when the inline tool result was already sufficient.
- The implementation correctly defaults to `true` (via `!== false`), matching the documented default and the existing gateway exec behavior in `bash-tools.exec-runtime.ts`
- `loadConfig()` is cached with a 200ms TTL, so the added call has negligible performance impact
- The change is minimal and well-scoped — a single guard clause in the right location
- No test coverage was added for the `notifyOnExit: false` code path
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it adds a simple, well-placed config guard that matches existing patterns in the codebase.
- The change is minimal (one guard clause), uses the same config-reading pattern found elsewhere in the codebase, and defaults to existing behavior when the setting is unset. The only gap is missing test coverage for the new code path, which is a minor concern for a straightforward boolean check.
- No files require special attention — the change in server-node-events.ts is straightforward and consistent with existing patterns.
<sub>Last reviewed commit: e339071</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22835: feat: add tools.nodes.notifyOnExit config flag
by abbudjoe · 2026-02-21
85.2%
#18415: fix(agents): suppress benign exec exit code 1 from tool error surfa...
by aldoeliacim · 2026-02-16
77.1%
#14395: feat: add gateway.nodes.execEvents config to control exec completio...
by dan3093 · 2026-02-12
76.0%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
75.8%
#18934: fix(agents): suppress exec tool output from channel delivery
by BinHPdev · 2026-02-17
73.9%
#20382: fix: move suppressToolErrors check before mutating tool check
by klawdius-noodle · 2026-02-18
73.7%
#20014: fix(nodes): use formatExecCommand for approval request command text
by openperf · 2026-02-18
73.4%
#22087: Preserve assistant reply when exec fails under suppressToolErrors
by graysurf · 2026-02-20
72.8%
#15996: fix(agents): messages arrive out of order — tool output beats narra...
by yinghaosang · 2026-02-14
72.3%
#19684: fix: change elevatedDefault fallback from 'on' to 'off'
by neipor · 2026-02-18
72.1%