Summary
The end-of-turn tool-error warning (⚠️ 🛠️ \ (agent)` failed) fires for **normal/benign non-zero exits from the Codex app-server's exec_commandtool**, even though the equivalent nativeexec/bash` tool is intentionally silenced in the same situation.
Root cause: resolveToolErrorWarningPolicy suppresses the warning for exec-like tools via
if (isExecLikeToolName(toolName) && !includeDetails) return { showWarning: false, includeDetails };
but isExecLikeToolName checks against a hardcoded set that does not include the Codex app-server tool name:
// src/agents/tool-error-summary.ts
const EXEC_LIKE_TOOL_NAMES = new Set(["exec", "bash"]);
The Codex app-server surfaces its shell tool as exec_command (confirmed in rollout transcripts: function_call name="exec_command"), so it falls through the exec-silencer to the default branch and shows a "failed" warning for any non-zero exit — including a grep/test/diff no-match used as a verification step, which is normal shell usage, not a tool failure.
Notably, the codebase already knows exec_command is the Codex equivalent of exec:
// src/agents/harness/native-hook-relay.ts
const NATIVE_HOOK_TOOL_NAME_ALIASES = { exec_command: "exec" };
…but that alias is only applied in the native-hook-relay path, not before the warning gate. If the alias were honored in resolveToolErrorWarningPolicy (or exec_command added to EXEC_LIKE_TOOL_NAMES), the warning would be correctly suppressed for benign exits, matching native exec/bash behavior.
This is the same class of bug as #89837 (tools.exec.pathPrepend not applied to the Codex app-server's exec_command): an exec-targeted feature that isn't applied to Codex's exec_command.
Affected versions
Confirmed present in 2026.5.20 and in latest stable 2026.6.6 (the relevant code is byte-identical between them).
Repro
- Run an agent on the
openai-codex backend (Codex app-server).
- In a single turn, run a shell command that exits non-zero as normal usage — e.g. a verification step like
grep -E 'SOME LABEL' /tmp/out.txt that finds no match (exit 1), or script > /tmp/out.txt && grep ... /tmp/out.txt where the grep target is absent.
- The turn completes normally, but the channel shows
⚠️ 🛠️ \ (agent)` failed`.
- The same workload using the native
exec/bash tool (non-Codex backend) does not produce the warning, because isExecLikeToolName matches and showWarning is false.
Expected
Benign non-zero exits from exec_command should be treated like exec/bash — no ⚠️ … failed warning on a normal turn (includeDetails false). Real tool failures (e.g. command-not-found 126/127, timeouts) should still warn, exactly as they do for exec/bash.
Suggested fix
Either:
- add
"exec_command" to EXEC_LIKE_TOOL_NAMES in src/agents/tool-error-summary.ts, or
- normalize the tool name through
NATIVE_HOOK_TOOL_NAME_ALIASES before resolveToolErrorWarningPolicy (src/agents/pi-embedded-runner/run/payloads.ts) so the existing alias is honored consistently across paths.
Pointers
src/agents/tool-error-summary.ts — EXEC_LIKE_TOOL_NAMES, isExecLikeToolName
src/agents/pi-embedded-runner/run/payloads.ts — resolveToolErrorWarningPolicy (the isExecLikeToolName(...) && !includeDetails branch)
src/agents/harness/native-hook-relay.ts — NATIVE_HOOK_TOOL_NAME_ALIASES = { exec_command: "exec" }
Summary
The end-of-turn tool-error warning (
⚠️ 🛠️ \(agent)` failed) fires for **normal/benign non-zero exits from the Codex app-server'sexec_commandtool**, even though the equivalent nativeexec/bash` tool is intentionally silenced in the same situation.Root cause:
resolveToolErrorWarningPolicysuppresses the warning for exec-like tools viabut
isExecLikeToolNamechecks against a hardcoded set that does not include the Codex app-server tool name:The Codex app-server surfaces its shell tool as
exec_command(confirmed in rollout transcripts:function_call name="exec_command"), so it falls through the exec-silencer to the default branch and shows a "failed" warning for any non-zero exit — including agrep/test/diffno-match used as a verification step, which is normal shell usage, not a tool failure.Notably, the codebase already knows
exec_commandis the Codex equivalent ofexec:…but that alias is only applied in the native-hook-relay path, not before the warning gate. If the alias were honored in
resolveToolErrorWarningPolicy(orexec_commandadded toEXEC_LIKE_TOOL_NAMES), the warning would be correctly suppressed for benign exits, matching nativeexec/bashbehavior.This is the same class of bug as #89837 (
tools.exec.pathPrependnot applied to the Codex app-server'sexec_command): anexec-targeted feature that isn't applied to Codex'sexec_command.Affected versions
Confirmed present in
2026.5.20and in latest stable2026.6.6(the relevant code is byte-identical between them).Repro
openai-codexbackend (Codex app-server).grep -E 'SOME LABEL' /tmp/out.txtthat finds no match (exit 1), orscript > /tmp/out.txt && grep ... /tmp/out.txtwhere the grep target is absent.⚠️ 🛠️ \(agent)` failed`.exec/bashtool (non-Codex backend) does not produce the warning, becauseisExecLikeToolNamematches andshowWarningis false.Expected
Benign non-zero exits from
exec_commandshould be treated likeexec/bash— no⚠️ … failedwarning on a normal turn (includeDetailsfalse). Real tool failures (e.g. command-not-found 126/127, timeouts) should still warn, exactly as they do forexec/bash.Suggested fix
Either:
"exec_command"toEXEC_LIKE_TOOL_NAMESinsrc/agents/tool-error-summary.ts, orNATIVE_HOOK_TOOL_NAME_ALIASESbeforeresolveToolErrorWarningPolicy(src/agents/pi-embedded-runner/run/payloads.ts) so the existing alias is honored consistently across paths.Pointers
src/agents/tool-error-summary.ts—EXEC_LIKE_TOOL_NAMES,isExecLikeToolNamesrc/agents/pi-embedded-runner/run/payloads.ts—resolveToolErrorWarningPolicy(theisExecLikeToolName(...) && !includeDetailsbranch)src/agents/harness/native-hook-relay.ts—NATIVE_HOOK_TOOL_NAME_ALIASES = { exec_command: "exec" }