fix: keep heredoc bodies out of exec summaries#99379
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 2:06 AM ET / 06:06 UTC. Summary PR surface: Source +111, Tests +55. Total +166 across 3 files. Reproducibility: yes. Current main source shows heredoc bodies can reach splitTopLevelStages(cleaned) before any heredoc-aware compaction, so body 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. Mantis proof suggestion Next step before merge
Security Review detailsBest possible solution: Land this focused display-parser fix after normal required merge gates stay green so the linked heredoc summary bug closes through the PR. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows heredoc bodies can reach splitTopLevelStages(cleaned) before any heredoc-aware compaction, so body Is this the best way to solve the issue? Yes. The best fix is in the shared exec display summarizer before stage splitting, while channel rendering and Codex command/status mapping continue using their existing contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0bf66ab7bdbf. Label changesLabel justifications:
Evidence reviewedPR surface: Source +111, Tests +55. Total +166 across 3 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
|
|
@clawsweeper re-review Updated the Evidence section with exact redacted terminal command output for the exec-summary display path. It shows heredoc body fragments no longer render as command stages and a real post-terminator npm test stage remains visible. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
7e81f15
into
openclaw:main
Closes #99367
What Problem This Solves
Fixes an issue where users watching exec/tool progress would see heredoc body contents reported as extra command stages when the heredoc text contained shell-like separators or generated YAML/JavaScript. A single inline script could be displayed as a chain such as
run python3 inline script (heredoc) -> run if -> run console.log(b) -> show <<YAML, which made generated file contents look like commands that actually ran.Why This Change Was Made
The exec display summarizer now removes heredoc bodies before top-level stage splitting while keeping the heredoc launcher and any real command stages that appear after the heredoc terminator. The parser reuses the existing top-level shell scanner and applies shell quote removal to heredoc delimiter words so quoted and backslash-quoted delimiters do not hide later commands.
User Impact
Operators get quieter and more accurate tool-progress summaries for inline scripts and file-generation commands. Heredoc body text no longer appears as executed shell stages, while real commands after the heredoc terminator remain visible.
Evidence
Before the fix, the current display path summarized heredoc body fragments as commands:
After the fix, the same display path omits body-only fragments and still preserves a real post-heredoc command:
Real exec-summary path proof from a local terminal, using the same
resolveToolDisplay+formatToolDetailpath that channel progress uses throughsrc/channels/streaming.ts:Output:
The heredoc body intentionally includes
&&, a nestedcat <<YAML, and generated YAML-like content. Those body fragments no longer appear as command stages, while the realnpm testafter thePYterminator remains visible.Actual channel progress draft proof, using the exported progress-line path from
src/channels/streaming.ts:Output:
Focused validation:
Live/local behavior proof:
Dependency/source contract checked:
Codex app-server exposes raw
command,cwd, andstatusfor command execution items, and OpenClaw maps Codexdeclinedcommand status separately from this display summary path, so this PR keeps the fix in OpenClaw exec display formatting.Local autoreview:
AI-assisted: implementation and validation were prepared with AI assistance; proof was run locally.