Skip to content

fix(cli): report exact Claude stream failures - #127169

Merged
obviyus merged 1 commit into
openclaw:mainfrom
Marvinthebored:codex/p4-cli-output
Aug 22, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
Marvinthebored:codex/p4-cli-output

Conversation

@Marvinthebored

@Marvinthebored Marvinthebored commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127168

What Problem This Solves

Root cause

Managed Claude live turns asked the shared JSONL parser only whether it had failed, then replaced the parser-owned bounded diagnostic with Claude CLI turn output exceeded limit. This erased the actual raw-character, line-count, single-line, or backend-parser failure. The non-live CLI path already preserved getErrorText().

Fix

The live-turn boundary now propagates the parser's exact bounded error text while preserving the existing format failover classification and safety limits. The separate live stdout framer uses the parser's canonical output-limit formatter, so it cannot drift from parser diagnostics.

Owner-boundary regressions cover raw-character, line-count, single-line, media-padding, and backend-parser failures. No limits, fallback behavior, configuration, or public API changed.

Production delta: +12/-4 (net +8). Tests: +25/-4 (net +21). The production growth is the smallest coherent shape: one exported canonical formatter plus propagation of the already-owned parser value across the live-turn boundary.

Evidence

Exact-head proof

Head: 53ddfac3b65852886c101f5756ceb0bf5f01449a

  • Current main live Telegram reproduction: generic Claude CLI turn output exceeded limit. diagnostic; provider requests: 0.
  • Focused owner-prefix Vitest: 14 files, 229 tests passed.
  • oxfmt --check: passed for all 3 changed files.
  • Targeted Oxlint: passed for all 3 changed files.
  • pnpm tsgo: passed.
  • pnpm check:test-types: passed.
  • Local ClawSweeper exact-head review: patch correct; 0 findings; security cleared; no maintainer decision; 0 Rank-up moves.
  • Final real-user Telegram DM through the managed Claude live stdio fixture: exact CLI JSONL output exceeded 20000 lines; refusing to parse output. in the run-scoped Gateway log; Telegram returned the safe retry reply; 2 typing events + 1 SUT message recorded; provider requests: 0.
  • Hosted exact-head CI: openclaw/ci-gate passed; all required checks successful.

AI-assisted by Codex (OpenAI). Investigation context and sanitized production evidence are recorded in #127168.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Aug 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 9:27 PM ET / August 22, 2026, 01:27 UTC.

ClawSweeper review

What this changes

The PR makes managed Claude CLI live turns retain the streaming JSONL parser’s exact bounded failure message instead of replacing it with a generic output-limit error.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: the patch is a focused, correct repair for a current-main diagnostic-loss bug, with no blocking findings. Exact-head required checks are still running after the latest force-push.

Priority: P2
Reviewed head: 53ddfac3b65852886c101f5756ceb0bf5f01449a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real behavior evidence and focused boundary coverage support a clean, narrow fix.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies an after-fix managed-Claude live run that observed the parser-owned line-limit diagnostic.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies an after-fix managed-Claude live run that observed the parser-owned line-limit diagnostic.
Evidence reviewed 7 items Current-main defect: Current main still checks only whether the parser has an error, then replaces its value with the generic message; the reported behavior therefore remains unfixed on main.
Parser-owned diagnostics: The shared parser already records distinct bounded text for raw-character, line-count, single-line, and backend-parser failures; the patch forwards that existing value rather than changing limits or classification.
Correct live boundary: The patched live path obtains getErrorText once and passes it into the existing format FailoverError construction; its separate outer framing guard reuses the same canonical formatter.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

pnpm openclaw --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127169-6m8hCP/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 106.91 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.2s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4312ms (slowest: built plugin control-plane loads 3582ms)

OpenClaw 2026.8.1 (53ddfac) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console
… output truncated …

Assertions:

  • PASS expect_output: Usage:

How this fits together

Managed Claude live turns frame Claude CLI JSONL output, parse records, and send any failure through the live-turn error boundary. That boundary supplies the diagnostic shown to operators after the turn aborts.

flowchart LR
  A[Claude CLI JSONL output] --> B[Output framing]
  B --> C[Streaming parser]
  C --> D{Parser failure?}
  D -->|No| E[Continue live turn]
  D -->|Yes| F[Live-turn error boundary]
  F --> G[Operator diagnostic]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head required checks remain queued after the latest force-push, so merge readiness is not yet established.
  • Resolve merge risk (P1) - Production code is +8 net lines; this is the smallest identified shape because the live outer framing guard and parser need one canonical formatter rather than duplicated error text.
Agent review details

Security

None.

PR surface

Source +8, Tests +21. Total +29 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 4 +8
Tests 1 25 4 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 37 8 +29

Review metrics

Metric Value Why it matters
Production versus test LOC production +12/-4 (net +8); tests +25/-4 (net +21) The small production increase forwards the existing parser diagnostic and shares its formatter; the larger test change covers each live failure boundary.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127168
Summary: This PR is the focused candidate repair for the linked diagnostic-loss report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one shared formatter and propagate the parser-owned value at the live boundary, then merge once the current head’s required checks are green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one shared formatter and propagate the parser-owned value at the live boundary, then merge once the current head’s required checks are green.

Do we have a high-confidence way to reproduce the issue?

Yes — source establishes a focused current-main path: the parser records a specific error while the live boundary discards it at src/agents/cli-runner/claude-live-turn.ts:363.

Is this the best way to solve the issue?

Yes — forwarding the parser-owned bounded text at the sole live boundary aligns it with the non-live CLI path while preserving the existing format classification and safety limits.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 249e1bfb004b.

Labels

Label justifications:

  • P2: This corrects misleading diagnostics for failed managed Claude CLI turns without altering the underlying safety caps or turn behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies an after-fix managed-Claude live run that observed the parser-owned line-limit diagnostic.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix managed-Claude live run that observed the parser-owned line-limit diagnostic.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame covers the generic error boundary, and history includes the CLI spawn/live failure-policy refactor. (role: recent live-runner contributor; confidence: medium; commits: b3369840b1f0; files: src/agents/cli-runner/claude-live-turn.ts, src/agents/cli-output-stream.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the required checks complete on the exact current head before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-21T11:38:59.239Z sha c4e19b840603e4638805a0b292d6a434084a3f24 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-21T14:48:48.061Z sha c4e19b840603e4638805a0b292d6a434084a3f24 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T00:55:17.774Z sha 39404d7c66f6c998b08c6263d2309f266a7e2cbe :: needs maintainer review before merge. :: none

@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review: real managed-Claude proof is now included in the PR evidence. The isolated dev run returned the exact parser-owned line-limit diagnostic; the temporary lowered boundary is not part of the patch.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 22, 2026
@obviyus
obviyus merged commit 575146a into openclaw:main Aug 22, 2026
266 of 268 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
Preserve parser-owned bounded diagnostics in managed Claude live turns and share the canonical output-limit formatter.

Co-authored-by: Marvinthebored <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude live parser errors are mislabeled as output-limit failures

3 participants