Skip to content

Tool-error warning (⚠️ … failed) not suppressed for Codex app-server exec_command (EXEC_LIKE_TOOL_NAMES misses it despite NATIVE_HOOK_TOOL_NAME_ALIASES) #93482

Description

@willfivestar

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

  1. Run an agent on the openai-codex backend (Codex app-server).
  2. 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.
  3. The turn completes normally, but the channel shows ⚠️ 🛠️ \ (agent)` failed`.
  4. 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.tsEXEC_LIKE_TOOL_NAMES, isExecLikeToolName
  • src/agents/pi-embedded-runner/run/payloads.tsresolveToolErrorWarningPolicy (the isExecLikeToolName(...) && !includeDetails branch)
  • src/agents/harness/native-hook-relay.tsNATIVE_HOOK_TOOL_NAME_ALIASES = { exec_command: "exec" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions