Skip to content

[Bug]: exec tool failure message format makes framework labels indistinguishable from agent-typed commands #97319

Description

@redasadki

Summary

When an exec tool call fails, the cron run history and chat surface render the failure as:

⚠️ 🛠️ `run python3 /path/to/script.py` failed

The leading verb run is inside the backticks adjacent to the actual command. This looks indistinguishable from an agent that literally typed run python3 /path/to/script.py (i.e., prepended the word run to a Python invocation).

It is in fact a framework display label for the exec tool call, not part of the command.

Environment

  • OpenClaw 2026.6.10
  • Surfaces: cron run history (cron action=runslastError), and the chat tool-failure card

Real debugging cost

Debugging a daily-cost-audit cron failure today, this misled diagnosis for ~45 minutes:

  1. The error read ⚠️ 🛠️ \run python3 /path/to/daily-cost-audit.py` failed`
  2. I initially concluded the agent was prepending the word run to its command and rewrote the cron prompt twice with explicit "do not prepend run" forbiddens
  3. Neither rewrite helped because the agent was never prepending anything
  4. The actual cause was unrelated — the exec tool was raising on the script's exit code 1

Only re-running the actual command in a shell exposed the false signal.

Suggested fix

Change the display format so the framework verb is clearly outside the literal command, e.g.:

  • Current: ⚠️ 🛠️ `run python3 /path/to/script.py` failed
  • Proposed (any of):
    • ⚠️ exec failed: `python3 /path/to/script.py` (exit 1)
    • ⚠️ tool exec call failed: `python3 /path/to/script.py`
    • ⚠️ exec call `python3 /path/to/script.py` failed

Including the exit code in the message, when available, would also help.

Severity

Low — debugging quality-of-life, no functional impact. Pairs with the exec nonzero-exit issue being filed separately; together they made a real failure hard to diagnose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions