Skip to content

[Bug]: Codex native tool statuses surface expected checks as channel-visible OpenClaw failures #88332

Closed

Description

@shbernal

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Codex-native command/read/search status projection can turn expected negative checks and internal probe failures into channel-visible OpenClaw failed messages. The visible reports are channel-specific, but the likely ownership boundary is the Codex/OpenClaw integration path that converts native Codex item status into lastToolError and then into user-facing warning payloads.

Steps to reproduce

Evidence-backed paths:

  1. In [Bug]: Telegram shows internal "⚠️ 🛠️ ... failed" for normal grep exit(1) after upgrade to 2026.5.20 #87610, run OpenClaw 2026.5.20 with the Codex runtime through Telegram.
  2. Let the agent execute a shell search pipeline where grep exits 1 because no rows matched.
  3. Observe Telegram receive a visible ⚠️ ... failed banner even though the no-match result was the expected negative check.
  4. In [Bug]: 2026.5.19 Discord shows failed file reads in chat #85310, run the Codex runtime through Discord scheduled/group delivery and let the agent attempt an internal file read for a missing per-run memory or skill file.
  5. Observe Discord receive a visible ⚠️ ... print lines ... failed message.

Current-source path to inspect:

  1. extensions/codex/src/app-server/event-projector.ts:1058 maps non-success Codex-native result status to isError.
  2. extensions/codex/src/app-server/event-projector.ts:1098 records that native failure as lastNativeToolError.
  3. extensions/codex/src/app-server/event-projector.ts:1985 treats every native commandExecution as a mutating tool item.
  4. src/agents/embedded-agent-runner/run/payloads.ts:517 formats lastToolError as a channel-visible ⚠️ ... failed warning.

Expected behavior

The Codex/OpenClaw integration should distinguish real user-action failures from expected negative checks and internal agent probes before producing channel-visible failure warnings.

Expected-negative checks such as search-no-match should be allowed to produce a normal result without an alarming failure banner. Internal agent probes that miss optional workspace files should remain internal diagnostics unless the assistant deliberately reports them or the failure blocks the requested user action.

This should be channel-agnostic. Telegram and Discord may need output-suppression safeguards, but they should not be the primary owners of Codex-native tool status semantics.

Actual behavior

Prior reports show channel-visible ⚠️ ... failed messages for Codex-backed operations that are not necessarily user-action failures:

Current source suggests the shared path is Codex-native event projection plus OpenClaw warning payload construction, not Telegram alone.

OpenClaw version

Observed reports: 2026.5.19, 2026.5.20, and adjacent Telegram internal-message evidence on 2026.5.26. Current source reviewed on main at b13fb788b53 on 2026-05-30.

Operating system

Observed reports include macOS and Ubuntu. The suspected source path is OS-independent.

Install method

Observed reports include npm global and source checkout.

Model

openai/gpt-5.5 / gpt-5.5 with the Codex runtime.

Provider / routing chain

OpenClaw -> @openclaw/codex -> external channel delivery, including Telegram and Discord reports.

Additional provider/model setup details

This issue intentionally reframes the visible channel reports as a shared Codex/OpenClaw integration problem. The channel issues should remain useful repro anchors, but the product decision should likely happen at the native tool-status boundary:

  • Which Codex-native outcomes should become lastToolError?
  • Which native command outcomes are mutating or user-action failures?
  • When should src/agents/embedded-agent-runner/run/payloads.ts add a fallback ⚠️ ... failed warning?
  • Should this align with OpenClaw's own tool semantics, where src/agents/sessions/tools/grep.ts:353 treats no matches as a successful No matches found result and src/agents/bash-tools.exec-runtime.ts:546 treats normal non-shell nonzero exits as completed with an exit-code note?

Logs, screenshots, and evidence

Related issues:

Current source refs:

  • extensions/codex/src/app-server/event-projector.ts:1058
  • extensions/codex/src/app-server/event-projector.ts:1098
  • extensions/codex/src/app-server/event-projector.ts:1985
  • src/agents/embedded-agent-runner/run/payloads.ts:517
  • src/agents/sessions/tools/grep.ts:353
  • src/agents/bash-tools.exec-runtime.ts:546

Impact and severity

Affected: users on external messaging channels when the Codex runtime produces native tool statuses that OpenClaw turns into visible warnings.

Severity: Medium UX regression, with possible information-exposure risk when internal file/probe details are shown in shared channels.

Frequency: Reproducible for the grep/no-match shape in #87610; observed across multiple missing-read examples in #85310.

Consequence: Users see false or overly alarming failure messages, routine negative checks look broken, and internal agent activity can leak into chat surfaces.

Additional information

This should not be solved as a grep-string special case or a Telegram-only sanitizer. The likely durable fix is a small, explicit Codex-native status mapping policy plus fallback-warning policy tests, with channel tests only proving that external delivery no longer leaks the misclassified internal/expected outcomes.

Activity

  1. clawsweeper commented on May 30, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 2, 2026, 8:11 AM ET / 12:11 UTC.

    Summary
    Keep open for targeted maintainer follow-up. Current main has a shared policy that suppresses Codex exec-like failure warnings when a normal user-facing reply exists, but the reported intermittent final-reply loss remains unverified on current main and the required sibling Codex protocol checkout is unavailable for a complete contract audit.

    Reproducibility: no. for the full issue: current source proves the shared warning-policy mitigation, but no current-main channel run was available to verify the remaining final-reply-loss report.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Maintainer decision needed

    Question Recommendation
    Should this umbrella remain open solely for a current-main Discord/Telegram reproduction of the claimed final-reply loss, or should that remaining claim be split into a narrower delivery issue after the shared warning-policy fix? Run focused current-main channel proof: Reproduce a Codex native command failure followed by a final reply and keep this issue only if the final reply is still absent or the warning still leaks.

    Why: Current source directly addresses the warning-after-success path, but the report combines it with an intermittent delivery-loss claim that cannot be confirmed from source alone in this environment.

    Next step
    A bounded repair is not safe until an owner confirms whether any current-main behavior remains outside the shared exec-warning policy and provides a focused channel reproduction for final-reply delivery.

    Security
    Needs attention: The report describes possible exposure of internal command and workspace details in shared channels; current-main live verification is still needed to determine whether that exposure remains.

    Review details

    Best possible solution:

    Verify one current-main Codex channel run containing a failed native command plus a final answer; if the final reply is delivered and no extra exec warning appears, close this umbrella and retain any independently reproducible reply-queue defect as a narrower issue.

    Do we have a high-confidence way to reproduce the issue?

    No for the full issue: current source proves the shared warning-policy mitigation, but no current-main channel run was available to verify the remaining final-reply-loss report.

    Is this the best way to solve the issue?

    Unclear: suppressing exec-like warnings after a normal reply is the correct shared owner boundary, but it does not by itself prove that an intermittent reply-dispatch failure is fixed.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The channel-visible false-warning shape appears addressed on current main, but there is no current-main Discord or Telegram proof for the intermittent final-reply-loss claim.
    • The required direct Codex protocol/source audit could not be completed because ../codex is absent and the read-only sandbox cannot clone it.
    • GitHub and gitcrawl lookups were unavailable, so the live state of the linked open channel-specific work could not be rechecked beyond the supplied context.

    Codex review notes: model internal, reasoning high; reviewed against 8206bf1f858c.

    Label changes

    Label changes:

    • remove clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-info: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: Reports describe recurring channel-visible internal failures and an intermittent case where the final reply did not reach Discord.
    • impact:message-loss: The issue includes evidence that a final reply persisted in session history but was absent from the Discord channel.
    • impact:security: Channel-visible failure text can expose internal command summaries and workspace details.
    Evidence reviewed

    Security concerns:

    • [medium] Verify internal command details cannot reach channels — src/agents/embedded-agent-runner/run/payloads.ts:475
      Reported warnings include command summaries and workspace paths; a current-main channel run should confirm that the shared exec-warning policy prevents their delivery after a normal reply.
      Confidence: 0.73

    What I checked:

    • Current Codex projection still records non-success native status: The native-event projector derives isError from a non-success item status before emitting a tool result, so status classification remains in the Codex projection boundary. (extensions/codex/src/app-server/event-projector-events.ts:171, 8206bf1f858c)
    • Current main suppresses exec-like warning after a visible reply: The shared warning policy treats exec-like failures specially: it returns showWarning: !hasUserFacingReply, and documents that Codex command executions are fail-closed for replay metadata rather than display semantics. (src/agents/embedded-agent-runner/run/payloads.ts:470, 8206bf1f858c)
    • History ties the current policy to present main: git blame attributes the exec-like warning branch, including its Codex-specific rationale, to commit a5b8b7052b27fbc9607add5277c5b9d31a92ff7b on August 2, 2026. (src/agents/embedded-agent-runner/run/payloads.ts:475, a5b8b7052b27)
    • Current-main-only provenance: No locally available release tag contains the policy commit; it is present on current main, whose checked-out head is 8206bf1f858cba8125589869ac7e569f3f9c8b68. (src/agents/embedded-agent-runner/run/payloads.ts:475, a5b8b7052b27)
    • Required Codex dependency audit is blocked: Repository policy requires direct inspection of sibling ../codex for Codex-backed verdicts, but that checkout is absent and this read-only environment cannot clone it.
    • Maturity eligibility check: The helper classifies the primary OpenAI/Codex and agent-runtime surfaces as M3 Beta, below the M4/M5 threshold for maturity:stable. (qa/maturity-scores.yaml, 8206bf1f858c)

    Likely related people:

    • Peter Steinberger: Current blame and recent file history connect this person to the exec-warning policy that explicitly handles Codex command executions. (role: recent shared-policy contributor; confidence: high; commits: a5b8b7052b27, a9bbf45d4bb8, deabae48d337; files: src/agents/embedded-agent-runner/run/payloads.ts, extensions/codex/src/app-server/event-projector-items.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.
    on May 30, 2026
  3. davefano commented on Jun 10, 2026

    @davefano
    Contributor

    Fresh 2026.6.5 Discord evidence from Dave/Ratchet fleet, reported 2026-06-09 21:17 EDT in #oc-updates.

    Screenshot shows a normal assistant response about a Linear view, followed by a separate channel-visible warning:

    ⚠️ 🛠️ for state in Backlog Todo "In Progress" "In Review" "QA Rev…th, (map(select(.assignee == null)) | length)] | @tsv'; done (in ~/clawd) failed
    

    This is not the direct-chat leak covered by #89975. It is a Discord channel-visible Codex/shell command status warning, apparently emitted after normal assistant-visible content. It matches this issue’s shared Codex-native status -> lastToolError -> visible fallback-warning path.

    Version context: the fleet machines recently updated to OpenClaw 2026.6.5 and the issue still reproduces there.

  4. davefano commented on Jun 10, 2026

    @davefano
    Contributor

    Additional confirmed 2026.6.5 repro from a private Discord channel.

    Observed sequence:

    • Runtime: OpenClaw 2026.6.5, Discord channel session, OpenAI Codex runtime, model gpt-5.5.
    • Assistant reply delivered normally.
    • A separate visible Discord message was delivered immediately afterward with content shape: ⚠️ 🛠️ <bash command summary> failed.
    • The leaked message had Discord flags 4, same bot author, same channel, no embeds/attachments.

    Matching transcript event:

    • A bash tool result was marked isError: true.
    • Result contained partial useful stdout plus jq parse errors, e.g. status counts followed by jq: parse error: Unfinished string at EOF / Unfinished JSON term at EOF.

    Important behavior: the failed tool did not block the final assistant response. The final response was already posted, then the tool-status failure was promoted to user-visible Discord output as a second message. This looks like command/tool status delivery leaking independently of assistant-message delivery, not a normal assistant-authored error message.

  5. bhattman-dev commented on Jun 12, 2026

    @bhattman-dev

    New evidence: on Discord this is not only a cosmetic banner — the final assistant reply can be lost entirely, with the channel-visible ⚠️ … failed warning being the only thing delivered. This matches the impact:message-loss label more literally than the existing reports.

    Setup: OpenClaw 2026.6.1 (npm global, macOS), Codex app-server runtime, model openai/gpt-5.5, Discord channel session, streaming.mode: "progress".

    Observed sequence (2026-06-12, verified on both ends):

    1. A long turn (~740s) with 33 tool calls and 19 interim assistant (commentary) messages interleaved.
    2. Among the final tool calls was an expected-negative check (rg over one file, exit 1 = no matches) → projected as a failed native commandExecution item — the exact shape this issue describes.
    3. The Codex rollout shows a clean finish: final agent_message followed by task_complete carrying the full answer as last_agent_message.
    4. The OpenClaw session transcript contains the final reply (the whole turn is imported into the session jsonl at turn end), and it renders fine in the Control UI / native app.
    5. The Discord channel received ONLY the ⚠️ 🛠️ search "…" in <file> (agent) failed warning. The final reply was never posted. Verified by the channel owner: the reply is visible in the native app but absent from Discord.
    6. The gateway log shows agent_end success=true and zero Discord delivery errors/warns in the window — i.e. the visible-reply payload appears to never be enqueued for the channel, rather than failing at send time.

    Ruled out locally: model ending the turn early (clean task_complete); run timeout (740s against an 1800s budget, 240s completion-idle never tripped); message-tool source-reply suppression (tool not used in the turn); Discord API send failures (nothing logged).

    Frequency context: across ~2.5 weeks of sessions on this gateway, ~6% of tool results carry isError (mostly benign expected-negative checks and probes of optional files, per this issue), so the warning path is exercised constantly; the full reply-loss variant is intermittent but recurring enough that the user reported it as "happens all the time across all sessions."

    Because the reply survives in canonical session history but never reaches the channel, this looks adjacent to the reply-queue/visible-reply work slated for 2026.6.6 (#91450 "remove drained reply-queue items by identity", #91566 "recover stale main and visible replies") and the Telegram streamed-text fix (#88682). If those are believed to cover this path, a Discord regression test for "turn with interleaved commentary + a failed native item still delivers the final answer" would pin it; if not, this is a distinct Discord dispatch bug co-located with the lastToolError warning path discussed here.

    Happy to provide sanitized rollout/transcript excerpts on request.

  6. removed
    P2Normal backlog priority with limited blast radius.
    on Jun 15, 2026
  7. 15 remaining items

  8. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.
    and removed
    clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    on Jul 29, 2026
  9. obviyus commented on Aug 16, 2026

    @obviyus
    Collaborator

    Retested through a real Telegram user on a post-fix checkout containing #103593. Codex ran an expected-negative grep that exited 1 with the message tool disabled, then delivered the normal final reply. The recorded event stream contained no separate ⚠️ … failed warning.

    Closing as fixed by #103593. Please reopen with a current post-fix reproduction if the warning or final-reply loss recurs. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions