Skip to content

fix(agents): Claude CLI turns hit output limits on discarded stream frames - #185404

Merged
vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
etzelm:fix/cli-stream-json-limit-env
Nov 9, 2026
Merged

vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
etzelm:fix/cli-stream-json-limit-env

Conversation

@etzelm

@etzelm etzelm commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #153545, #184352, #186085, #166127, #159930, #111382

This PR no longer adds environment overrides. The earlier revision restored output-limit tuning that #111382 removed; it is replaced here by an accounting repair inside the existing fixed limits, the direction the first review recommended. No limit, setting or environment variable changes.

What Problem This Solves

Claude stream frames the parser throws away (thinking signatures, empty thinking progress ticks, block and message stops, message deltas) are charged their full raw size against the 8 MiB output budget, and every one counts toward the 20,000-line limit. In long tool-heavy claude-cli turns that framing alone stops the turn with CLI JSONL output exceeded 8388608 characters and loses the final reply. This change charges those frames a fixed allowance. Other record types are charged as before.

User Impact

On the 1,980-step tool loop below, current main stops the turn after step 1,744 and returns no reply; with this change the same loop completes all 1,980 steps and replies DONE. Per tool round the charge drops from about 4,700 to 3,590 characters, so a claude-cli turn fits about 30 percent more tool calls before the unchanged limits apply.

Why This Change Was Made

chargeClaudeStreamJsonLine charges each Claude stream-json line its raw length unless a narrower rule applies: #153545 charges text, thinking and tool-input deltas their payload plus 32 characters (#186085 extended it to frames carrying api_message_id), and #184352 charges discarded child messages a fixed 64. Five stream_event kinds have no rule, although the parser reads at most one small field from them:

Frame What the parser reads Typical raw size
signature_delta nothing (cli-output-events.ts:491: "opaque continuation material") about 2 KB, up to 21 KB
thinking_delta with empty thinking (progress tick) estimated_tokens (cli-output-events.ts:483) 343
content_block_stop index (cli-output-events.ts:330, :467) 243
message_stop the event type (cli-output-stream.ts:524) 227
message_delta nothing (src/ has no reader of message_delta; readCliUsage reads top-level usage, not event.usage) 740

The charge only feeds the budget; it never changes what the parser reads or emits.

measureClaudeStreamControlFrame (new, beside the partial-frame helper) charges a matching frame 32 characters, plus the estimated_tokens field for progress ticks and any wire whitespace around the JSON:

  • Progress ticks and stop frames have closed, bounded shapes, so like partial frames they no longer count toward the 20,000-line limit. Each costs at least 33 characters with its newline, so the 8 MiB budget still caps them at about 254,000 per turn. Progress ticks still reach onThinkingProgress once per frame.
  • Signature and message deltas carry discarded content of any size, so they keep counting as ordinary lines, and at most 8 KiB of each line goes uncharged; anything beyond that is charged. A turn may therefore parse up to 20,000 such lines of 8 KiB (about 156 MiB) where the budget used to stop near 8 MiB. That is acceptable because the content is discarded, not retained, and the line and single-line limits still bound the work; a test drives such lines until the line limit trips.
  • The envelope check that fix(agents): Claude CLI turns hit the 20,000-line limit when Claude Code adds stream frame metadata #186085 added for partial frames (allowed top-level keys, api_message_id at most 64 characters, thinking_display at most 32, valid block index) moves into readBoundedStreamEvent and is shared by both helpers instead of duplicated. thinking_display is accepted only on progress ticks.
  • An unknown key at any level, oversized or non-string metadata, a non-numeric estimate, thinking text, an empty signature or an invalid index keeps full accounting, as does any key a future Claude Code release adds until it is reviewed. message_start and content_block_start stay fully charged because they feed parser state.

#166127 (tool results) and #159930 (Edit/Write file echoes) discount other record types and do not overlap.

Evidence

Real behavior proof (shipped entry point). One openclaw agent exec turn per build through the bundled claude-cli backend, built from main (67c3c3a) and from this PR at 21fe916 (the follow-up commit changes only tests and the test-lines allocation, so the production code exercised is the code under review). macOS, Node 24, Claude Code 2.1.296, claude-haiku-5-5, --thinking low, each run with its own temporary OPENCLAW_HOME and this config:

{
  "agents": {
    "defaults": {
      "model": "anthropic/claude-haiku-5-5",
      "models": { "anthropic/claude-haiku-5-5": { "agentRuntime": { "id": "claude-cli" } } },
      "timeoutSeconds": 7200
    }
  }
}

Prompt: run echo step-K with the exec tool for K = 1 to 1,980, one call per message, then reply DONE. Each round is one tiny tool call, so most of the stream is per-message framing (message start, block start and stop, message delta, message stop, snapshots and tool results), the shape of a long tool loop.

Build Exit Result Tool calls
main 67c3c3a 1 CLI JSONL output exceeded 8388608 characters after step 1,744, no reply (2,174 s) 1,746 (incl. ToolSearch and the cancelled step 1,745)
this PR 21fe916 0 ok, final DONE (2,882 s) 1,982: 1,980 steps, ToolSearch, 1 rejected first guess

The main run stops after step 1,744: the parser refuses the stream mid-turn, the in-flight call is cancelled and no reply is returned. In the head run the model first called a bare exec (rejected: the tool was not loaded yet), loaded mcp__openclaw__exec with ToolSearch, then ran all 1,980 steps; that rejected first guess is the single tool failure and the two extra calls. The working directory holds only the prompt after both runs.

A pass-through wrapper on PATH copied Claude Code's stdout to a file in both runs, because the gateway does not log the stream of a failed turn. Replaying each file through chargeClaudeStreamJsonLine from both builds, fed the way the live transport feeds the parser (it consumes control messages first):

Stream main accounting this PR accounting
main run (25,659 lines) 8,392,097 chars, trips at line 25,649 (the gateway stopped within 10 lines of it) 6,442,638 (77%), 12,254 ordinary lines
head run, completed (26,847 lines) 9,312,559 (111%), would trip at line 24,101 7,103,109 (85%), 13,912 ordinary lines

On the completed stream that is about 4,700 characters per tool round on main and 3,590 with this change.

main 67c3c3a: redacted output
$ openclaw agent exec --config openclaw.json --cwd work --message-file work/prompt.txt --thinking low --timeout 7200 --json
{
  "ok": false,
  "status": "error",
  "final": "",
  "payloads": [],
  "model": null,
  "provider": null,
  "sessionId": "<run-id>",
  "error": {
    "message": "CLI JSONL output exceeded 8388608 characters; refusing to parse output.",
    "kind": "exception"
  }
}
--- stderr (filtered) ---
[agent/cli-backend] cli session history refused across auth boundary: reason=auth-unknown
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-haiku-5-5 activeSessions=1
[diagnostic] lane task error: lane=cli:claude-cli:owner:<hash> durationMs=2166285 error="CLI JSONL output exceeded 8388608 characters; refusing to parse output." errorName=FailoverError
[agent/cli-backend] cli terminal failure: provider=claude-cli model=claude-haiku-5-5 durationMs=2166902 runId=<run-id> error=CLI JSONL output exceeded 8388608 characters; refusing to parse output.
[model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-haiku-5-5 candidate=anthropic/claude-haiku-5-5 reason=format next=none
[state/agent-db] agent database clean-close receipt: written; agent=main
CLI JSONL output exceeded 8388608 characters; refusing to parse output.
exit 1
(elapsed 2174s)
--- Claude Code stdout (1980-step prompt) ---
tool_use blocks: 1746; tool results: 1748; last echoed step: step-1744
this PR 21fe916: redacted output
$ openclaw agent exec --config openclaw.json --cwd work --message-file work/prompt.txt --thinking low --timeout 7200 --json
{
  "ok": true,
  "status": "ok",
  "final": "DONE",
  "payloads": [
    {
      "text": "DONE",
      "mediaUrl": null
    }
  ],
  "usage": {
    "input": 2,
    "output": 4,
    "cacheRead": 42888,
    "cacheWrite": 93,
    "cacheWrite1h": 93
  },
  "toolSummary": {
    "calls": 1982,
    "tools": [
      "exec",
      "ToolSearch",
      "mcp__openclaw__exec"
    ],
    "failures": 1
  },
  "model": "claude-haiku-5-5",
  "provider": "anthropic",
  "sessionId": "<run-id>"
}
--- stderr (filtered) ---
[agent/cli-backend] cli session history refused across auth boundary: reason=auth-unknown
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-haiku-5-5 activeSessions=1
[state/agent-db] agent database clean-close receipt: written; agent=main
[agent/cli-backend] cli turn: provider=claude-cli model=claude-haiku-5-5 durationMs=2873510 outBytes=4 outHash=<hash>
[state/agent-db] agent database clean-close receipt: written; agent=main
exit 0
(elapsed 2882s)
--- Claude Code stdout (1980-step prompt) ---
tool_use blocks: 1982; tool results: 1984; last echoed step: step-1980

Redaction replaced run and session ids, hashes and temporary paths, and dropped repeated skill-loading lines. This run shape exercises stop frames and message deltas; it has almost no thinking, so the signature and progress-tick savings show in the captured-stream breakdown below.

Charge breakdown on captured streams. Each line fed through chargeClaudeStreamJsonLine from main (67c3c3a) and from this PR, applying the real limits:

Capture main this PR
41,071 real records, Claude Code 2.1.310 (694 completed gateway turns) 12,316,948 chars, 12,697 lines 9,639,274, 9,099
One complete real turn, Claude Code 2.1.296 (Haiku, thinking, 8 tools) 469,353, 130 444,427, 88
Four failed production turns (41 to 73 minutes, 283 to 448 tool calls), rebuilt from their transcripts (estimates) 5.09 to 5.43 MB (61 to 65%) 4.14 to 4.37 MB (49 to 52%)

The four production turns failed on main before #186085 at 109 to 114 percent of the budget; #186085 brings them to 61 to 65 percent, and this change takes off another 0.95 to 1.06 MB each.

Tests and checks (macOS, Node 24). The RED and mutation runs were done at 11b83ab; the code and test changes in this PR are byte-identical at the current head (only the docs paragraph was rewrapped around a main edit). Everything else was rerun at the current head ff03f75 (this branch merged with main 638a185), from a fresh clone:

  • src/agents/cli-output-control-frames.test.ts (new): 45 passed. Covers the Claude Code 2.1.296 shape of each frame kind (exact charge and line accounting), wire padding, index-less and child-attributed frames, the 8 KiB allowance (at, just over, far over, with padding), every metadata cap at its limit, and full accounting for each rejected shape above. It also checks that progress ticks and tool starts still reach the parser callbacks, that 20,001 progress or stop frames complete, that signature and message deltas at the allowance stop on the 20,001st line, and that progress, block-stop and message-stop floods hit the 8 MiB budget at the computed frame.
  • RED: with only cli-output-stream-limits.ts reverted to main, 26 fail and 19 pass. 21 single-site mutations of the production file (zero charges, dropped or moved metadata caps, thinking_display anywhere, unknown event or delta keys, no padding, empty signatures, no index check, skipping the shared envelope check, no overflow charge, larger allowance, line-count flips, no estimate charge): 20 fail at least one test. The survivor removes the thinking === "" guard on progress ticks; it is equivalent today because the fix(agents): Claude CLI turns hit the 20,000-line limit when Claude Code adds stream frame metadata #186085 partial-frame rule charges any thinking delta with text first, and the guard stays so the control-frame rule never discounts thinking text on its own.
  • All 12 src/agents/cli-output*.test.ts files: 284 passed. src/agents/cli-runner/ (74 files): 911 passed.
  • cli-output-partial-messages.test.ts drops its empty-thinking-progress and signature-delta rows, which expected full accounting for the frames this PR now discounts; the new suite covers both shapes with their new charges. The net test growth (264 lines) is recorded in config/test-lines-allocations/claude-stream-control-frames.txt; pnpm check:test-lines-ratchet --base 638a1851e7e (6,556,625 lines, ceiling 6,556,696) and git diff --check pass.
  • The lanes that were red on fe88e02 now pass: pnpm tsgo:prod, pnpm tsgo:ui, pnpm tsgo:scripts, pnpm check:test-types, pnpm tsgo:core:test, and pnpm check:baseline-ratchets --base 638a1851e7e (all 9 ratchets ok).
  • pnpm check:changed --base 638a1851e7e passes every step (including lint, format, dead-export scan, and core typecheck) except changelog attributions, which flags 20 existing Thanks @... lines in CHANGELOG/*.md. This PR touches no changelog file, and the check prints the same output on main 638a185.
  • Why fe88e02 was red: CI tested it merged with main f2c27f0. Every failure came from that base and shows up the same on main 7c2ff8f (the merge base at that point) with no changes from this PR. The type lanes all failed on one error in a file this PR does not touch: ui/src/components/browser/browser-panel-render.tsx(149,11): error TS2322, fixed on main by fix(ui): restore browser panel type checks #192868. The ratchet lane failed on test-lines: over by: 191. main alone was over by the same 191 lines, and fix(ci): reconcile remaining seven-line test budget debt #192905 reconciled them; this PR's own +264 is covered by its allocation. Neither fix was in f2c27f0, so a rerun of that CI run would test the same merge again. That is why this branch takes current main.
  • Docs: docs/gateway/cli-backends.md ("Inputs and outputs") gains one sentence on the control-frame allowance. CHANGELOG.md is left to release generation.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR discounts discarded Claude CLI control frames within the existing output budgets.

Example: A Claude CLI turn runs 1,980 sequential echo commands.

  • Before: The supplied base run stops after step 1,744 with an 8 MiB output-budget error and returns no reply.
  • After: The supplied patched run completes step 1,980 and returns DONE.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with shipped-entry before/after evidence, meaningful boundary controls, and no actionable findings; broad CI remains pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Redacted terminal output exercises the changed budget owner through openclaw agent exec and real Claude Code on macOS with Node 24: the base fails without a reply, while the patched build completes the 1,980-step loop and returns DONE; captured-stream analysis and parser regressions additionally cover signatures, progress ticks, padding, metadata rejection, and flood limits.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Long Claude CLI turns can stop on discarded protocol framing and lose their final reply.
Reason: The supplied live run demonstrates user value, and the repair extends the established accounting pattern without changing configuration or retained output.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a demonstrated Claude CLI reply-loss bug that remains on current main, with no actionable correctness or security findings. Current-head CI is still pending.

Priority: P2
Reviewed head: ff03f752ae450dfca9c12c126170d655d7bfa49a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The CLI streaming parser receives Claude Code JSONL, accounts for retained content and framing, and emits reply text, thinking progress, and tool events.

flowchart LR
  A[Claude Code stdout] --> B[Bounded JSONL framing]
  B --> C[Record decoding]
  C --> D[Stream budget accounting]
  D --> E[Event and reply parser]
  E --> F[Agent callbacks and final reply]
Loading

Technical review

Best possible solution:

Merge the focused accounting repair once the required current-head checks pass.

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

Current-main source still charges these discarded frames at raw size, matching the supplied failing shipped-entry trace; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch fixes the accounting owner directly, shares existing envelope validation, preserves retained-content charges, and avoids restoring tuning knobs.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 941b949f8c72.

Provenance checked

  • Partial-message accounting and shared envelope validation keeps the original intent (12302d7: Recognized nonempty deltas were charged for retained payload plus fixed framing overhead while unknown shapes retained raw accounting.)
  • Empty thinking progress and signature accounting changes intended behavior with a stated reason (72c9a55: The metadata repair deliberately left these frames fully charged for separate work; this PR explains their discarded contents, demonstrates the remaining failure, and bounds the expanded parsing allowance.)
  • CLI backend accounting documentation keeps the original intent (8828c59: The documentation distinguishes discarded tool-result payloads from retained IDs, metadata, padding, and other records; this PR preserves that distinction while adding control frames.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Mitchell Etzel: Raw commit 72c9a55 adds src/agents/cli-output-stream-limits.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 72c9a55d4e5d; files: src/agents/cli-output-stream-limits.ts)
  • xingzhou: Raw commit 12302d7 adds src/agents/cli-output-stream-limits.ts:72 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 12302d7fa133; files: src/agents/cli-output-stream-limits.ts)

PR surface

Source +73, Tests +264, Docs +2, Other +2. Total +341 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 85 12 +73
Tests 2 271 7 +264
Docs 1 6 4 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 364 23 +341

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Long tool-heavy Claude CLI turns can lose their final reply, but the failure is limited to turns exhausting framing budgets.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-27T04:04:08.523Z sha d7fa12e5365f393ff7e29ae60d5d2f5670aba0cc :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-31T08:14:31.017Z sha 21fe916 :: needs changes before merge. :: [P2] [P2] Update the existing control-frame test expectations | [P3] [P3] Allocate the retained regression-test growth
  • reviewed 2026-10-31T09:05:18.199Z sha 11b83ab :: needs maintainer review before merge. :: none
  • reviewed 2026-11-04T17:23:46.606Z sha fe88e02 :: needs maintainer review before merge. :: none

Reviewed November 6, 2026, 10:37 PM ET / November 7, 2026, 03:37 UTC (Revision 5).

@NovaeonStudio

Copy link
Copy Markdown

Real-world data point for the "behavior proof" request: I've run the equivalent change locally on 2026.10.7 and
2026.10.8 (constants raised to 256 MiB chars / 1,000,000 lines by patching the built dist) with the claude-cli
backend on Claude Code 2.1.31x. Subagent-heavy turns that previously died with CLI JSONL output exceeded 20000 lines / ... 8388608 characters and lost their final reply now complete and deliver it; no gateway memory problems observed at those values. An env/config escape hatch would let me drop the dist patch, which has to be re-applied after every update.

#186085 should remove most of the line overcount on current Claude Code, but tool-result-heavy turns still hit the
8 MiB budget (#159929 / #166127), so the override remains useful. One suggestion: since the single-line cap follows the chars budget, a large override also raises the per-line cap. Maybe document that, or keep the line cap separate.

…lowance

- Thinking progress ticks (only estimated_tokens is read), content_block_stop
  and message_stop frames are charged 32 characters plus padding and skip the
  ordinary-line limit, like recognized partial frames.
- signature_delta and message_delta frames, whose content the parser discards,
  keep the ordinary-line limit and leave at most 8 KiB of each line uncharged.
- Unknown keys at any level, oversized or non-string metadata, invalid
  indexes, non-numeric estimates and thinking text keep full accounting; the
  8 MiB budget, per-line cap and 20,000-line limit are unchanged.
- Control frames reuse the partial-frame envelope check (metadata keys and
  caps from openclaw#186085, block index), now shared in readBoundedStreamEvent.
- docs/gateway/cli-backends.md describes the control-frame accounting.
@etzelm
etzelm force-pushed the fix/cli-stream-json-limit-env branch from d7fa12e to 21fe916 Compare October 31, 2026 08:08
@etzelm etzelm changed the title feat(agents): env overrides for claude-cli stream-json per-turn output limits fix(agents): Claude CLI turns hit output limits on discarded stream frames Oct 31, 2026
@etzelm

etzelm commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 31, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 31, 2026
…growth

- cli-output-partial-messages.test.ts: drop the empty thinking progress and
  signature delta rows that expected full accounting; the control-frame
  suite covers both shapes with their new charges.
- cli-output-control-frames.test.ts: drop the small-frame line-limit cases
  already covered by the allowance-sized mixed-frame test.
- config/test-lines-allocations: record the net test growth of this change.
@etzelm

etzelm commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 31, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Oct 31, 2026
@etzelm

etzelm commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Nov 4, 2026
@etzelm

etzelm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Merged current main to pick up #192868 (the browser-panel-render.tsx TS2322 that failed every type lane) and #192905 (the 191-line test-lines debt that failed the ratchet lane). Both failures show up the same on main 7c2ff8f without this PR. The code and tests in this PR are unchanged. The PR body's Tests section lists the reruns at the new head.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Nov 7, 2026
@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 9, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 6ab90a6 into openclaw:main Nov 9, 2026
121 of 124 checks passed
@vyctorbrzezowski

vyctorbrzezowski commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Merged via squash.

Thanks, @etzelm, for the accounting fix and the 1,980-step reproduction.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 10, 2026
…rames (openclaw#185404)

* fix(agents): charge discarded Claude stream control frames a fixed allowance

- Thinking progress ticks (only estimated_tokens is read), content_block_stop
  and message_stop frames are charged 32 characters plus padding and skip the
  ordinary-line limit, like recognized partial frames.
- signature_delta and message_delta frames, whose content the parser discards,
  keep the ordinary-line limit and leave at most 8 KiB of each line uncharged.
- Unknown keys at any level, oversized or non-string metadata, invalid
  indexes, non-numeric estimates and thinking text keep full accounting; the
  8 MiB budget, per-line cap and 20,000-line limit are unchanged.
- Control frames reuse the partial-frame envelope check (metadata keys and
  caps from openclaw#186085, block index), now shared in readBoundedStreamEvent.
- docs/gateway/cli-backends.md describes the control-frame accounting.

* test(agents): retire superseded control-frame rows and allocate test growth

- cli-output-partial-messages.test.ts: drop the empty thinking progress and
  signature delta rows that expected full accounting; the control-frame
  suite covers both shapes with their new charges.
- cli-output-control-frames.test.ts: drop the small-frame line-limit cases
  already covered by the allowance-sized mixed-frame test.
- config/test-lines-allocations: record the net test growth of this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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.

4 participants