Repository navigation
fix: preserve diagnostics for large command output - #141353
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:38 PM ET / 16:38 UTC. ClawSweeper reviewWhat this changesThe PR sanitizes only the retained diagnostic lines so large command output can report its original failure without crashing during formatting. Merge readiness✅ Ready for maintainer review The fix remains useful: current main and v2026.9.2 retain the failing whole-output replacement. The narrow patch preserves the existing diagnostic contract, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's command-error formatter turns captured process output and termination metadata into bounded diagnostics. Git operations, worktree setup, and other command callers use those diagnostics in errors and logs. flowchart TD
A[Command output and exit status] --> B[Normalize terminal escapes and redraws]
B --> C[Select last 12 lines]
C --> D[Sanitize displayed lines]
D --> E[Apply character budget and omission marker]
E --> F[Command errors and logs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0. Total 0 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep diagnostic formatting in the shared owner, sanitizing retained lines while preserving existing termination details and output budgets. Do we have a high-confidence way to reproduce the issue? A concrete reproduction path exists in the real 17 MiB Git-blob test, and the author reports failure under the original CI ordering. That order-dependent failure was not independently rerun during this read-only review. Is this the best way to solve the issue? Yes. Selecting the retained lines before sanitization removes the reported failing operation without adding a competing formatter or changing command execution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fe2f796e95e8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: large command output preserves its intended bounded diagnostic instead of crashing during error formatting. |
Preserve bounded, terminal-safe command diagnostics when captured output exceeds its limit.
What Problem This Solves
Formatting large command output can throw
RangeError: Maximum call stack size exceeded, hiding the original output-limit error. The existing worktree Git integration test reproduces this on current main after its normal CI file ordering with a real 17 MiB Git blob.Why This Change Was Made
Split normalized output into lines before sanitizing the retained 12-line tail. This removes the failing whole-output replacement while preserving carriage-return redraw handling, terminal safety, character limits, surrogate-safe slicing, and omission markers.
User Impact
Commands that exceed their output limit report the intended bounded diagnostic instead of failing inside error formatting.
Evidence
d234f9d4d09273615508d34bb1b098e803630165; captured the original stack informatCommandOutput.corepack; equivalent hosted checks cover the remaining applicable gates. The unchanged plugin-media and runtime-sidecar inputs were excluded from unrelated global checks.