fix(agents): remove misleading run prefix from exec display for interpreter commands (fixes #97319)#97326
Conversation
…preter commands (openclaw#97319) For interpreter binaries (python3, node, ruby, php), the exec tool display summary showed "run python3 /path/to/script.py" which looks indistinguishable from the agent prepending "run" to the command. Drop the "run" prefix so the display shows the actual command as-is.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR is superseded by the proof-positive shared failure-warning fix in #97511. This branch targets the same linked bug, still lacks real user-path proof, and its broad run-prefix stripper can degrade semantic exec summaries if merged as-is. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #97511, or an equivalent maintainer-approved shared payload-warning formatter, as the landing path for the linked bug. So I’m closing this here and keeping the remaining discussion on #97511. Review detailsBest possible solution: Use #97511, or an equivalent maintainer-approved shared payload-warning formatter, as the landing path for the linked bug. Do we have a high-confidence way to reproduce the issue? Yes. Current main still formats exec failure warnings as Is this the best way to solve the issue? No. The shared formatter in #97511 is the better fix because it separates the failure label from the command subject at the common payload-warning boundary without broadly stripping display metadata. Security review: Security review cleared: The diff only changes TypeScript presentation formatting and tests; it does not touch dependencies, workflows, permissions, secrets, install scripts, or package metadata. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 245c18da5a6c. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
I did a source-level pass on the remaining scope here. The patch fixes the narrow interpreter-summary path in That makes the maintainer decision mostly about scope. If this PR is intended as the narrow |
…n summaries (openclaw#97319) For exec/bash tool failures, the warning text embeds the exec display summary inside backticks before appending "failed". When the summary is a framework-injected "run <binary> <args>" pattern (e.g. "run python3 /path/to/script.py"), the leading "run" appears as if the agent typed it. Add stripLeadingExecDisplayVerb that collapses "run <bin> <args>" to "<bin> <args>" while preserving single-token map labels ("run tests", "run build") and non-run action verbs ("install dependencies", "show last 20 lines"). This complements the interpreter-summary fix in summarizeKnownExec by catching all exec/bash failure paths at the warning-rendering layer.
Enhancement: strip
|
| Before | After |
|---|---|
run verb) |
CI
136 checks passed. The single failure (checks-node-compact-large-whole-1) is an unrelated flaky session-lock test (attempt.session-lock.test.ts:3987), not related to this change.
@clawsweeper re-review
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Fixes #97319.
When an exec tool call fails, the cron run history and chat surface render the failure with a leading "run" that is a framework display label, not part of the command. This makes it look like the agent prepended "run" to the actual command.
Root Cause
summarizeKnownExec generates display summaries. For interpreter binaries (python3, node, ruby, php), it prepended "run" to the canonical bin+script form, producing e.g. "run python3 /path/to/script.py".
Changes Made
Evidence
AI Assistance