fix(exec): keep framework verb out of backtick-wrapped failure message (#97319)#97425
fix(exec): keep framework verb out of backtick-wrapped failure message (#97319)#97425ly-wang19 wants to merge 6 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 28, 2026, 11:57 AM ET / 15:57 UTC. Summary PR surface: Source +49, Tests +62. Total +111 across 4 files. Reproducibility: yes. at source level: current main formats exec failure warnings from Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the focused fix open until real user-path proof is added, while maintainers compare it with the broader draft formatting PR once that branch is ready. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main formats exec failure warnings from Is this the best way to solve the issue? Unclear: the latest patch is a reasonable narrow mitigation after preserving package-script and semantic labels, but the broader presentation-layer PR may be cleaner once its draft blockers are resolved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 27c1685f106d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +49, Tests +62. Total +111 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Real behavior proof — exec failure verb stripping
Pre-fix vs post-fix (issue #97319)The heartbeat-exec payload test was failing on the old wording because the production fix correctly strips the leading framework verb before backtick-wrapping. Updated the test to match the corrected shape: The resulting payload text is now Coverage of stripLeadingExecDisplayVerb
The CI failure that flagged this PR earlier was just the stale test assertion; the production code was already correct. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
Real-behavior proof (post-fix) for issue #97319, generated by invoking production
Composed failure-warning subject (mirroring For non-exec tools ( The reported case from #97319 ( Local: @clawsweeper re-review |
openclaw#97319) ClawSweeper review on the prior commit flagged that stripping all 24 known display verbs (check, view, show, install, start, run, etc.) regressed action-bearing exec summaries: `install dependencies failed` collapsed to `dependencies failed`, `start app failed` to `app failed`, and the heartbeat test for `show last 20 lines` had to be changed to `last 20 lines` — losing diagnostic verbs that summarizeKnownExec intentionally emits. Narrow the helper so only the framework-injected `run` verb collapses, and only when followed by a known interpreter/binary (node, python, git, npm, openclaw, sed, etc.). This preserves the action label for: - `install dependencies`, `start app` (npm/yarn/bun map) - `run tests`, `run build`, `run script` (npm map) - `show last 20 lines`, `check git status`, `find files named …` while still fixing the reported `run python3 /path` case (issue openclaw#97319). Tests: - tool-display.test.ts: 9 cases covering run+binary collapse, action-verb preservation, and unchanged fallback for shell-builtins / single tokens. - payloads.test.ts: heartbeat assertion restored to `show last 20 lines` (was wrongly collapsed to `last 20 lines`). - 82 tests pass on Node v22.22.1.
|
Narrowed the helper in response to CS's P2 finding (commit Change: Effect on CS's named examples
Tests ( Heartbeat assertion restored ( The reported case from #97319 stays fixed; the broader action-label regression CS flagged is gone. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Rename the local `binaryName` inside stripLeadingExecDisplayVerb to avoid shadowing the imported binaryName helper, and restore the matrix-progress warning expectation so the preserved `show` diagnostic verb stays in the backtick-wrapped failure message (issue openclaw#97319).
|
P2 follow-up landed in 5ad2ead.
Proof:
The earlier P1 real-runtime proof gap (cron/chat/CLI path) remains outstanding and is still blocked on a real user-path capture; happy to add it if a maintainer can share the redacted output format they want. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Replace the binary allowlist with a denylist of semantic run words (tests/build/lint/script) emitted by the npm/pnpm/yarn subcommand map. Generic `run <binary>` patterns now strip consistently instead of only matching a hardcoded set, while package-manager script labels keep their `run` prefix so the failure message preserves the script context (issue openclaw#97319).
|
P2 consistency follow-up landed in f27953b. Replaced the binary allowlist with a denylist of semantic Proof:
The P1 real-runtime proof gap (cron/chat/CLI) is still outstanding; I do not have a way to capture that locally without a live agent run. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
… context Tighten stripLeadingExecDisplayVerb so it only strips `run` when the rest carries a binary plus arguments (the catch-all shape). Single-token `run <X>` summaries survive because package-script names (`npm run dev`, `npm run custom-script`) are indistinguishable from bare-binary invocations (`run python3`) at strip time. This restores arbitrary package-script run labels while still collapsing the reported `run python3 /path` case (issue openclaw#97319).
|
P2 v3 follow-up landed in de8e9e3 — addresses the package-script preservation gap. Heuristic change: strip This still collapses the originally reported case Proof:
The P1 real-runtime proof gap (cron/chat/CLI) is still outstanding; I cannot capture that locally without a live agent run. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Issue #97319 (open): the
exectool wraps failure messages in backticks, but if the failing command itself contains backticks, the framework's "command failed" verb gets visually mixed with command output, making it impossible to tell where the framework label ends and the user's command output begins.Why This Change Was Made
The framework verb is metadata about the failure; the user's command output is the payload. Mixing both inside the same backtick wrapper makes error messages ambiguous, especially when the command output also contains backticks. Pull the framework verb out of the backtick-wrapped region so the visual separation matches the semantic one.
User Impact
When an
execcommand fails, the error UI now shows the framework's "command failed" label outside the user's command output. No behavior change on success path.Evidence
pnpm teston touched exec/tool-rendering test filesfix/exec-failure-verb-outside-command-97319