Skip to content

fix: CLI backend runs record only their last model call's usage - #155430

Closed
chughtapan wants to merge 3 commits into
openclaw:mainfrom
chughtapan:cli-run-cumulative-usage
Closed

chughtapan wants to merge 3 commits into
openclaw:mainfrom
chughtapan:cli-run-cumulative-usage

Conversation

@chughtapan

@chughtapan chughtapan commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: a run on a CLI backend (Claude Code) records the usage of its last model call, not the run, when the turn makes tool calls. A turn that produced 164 output tokens over several calls records 3.

User Impact

User impact: agentMeta.usage and the CLI assistant transcript row carry the run's cumulative tokens, so session usage totals and cost views match what the backend billed. Context displays are unchanged: lastCallUsage still sizes the context window, and the transcript row now carries the last call as contextUsage.

Why This Change Was Made

cli-run-settlement.ts already keeps the backend's cumulative terminal record as diagnosticUsage; the settled usage took the last streamed record. Other runners already prefer diagnosticUsage ?? usage.

The transcript row follows the contract in docs/reference/token-use.md: billing and context are separate. All five billing fields (input, output, cacheRead, cacheWrite, totalTokens) come from one scope, the run's cumulative usage when the backend reports one, else the last call. The last call travels as contextUsage, the same shape resolveCliTranscriptUsage already writes on the command path; that derivation is now one shared deriveCliContextUsage in src/agents/usage.ts.

Backend reports Billing counters totalTokens contextUsage
last call 11+7=18, run 21+9=30 run 30 last call: prompt 11, total 18
run without an explicit total run component sum last call
no run usage (other CLI backends) last call last call total last call

Out of scope: command/post-run.ts → persistCliTurnTranscript still bills lastCallUsage, which attempt-execution.cli.test.ts pins ("marks CLI transcript context unavailable when only cumulative usage exists"). Happy to align it in this PR or a follow-up if maintainers want both writers billing the run.

Evidence

  • New tests in src/agents/cli-runner/cli-run-transcript.test.ts, each persisting through the real SQLite transcript: explicit totals, omitted run total, no run usage, and persistence into both readers (computeUsageTokenTotals reports 30; aggregateSessionTranscriptUsage reports context 11).
  • pnpm test src/agents/cli-runner/cli-run-transcript.test.ts src/agents/cli-runner.context-engine.test.ts src/agents/command/attempt-execution.cli.test.ts src/infra/session-cost-usage-reporting.test.ts --maxWorkers=1: 216 passed. src/gateway/session-utils.test.ts (covers legacy CLI rows without contextUsage): 258 passed, 1 failed in listAgentsForGateway reports whether each workspace is a git checkout, which depends on the local checkout layout (a partial-clone worktree) and not on this change.
  • pnpm test src/agents/cli-runner/cli-run-transcript.test.ts --maxWorkers=1: 12 passed; wall time 55.7 s (vitest duration 46.6 s, of which tests 6%, transform 69%), on an 8-core Linux host. In CI run 35794144850 (shard agentic-agents-support-hosted-2) all 12 passed; the six new tests took 576 ms of test time and the file about 1.3 s.
  • pnpm tsgo:core, oxlint, oxfmt, git diff --check, and the pre-commit guard: clean.
  • Live: with the cumulative change applied as a dist patch to 2026.8.1, transcript counters equalled Claude Code's own result events field for field over 1-turn, 3-tool-call and 20-turn sessions (20 turns: input 120, output 4,281, cacheRead 1,276,929, cacheWrite 16,920).

🤖 Generated with Claude Code

@clawsweeper

clawsweeper Bot commented Sep 22, 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 agents Agent runtime and tooling size: XS labels Sep 22, 2026
@chughtapan

Copy link
Copy Markdown
Contributor Author

Rebased onto main 3ff1898 (no conflicts, diff unchanged). The earlier CI failures were in files this PR does not touch (commands-config.owner.test.ts against the new mcp-oauth-store API, qa-lab extension test boundaries and unused exports, a Codex output-fidelity test, sessions-resolve-store, a worktree GC timeout) and main was failing the same jobs at the time. On the rebased tree vitest run src/agents/cli-runner.context-engine.test.ts src/agents/command/attempt-execution.cli.test.ts: 192 passed.

@chughtapan
chughtapan force-pushed the cli-run-cumulative-usage branch from 2b1a3f5 to d9da791 Compare September 22, 2026 05:13
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 22, 2026, 7:37 PM ET / 23:37 UTC (Revision 5).

ClawSweeper review

What this changes

The PR records cumulative CLI-run token usage for billing, stores last-call context separately, and adds persistence tests and documentation.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 4 items remain

The accounting repair remains necessary, but the prior compaction finding is unresolved and aggregate-only backend results gain an unjustified fresh-context marker. The overlapping PR is not yet a verified safe replacement.

Priority: P2
Reviewed head: 6293d27f6d6c02b6065752eae94a7725485e8996

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful billing evidence and persistence coverage support the repair, but two context-accounting defects prevent merge.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied real Claude Code observations support cumulative transcript billing across single-turn, tool-using, and twenty-turn sessions using a dist patch on 2026.8.1. Current SQLite tests supplement that evidence; stored-data compatibility remains insufficient because the context-reader and aggregate-only marker cases are incorrect.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied real Claude Code observations support cumulative transcript billing across single-turn, tool-using, and twenty-turn sessions using a dist patch on 2026.8.1. Current SQLite tests supplement that evidence; stored-data compatibility remains insufficient because the context-reader and aggregate-only marker cases are incorrect.
Evidence reviewed 10 items Pinned introduced change: Reviewed the merge-base-to-head diff. Settlement selects cumulative diagnostic usage, and transcript persistence adds a separate context marker. The command writer only shares the extracted derivation; its billing behavior remains unchanged.
Current main still undercounts: Fetched main still assigns output.usage to agentMeta.usage and builds transcript billing fields from params.usage without the terminal aggregate.
Latest release retains the old accounting: The latest supplied release, v2026.9.5, also assigns output.usage to settled usage. Local release-blob inspection failed; the pinned GitHub contents read established this behavior.
Findings 2 actionable findings [P2] Use last-call output in the compaction transcript reader
[P2] Keep aggregate-only CLI usage unavailable for context
Security None None.

How this fits together

OpenClaw’s CLI runner converts backend process output into agent results and stored conversation records. Billing reads cumulative counters, while context displays and compaction need measurements from the latest model call.

flowchart TD
  A[CLI backend output] --> B[Usage parser]
  B --> C[Whole-run counters]
  B --> D[Last-call measurements]
  C --> E[Stored assistant record]
  D --> E
  E --> F[Billing reports]
  E --> G[Context and compaction]
Loading

Before merge

  • Use last-call output in the compaction transcript reader (P2) - The new persisted row combines whole-run usage.output with last-call contextUsage, but this reader still takes output from the billing counter. After switching a CLI session to an embedded runtime, a 170k prompt, 2k final output, and 30k cumulative output projects 200k instead of 172k, potentially forcing unnecessary compaction or memory flushes. Derive output from the available context snapshot and cover the threshold decision. This previously raised late finding remains unresolved; the reader is unchanged from the earlier reviewed head.
  • Keep aggregate-only CLI usage unavailable for context (P2) - This marks every output.usage object as a last-call snapshot, even when no separate run usage exists. The supported single-JSON path in parseCliJson places a terminal result’s aggregate counters directly in usage; a multi-call Claude JSON result therefore becomes falsely fresh context. Previously, readers rejected these unmarked CLI counters as context evidence. Only attach an available marker when the backend establishes per-call scope, and retain the existing unavailable behavior otherwise. This is a late discovery on code unchanged since the earlier reviewed head.
  • Resolve merge risk (P1) - Persisted usage can trigger premature context maintenance: compaction mixes cumulative output with last-call input, and aggregate-only backend results are newly treated as fresh context.
  • Complete next step (P2) - Repair compaction’s output scope and restrict fresh-context markers to verified per-call usage, then validate persisted-row behavior for both cases.

Findings

  • [P2] Use last-call output in the compaction transcript reader — src/auto-reply/reply/agent-runner-memory.ts:338-343
  • [P2] Keep aggregate-only CLI usage unavailable for context — src/agents/cli-runner/cli-run-transcript.ts:86
Agent review details

Security

None.

PR surface

Source +42, Tests +93, Docs +5. Total +140 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 64 22 +42
Tests 2 94 1 +93
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 163 23 +140

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #148603
Summary: This PR is another candidate repair for the reported Claude CLI accounting undercount; the overlapping implementation also covers command persistence and compaction.

Members:

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

Merge-risk options

Maintainer options:

  1. Repair context consumers and marker eligibility (recommended)
    Use last-call context output for compaction and leave aggregate-only backend usage unavailable for context, with focused persistence regressions.
  2. Consolidate after the overlapping PR is viable
    Preserve this contribution’s useful evidence and consolidate onto the overlapping implementation once its unresolved validation is understood.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Repair compaction output derivation to use available contextUsage totals, preserve unavailable context for aggregate-only CLI results, and add focused persisted-row regressions without changing billing totals or historical records.

Technical review

Best possible solution:

Keep cumulative billing separate from verified last-call context across every reader, preserving unavailable context when a backend supplies only aggregate counters.

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

Yes, from source: multi-call CLI output retains terminal totals separately while main persists last-call counters; the proposed rows also expose the two context-sizing failures described below. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

The billing/context split is appropriate, but the cutover is incomplete: compaction must consume the context snapshot consistently, and a generic usage object cannot establish last-call scope.

Full review comments:

  • [P2] Use last-call output in the compaction transcript reader — src/auto-reply/reply/agent-runner-memory.ts:338-343
    The new persisted row combines whole-run usage.output with last-call contextUsage, but this reader still takes output from the billing counter. After switching a CLI session to an embedded runtime, a 170k prompt, 2k final output, and 30k cumulative output projects 200k instead of 172k, potentially forcing unnecessary compaction or memory flushes. Derive output from the available context snapshot and cover the threshold decision. This previously raised late finding remains unresolved; the reader is unchanged from the earlier reviewed head.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Keep aggregate-only CLI usage unavailable for context — src/agents/cli-runner/cli-run-transcript.ts:86
    This marks every output.usage object as a last-call snapshot, even when no separate run usage exists. The supported single-JSON path in parseCliJson places a terminal result’s aggregate counters directly in usage; a multi-call Claude JSON result therefore becomes falsely fresh context. Previously, readers rejected these unmarked CLI counters as context evidence. Only attach an available marker when the backend establishes per-call scope, and retain the existing unavailable behavior otherwise. This is a late discovery on code unchanged since the earlier reviewed head.
    Confidence: 0.94
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 488019c3c346.

Labels

Label changes:

  • add merge-risk: 🚨 session-state: The newly persisted accounting shape can overstate live context and cause unnecessary memory flushes or compaction.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The supplied real Claude Code observations support cumulative transcript billing across single-turn, tool-using, and twenty-turn sessions using a dist patch on 2026.8.1. Current SQLite tests supplement that evidence; stored-data compatibility remains insufficient because the context-reader and aggregate-only marker cases are incorrect.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: CLI tool turns undercount usage, with a bounded accounting repair and context-maintenance regressions to resolve.
  • merge-risk: 🚨 session-state: The newly persisted accounting shape can overstate live context and cause unnecessary memory flushes or compaction.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The supplied real Claude Code observations support cumulative transcript billing across single-turn, tool-using, and twenty-turn sessions using a dist patch on 2026.8.1. Current SQLite tests supplement that evidence; stored-data compatibility remains insufficient because the context-reader and aggregate-only marker cases are incorrect.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied real Claude Code observations support cumulative transcript billing across single-turn, tool-using, and twenty-turn sessions using a dist patch on 2026.8.1. Current SQLite tests supplement that evidence; stored-data compatibility remains insufficient because the context-reader and aggregate-only marker cases are incorrect.

Evidence

Acceptance criteria:

  • [P1] pnpm test src/auto-reply/reply/agent-runner-memory.test.ts src/agents/cli-runner/cli-run-transcript.test.ts src/agents/cli-output-records.test.ts --maxWorkers=1.
  • [P1] pnpm test src/agents/cli-runner.context-engine.test.ts src/agents/command/attempt-execution.cli.test.ts src/infra/session-cost-usage-reporting.test.ts --maxWorkers=1.
  • [P1] pnpm tsgo:core.
  • [P1] git diff --check.

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head diff. Settlement selects cumulative diagnostic usage, and transcript persistence adds a separate context marker. The command writer only shares the extracted derivation; its billing behavior remains unchanged. (src/agents/cli-runner/cli-run-transcript.ts:74, 6293d27f6d6c)
  • Current main still undercounts: Fetched main still assigns output.usage to agentMeta.usage and builds transcript billing fields from params.usage without the terminal aggregate. (src/agents/cli-runner/cli-run-settlement.ts:588, 488019c3c346)
  • Latest release retains the old accounting: The latest supplied release, v2026.9.5, also assigns output.usage to settled usage. Local release-blob inspection failed; the pinned GitHub contents read established this behavior. (src/agents/cli-runner/cli-run-settlement.ts:624, ec9c1a13db89)
  • Compaction mixes accounting scopes: deriveTranscriptUsageSnapshot obtains prompt tokens from contextUsage but reads output from cumulative usage.output. Preflight adds those values through resolveEffectivePromptTokens, so a 170,000-token prompt with 2,000 final-call output and 30,000 cumulative output becomes 200,000 instead of 172,000. (src/auto-reply/reply/agent-runner-memory.ts:339, 6293d27f6d6c)
  • Aggregate-only output is not a last-call contract: parseCliJson places the JSON result’s usage directly into output.usage and returns no separate diagnosticUsage. The documented JSON backend path therefore can supply whole-turn counters to the new unconditional context marker; existing readers deliberately treat unmarked CLI rows as context-unavailable. (src/agents/cli-output-records.ts:486, 6293d27f6d6c)
  • Review continuity: The transcript writer and usage helper have no differences from the earlier reviewed ed26510 head. GitHub reports the earlier memory-reader blob as 80bf68a745be1d3ef37584cfcd333cb9eaab5d94, matching the checkout. The billing-total correction remains intact; the compaction blocker remains present. (src/agents/cli-runner/cli-run-transcript.ts:86, 6293d27f6d6c)

Likely related people:

  • Peter Steinberger: Raw commit 623f22c adds src/agents/command/transcript-persistence.ts:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 623f22cc4b2e; files: src/agents/command/transcript-persistence.ts)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Prove that cumulative CLI output cannot push a below-threshold last-call context into compaction.
  • Cover a terminal-only JSON backend result and preserve unavailable context while retaining its billing counters.

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 (4 earlier review cycles)
  • reviewed 2026-09-22T05:21:10.737Z sha d9da7910d7f62b51e394b2462f810d72fefa60ca :: blocked before merge. :: [P2] Keep transcript billing totals consistent with cumulative counters
  • reviewed 2026-09-22T22:51:51.149Z sha ed26510 :: needs changes before merge. :: none
  • reviewed 2026-09-22T23:09:21.112Z sha ed26510 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T23:29:07.775Z sha 6293d27 :: blocked before merge. :: [P2] Use final-call output in the compaction transcript reader

A CLI backend's terminal record is cumulative for the run, and the last
streamed record is one model call. Run meta and the CLI transcript row
reported the last call, so a Claude Code turn of several model calls was
billed as one. usage now carries the cumulative record when the backend
reports one; lastCallUsage and the transcript row's totalTokens stay the
last call, which sizes the context window.
@chughtapan
chughtapan force-pushed the cli-run-cumulative-usage branch from d9da791 to be5c797 Compare September 22, 2026 22:45
The transcript row billed the run's cumulative counters but kept the
last call's totalTokens, so billing readers, which prefer an explicit
total, still reported the last call. All five billing fields now come
from one scope, and the last call travels as contextUsage, the existing
context-snapshot contract the gateway reader already honours.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S and removed size: XS labels Sep 22, 2026
@chughtapan
chughtapan force-pushed the cli-run-cumulative-usage branch from be5c797 to ed26510 Compare September 22, 2026 22:46
@chughtapan

Copy link
Copy Markdown
Contributor Author

Addressed the review in ed26510:

  • Transcript billing total (P2). Correct, and my code comment's rationale was wrong. The row now takes all five billing fields from one scope (runUsage ?? usage), so the fixture persists input 21, output 9, totalTokens 30. The last call is carried as contextUsage (prompt 11, total 18) through a shared deriveCliContextUsage, the helper the command-path writer already used.
  • Merge risk (P1). Rows are self-consistent again. computeUsageTokenTotals reports 30 on a persisted row, and aggregateSessionTranscriptUsage reports context 11 (before, such rows had no contextUsage and read as legacy CLI rows with context unavailable). Existing rows are not rewritten; the legacy branch and its test in session-utils.test.ts are unchanged.
  • Explicit, omitted and existing-row cases. Covered by new persistence tests in cli-run-transcript.test.ts: explicit total, omitted run total, no run usage, and both readers. Legacy rows are covered by the existing session-utils.test.ts case.

Also updated the CliOutput.diagnosticUsage contract comment and docs/reference/token-use.md. Test commands and results are in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 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 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 22, 2026
@chughtapan

Copy link
Copy Markdown
Contributor Author

CI run 35794144850 on ed26510: the gate failed on 7 shard jobs, none in files this PR touches (src/agents/usage.ts gains one function; the command-path writer's refactor keeps its behaviour, pinned by attempt-execution.cli.test.ts, which passes).

Job Failing test Same test failing elsewhere
compact-large-14 gateway/session-groups.test.ts (another OpenClaw process owns the state lock) main run 35795218974 and 6 other branches in the same hour
compact-large-26 plugin-state/plugin-state-worker.test.ts (overlapping host owner) branch ci-burden/tp-e2-pr-tails, run 35794796049
compact-large-36 gateway/server/__tests__/server.tasks-list-metadata.test.ts (state DB still has native borrowers) branch codex/static-note-write-final-20260920, run 35795242922
compact-large-29 gateway/server-methods/task-history.test.ts (state DB still has native borrowers, same error class)
compact-large-34 agents/worktrees/service.gc.test.ts (60 s managed-command timeout) this PR's previous head, before this change
changed-extensions-config-48 codex side-question.execution.test.ts this PR's previous head, before this change
changed-extensions-bundle-12 codex event-projector.output-fidelity.native.test.ts this PR's previous head, before this change

I can't rerun jobs on this repo; a maintainer rerun of the failed jobs should clear them. The PR's own tests (cli-run-transcript.test.ts, 12/12) passed in agentic-agents-support-hosted-2.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed 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. labels Sep 22, 2026
@clawsweeper clawsweeper Bot added 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 Sep 22, 2026
@chughtapan

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #148682, which fixes the same undercount and also covers the compaction reader and the aggregate-only marker case raised in this review. Live validation evidence moved to #148682.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant