Skip to content

perf(usage): reduce duplicate bookkeeping during session backfill - #183186

Merged
steipete merged 2 commits into
mainfrom
steipete/perf-micro-cost-usage-refresh-20260919
Oct 25, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/perf-micro-cost-usage-refresh-20260919

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cold session-usage backfill duplicates every deferred transcript identifier in a temporary set alongside its pending queue.

User Impact

This removes a small amount of backfill allocation without changing token counts, cost arithmetic, refresh batching, or usage-report behavior.

Why This Change Was Made

The existing pending queue already records the canonical key of each deferred repair. Cleanup can consult that queue directly, so the extra remainder set and its insertions disappear. Newer repair rows retain their identity check; aliases, busy retries, and cancellation keep their existing handling. A repair whose key receives another publication remains until that queued work settles.

Refresh already uses exact transcript publications and worker checkpoints to skip unchanged sessions. Publications defer while their agent is busy and normally coalesce until a 30-second idle gap; eligible pending publications have a five-minute coalescing cap. On-demand reads flush their required work. Backfill runs in batches of 50 sessions, with contention retries backing off from 50 ms to 5 s. Startup and explicit broad invalidations still perform discovery; this change adds no cache, revision store, schema, or configuration.

Production delta: +1/-3 lines, net -2. The measurement harness also gains optional usage RPC polling and reuses its existing search/filter churn in memory-soak runs. Benchmark tooling accompanies the deletion to run the requested usage/search stress and capture cold owner allocation through real workers. Usage instructions are in the script headers.

Evidence

  • node scripts/run-vitest.mjs src/infra/session-cost-usage-refresh.test.ts --maxWorkers=1: 22 passed on baseline and candidate, including deferred repairs, aliases, bounded batches, busy retries, concurrent appends, and cancellation.
  • Changed-file oxfmt and repository lint passed; pnpm tsgo:scripts passed. Runtime builds passed on both revisions. The export-collision guard and both import-closure files passed (22 tests).
  • Review: the original independent subagent review (autoreview route unavailable) was clean after fixing a harness timer that included a preceding label patch. Autoreview is now available and returned scoped-clean at P0–P2 for the rebased production/harness change. The unchanged cold probe retains its clean independent review. Both benchmark sides use the already-correct inner RPC timings. A separate final rebase review found no actionable P0–P2 issues; the focused refresh file passed all 21 tests on final head 5bf8e4784ab1bc709a4b0105bd110a6ddcf62305 (the earlier measured revisions had 22).
  • Cold real-owner refresh, 10,000 synthetic sessions, real workers: 3.91 → 2.28 MB sampled allocation under the remainder callback (−1.63 MB, −41.6%). Both sides produced 10,000 fresh rollups and identical totals. Total sampled refresh allocation was effectively flat (234.212 → 234.187 MB); main-thread CPU was 3.639 → 4.101 s, wall time 47.495 → 129.190 s on a heavily shared host. This is a small bookkeeping simplification, not a whole-refresh speedup claim.
  • The cold probe samples the main isolate, including collected objects. Its transcripts have no usage fields: arithmetic correctness comes from the focused tests, not equality of these zero totals. The source loader leaves the callback anonymous; attribution follows the aggregation caller into the runtime module. The baseline summary was corrected from its unchanged raw profile.
  • Maintainer acceptance: land this net-two-line production deletion. Cold callback allocation falls about 42%, and the two completed matched pairs are accepted as neutral under the deletion landing gate. Later attempts failed on both revisions because the stress workload exhausts usage-read admission; these are shared harness/admission failures, not evidence against the candidate. The separate admission defect is being addressed in a follow-up. All measurements and failures remain below.

Matched Gateway stress

Both sides of the two completed pairs finished 40 cohorts / 320 turns with fresh identically generated state. Columns show baseline → candidate. Timing and GC are untraced; allocation sampling is reported separately below.

Metric Pair 1 Pair 2
Duration, min 35.74 → 35.60 26.62 → 26.44
Main-thread CPU, s / % 337.91 / 15.76% → 332.86 / 15.59% 346.65 / 21.71% → 346.87 / 21.87%
Main-thread CPU/turn, ms 1055.98 → 1040.18 1083.27 → 1083.98
GC, s/min / ms per turn 1.891 / 211.17 → 1.679 / 186.81 1.887 / 157.02 → 1.884 / 155.63
Event-loop p99, ms (n) 109.51 (87,222) → 102.83 (87,678) 103.28 (64,842) → 104.40 (64,292)
Event-loop max, ms 1197.47 → 1219.49 713.56 → 725.09
sessions.list p95 / p99, ms (n) 925.52 / 1204.38 (359) → 640.82 / 1210.86 (339) 631.15 / 1272.52 (320) → 597.43 / 1022.47 (345)
Max single GC pause, ms 318.18 → 248.02 337.84 → 250.07
Peak / final RSS, MiB 4786.90 / 3816.05 → 4616.40 / 3585.15 5403.28 / 4318.70 → 5802.57 / 4315.38
Peak / final heap, MiB 1532.46 / 697.08 → 1188.68 / 694.20 1523.13 / 717.35 → 2307.55 / 719.06
Total measured RPC calls 21,717 → 21,566 20,859 → 21,067

List p95 is eligible; list p99 is context only at fewer than 1,000 observations per side. Final memory follows forced GC outside the untraced window. Continuous background RPCs mean equal turn counts do not guarantee identical total work; CPU/turn and GC/turn include that background work.

Per-kind GC, RPC work, and synchronization
Pair / side GC kind Count Total, ms p95 / p99, ms Max, ms
1 / base minor 5357 57643.58 43.518 / 83.454 274.342
1 / base major 116 9699.46 155.646 / 228.350 318.180
1 / base incremental 116 231.44 2.958 / 10.046 11.379
1 / candidate minor 5066 51306.19 41.982 / 81.406 216.690
1 / candidate major 103 8147.06 159.742 / 244.734 248.017
1 / candidate incremental 103 324.85 5.086 / 59.902 66.595
2 / base minor 5511 43884.56 31.742 / 63.486 297.794
2 / base major 102 6153.34 125.438 / 260.094 337.840
2 / base incremental 102 207.99 3.934 / 6.014 6.410
2 / candidate minor 5518 43949.61 29.182 / 66.558 134.340
2 / candidate major 93 5611.76 115.710 / 197.630 250.073
2 / candidate incremental 93 240.44 3.918 / 6.270 40.987

Major and incremental pause percentiles are contextual where their counts fall below the 200/1,000 thresholds; total GC remains eligible.

RPC Pair 1, base → candidate Pair 2, base → candidate
agent 320 → 320 320 → 320
agent.wait 320 → 320 320 → 320
board.get 1094 → 1088 1066 → 1089
chat.history 551 → 536 519 → 535
connect 937 → 931 908 → 933
controlUi.sessionPullRequests.subscribe 2293 → 2285 2140 → 2150
github.preview 1720 → 1708 1685 → 1697
models.authStatus 2010 → 2005 1941 → 1957
models.list 1876 → 1864 1827 → 1831
sessions.describe 2148 → 2145 2055 → 2066
sessions.diff 744 → 733 715 → 733
sessions.github.options 1564 → 1557 1536 → 1553
sessions.list 359 → 339 320 → 345
sessions.patch 40 → 38 35 → 37
sessions.reset 16 → 16 16 → 16
sessions.usage 639 → 620 640 → 624
usage.cost 2426 → 2414 2211 → 2217
workboard.boards.list 1251 → 1245 1223 → 1246
workboard.cards.list 1409 → 1402 1382 → 1398

Pair 1: post-warmup releases differed by 0 ms; finish times differed by 8.71 s (0.41% solo tail).
Pair 2: post-warmup releases differed by 2 ms; finish times differed by 10.79 s (0.68% solo tail).

Successful-pair launch order was baseline/candidate, then candidate/baseline. The failed third attempt returned to baseline/candidate. The second setup originally failed before barrier release because another lane occupied its mock port; both sides were stopped and fresh fixtures used on free ports. No measured pair was discarded. The shared Mac has no supported CPU-affinity control: concurrent sides share scheduler contention.

Across the two completed pairs, GC/min improved 5.69% and GC/turn 6.21% as means of per-pair percentage changes; list p95 improved 18.05%. CPU/turn was approximately neutral (−0.72%). These are composite-workload observations, not isolated attribution. Loop p99 had mixed signs (−6.685 ms, +1.114 ms). Peak heap also had mixed signs: −22.43% then +784.42 MiB / +51.50%; mean paired peak heap increased 14.53%, and peak RSS increased 1.91%. Post-GC heap equality does not cancel the transient peak. The extra attempt and post-diagnosis follow-up failed as described below. The maintainer explicitly accepts the completed pairs under the deletion gate and classifies the later failures reproduced on both revisions as shared admission failures, not candidate regressions. The signed absolute delta divided by the mean baseline gives GC/min −5.70%, GC/turn −6.99%, CPU/turn −0.71%, loop p99 −2.62%, list p95 −20.45%, peak heap +14.42%, and peak RSS +2.25%; those are the predeclared mixed-sign gate calculations, distinct from means of per-pair percentages.

Reliability investigation

A diagnostic-only preload recorded the actual worker admit(false) decision, without evaluating lazy inputs early or changing limits/errors. Both revisions failed sessions.usage in the usage-read singleton pool:

Admission at first rejection Baseline Candidate
Pending tasks / limit 21 / 128 25 / 128
Pending input bytes 265,155,910 266,979,618
Rejected input bytes 16,434,668 16,438,038
Pending-byte limit 268,435,456 268,435,456
Completed cohorts before failure 1 4

There was no shared-compute admission on this pool. Follow-up owners: src/gateway/server-methods/usage-session-loading.ts:150 constructs the remainder batch; src/infra/session-cost-usage-worker-runtime.ts:340 accounts for input bytes; packages/worker-runtime/src/worker-task-admission.ts:34 rejects admission. Overview summary loading batches 256 sessions first, then the entire remainder; queued large reads can exhaust the byte budget even below the task-count cap. This demonstrates a pre-existing failure mode, not equal failure probability or exact retrospective attribution of the original uninstrumented candidate failure. Diagnostic timings do not contribute to performance acceptance.

The independent reviewer accepted one final bounded untraced comparison after this diagnosis: fresh fixtures, unchanged 64-client workload and limits, synchronized warm start, a target of 40 cohorts / 320 turns. It failed on both revisions with the same RPC error after seven/eight completed cohorts. The predeclared stopping rule ended further measurement, with no replacement run. The maintainer subsequently accepted the completed pairs for this production deletion. Every completed pair and all failures remain in this record. This is a demonstrated baseline failure mode, but these runs cannot establish equal failure probability or a reliability non-regression. The usage-read admission issue is a separate follow-up; this PR changes refresh bookkeeping only.

Initial sequential measurements

Initial sequential stress metric Baseline Candidate
Untraced duration 28.63 min 35.24 min
Main-thread CPU 356.37 s / 20.75% 338.37 s / 16.00%
Main-thread CPU per completed turn, including background RPCs 1,113.65 ms 1,057.40 ms
GC time 1.456 s/min 1.574 s/min
GC per completed turn, including background RPCs 130.26 ms 173.37 ms
Event-loop p99 (samples) 99.55 ms (70,277) 101.84 ms (86,455)
Event-loop maximum 1,211.11 ms 1,803.55 ms
sessions.list p95 (samples) 579.97 ms (330) 868.94 ms (349)
sessions.list p99, context only: fewer than 1,000 samples 1,039.65 ms 1,686.36 ms
Maximum single GC pause 467.41 ms 183.84 ms
Peak / final RSS 4,795.86 / 3,955.07 MiB 4,372.47 / 3,588.00 MiB
Peak / final heap 1,563.27 / 690.58 MiB 1,222.35 / 695.45 MiB
Separate allocation-pass duration / turns 10.42 min / 128 10.06 min / 112
Sampled main-isolate allocation rate 95.25 MB/s 88.74 MB/s
Sampled allocation per completed turn 465.36 MB 478.08 MB

Final memory is sampled after the harness's forced GC, outside the untraced diagnostics window. Untraced minor GC: 5,112 collections / 36.498 s → 4,963 / 48.765 s; major GC: 90 / 4.961 s → 87 / 6.411 s; incremental GC: 90 / 0.225 s → 87 / 0.302 s. Minor pause p95/p99: 24.830/62.718 → 39.934/77.310 ms; major p95/p99: 107.006/264.190 → 155.646/169.982 ms (context only at these tail sample counts).

The candidate took 23.1% longer with continuous polling. Equal turn counts therefore do not mean equal total RPC work. CPU/turn improved 5.1%, but GC increased 118 ms/min and 43.1 ms/turn, and eligible list p95 increased 289 ms. Lower allocation rate also coincided with slightly higher allocation per turn. These adverse measurements are retained, not dismissed as noise or hidden by a different normalizer.

Original follow-up declared before results (two completed pairs, one failed extra attempt, then the separately documented post-diagnosis failure): two concurrent untraced A/B pairs with fresh identically generated fixtures, immutable built runtimes, the same 40-cohort workload, and a synchronized post-warmup start. Swap launch order and ports for pair two. No owned builds, tests, or fixture generation during measurement. Report both GC/min and GC/turn as gates, per-method RPC counts, throughput, eligible tails, both maxima, and memory. Apply the paired relative rules and both absolute GC floors; one improved normalizer cannot cancel an adverse one. This shared Mac cannot pin CPU placement, so concurrency can couple resource contention and create unequal solo tails; those limitations remain explicit. A GC-based rejection requires the declared same-layout A/A controls; those controls do not waive a request failure. No allocation tracing is used for these timing/GC gates.

The benchmark uses synthetic 10,000-session state, 12,000 settled runs, 40 synthetic plugins, 64 WebSocket clients, eight concurrent mock-provider turns with tool calls, and sidebar/list/search/dashboard/usage churn. Timing and allocation are separate passes; traced GC is not used for timing acceptance. The shared Mac's host-sensitive timings are contextual, not a claim of isolated attribution.

Reproduce the measurements

The cold refresh uses scripts/perf/session-cost-refresh-measure.ts with separate fresh fixtures generated by team-shape-fixture.ts: 10,000 sessions, zero runs/projects/cron/approvals, 1 MiB transcripts, seed 967, fixed --now 1792886400000. The probe's header documents invocation. This additional tooling captures the real cold owner, because warm Gateway sampling starts after its initial backlog was queued.

The Gateway fixtures contain 10,000 sessions, 12,000 settled runs, 100 cron jobs, 12 projects, and 64 MiB transcripts, with the same seed/time. Each side uses its own state directory and loopback ports. The timing command is:

node --import ./scripts/tsx.mjs scripts/perf/transcript-broadcast-measure.ts \
  --state-dir <fresh-fixture> --entry dist/entry.js --scenario memory-soak \
  --clients 64 --exact-clients 4 --runs 8 --plugins 40 --row-mode sidebar \
  --chunks 500 --chunk-interval-ms 10 --warmup-ms 60000 --duration-ms 600000 \
  --soak-rounds 40 --round-interval-ms 15000 --memory-interval-ms 15000 \
  --retained-profile-ms 0 --stress-tools --mixed-rpc --dashboard-rpc \
  --list-filter-churn --usage-rpc --list-interval-ms 1000 --poll-seed lane1712 \
  --diagnostics --port 42712 --mock-port 42714 --revision <built-revision>

The allocation pass uses the same side's post-timing state, omits --soak-rounds, and adds --allocations --heap-sampling-interval 65536. Both passes run at least ten minutes. Main-isolate allocation sampling and GC tracing stay separate from untraced latency/GC measurements. No production Gateway was loaded or changed.

Acceptance declared before measurement: remove duplicate remainder bookkeeping with unchanged usage and repair contracts; small or neutral full-Gateway results are acceptable for net production deletion. Treat shared-host timings and under-sampled tails as context; investigate controlled material regressions, not tiny percentages on noisy baselines.

Both built artifacts use base a59c2197e14899488de553be245685a52a3d716a; the candidate adds this PR's changes. Upstream changes to unrelated Gateway paths mean these absolute stress figures must not be represented as measurements of the later rebased head. PR CI validates that final head.

Current disposition: accepted for landing by the maintainer. The benchmark-harness conflict has been resolved while preserving upstream preload, cron, worktree, and filtered-page behavior. The prior head passed CI; exact-head CI is required after this rebase. The overload path remains unchanged on inspected main 8eb642293ef9917e50b504911ee93de254db2dc5; no upstream fix is claimed.

@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@steipete
steipete marked this pull request as ready for review October 25, 2026 03:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T06:50:16.037273Z 5bf8e47 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes duplicate deferred-repair tracking and adds repeatable usage-refresh performance measurements.

Example: Cold backfill of 10,000 synthetic sessions.

  • Before: Deferred repair identifiers occupy both the pending queue and a temporary set.
  • After: Cleanup consults the pending queue directly, preserving repair handling with less bookkeeping allocation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct deletion supported by production-path measurements, with appropriately bounded performance claims and accepted shared-host limitations.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Supplied evidence exercises cold queued refresh through real workers and usage RPCs through isolated built Gateways on synthetic state, with completed backfills and recorded allocation results; the body distinguishes earlier measured builds from final-head CI and records maintainer acceptance of mixed stress results.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Cold usage backfill allocates redundant deferred-repair bookkeeping.
Reason: The change deletes production machinery, preserves the existing owner, and has explicit maintainer acceptance of the measured tradeoffs.

Merge readiness

✅ Ready for maintainer review

This PR is a useful, maintainer-approved simplification with no actionable correctness findings; the earlier conflict is resolved, and normal exact-head CI remains.

Priority: P3
Reviewed head: 5bf8e4784ab1bc709a4b0105bd110a6ddcf62305

Before merge

None.

Findings

None.

Agent review details

How this fits together

The usage-refresh scheduler receives transcript publications and repair requests, dispatches bounded work to existing workers, and exposes refreshed usage summaries to Gateway reports.

flowchart LR
  A[Transcript publications] --> B[Usage refresh queue]
  C[Usage report reads] --> B
  B --> D[Usage workers]
  D --> E[Usage projections]
  D --> B
  E --> F[Gateway usage reports]
Loading

Technical review

Best possible solution:

Retain the existing queue as the sole deferred-work tracker and land the narrow deletion through the normal CI gates.

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

Current-main source independently shows duplicate deferred-key bookkeeping; the supplied cold-worker measurements exercise its allocation cost, and no target code was executed during this review.

Is this the best way to solve the issue?

The smallest complete production change is the proposed queue lookup: existing enqueue operations already preserve canonical repair keys, while identity, retry, alias, and cancellation handling remain intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 385f80ac5fc9.

Provenance checked

  • Deferred repair tracking keeps the original intent (7aae49e: Bounded overview backfill needed to retain deferred repair identities between batches.)
  • Logical selectors and canonical repair keys keeps the original intent (b6d5dd3: Logical selectors can differ from canonical keys, so both continuation identities and matching repair facts must survive deferred work.)
  • Filtered-list benchmark workload keeps the original intent (5a43255: Reuse existing list filters during measured memory-soak traffic; this PR extends that workload with label churn and isolates list timing from the preceding patch.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff removes the remainder set and replaces its membership check with the existing pending queue; the repair-row identity check remains. (src/infra/session-cost-usage-cache-runtime.ts:567, 5bf8e4784ab1)
  • Current-main behavior: The runtime file is unchanged between the introduction base and fetched main, which still retains duplicate remainder tracking. (src/infra/session-cost-usage-cache-runtime.ts:528, 385f80ac5fc9)
  • Repair continuation contract: The earlier repair preserves logical selectors and canonical repair keys together; this PR retains that handling and the newer-row identity guard. (src/infra/session-cost-usage-cache-runtime.ts:536, b6d5dd3995fd)
  • Existing behavioral coverage: Existing tests cover deferred canonical repairs, logical aliases, bounded batches, busy retries, concurrent appends, and cancellation; no tests were added or weakened. (src/infra/session-cost-usage-refresh.test.ts:419, 5bf8e4784ab1)
  • Performance evidence and accepted tradeoff: The complete PR body reports reduced cold-callback allocation, two completed Gateway comparisons, adverse memory observations, and overload failures on both revisions, with explicit maintainer acceptance for this production deletion; whole-refresh speedup and reliability equivalence are expressly unclaimed. (5bf8e4784ab1)
  • Prior review disposition: GitHub reports the reviewed head as mergeable and ready for review; the previous comparison request is addressed by the completed measurements and recorded acceptance. (5bf8e4784ab1)

Likely related people:

  • Peter Steinberger: Raw commit 7aae49e adds src/infra/session-cost-usage-cache-runtime.ts:413 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7aae49e8677b; files: src/infra/session-cost-usage-cache-runtime.ts)

PR surface

Source -2, Other +200. Total +198 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 3 -2
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 206 6 +200
Total 3 207 9 +198

Review metrics

Metric Value Why it matters
Benchmark CLI surface 4 benchmark-only options Adds --usage-rpc to the existing soak and --state-dir, --output, and --timeout-ms to the cold probe; production configuration is unchanged.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a small internal allocation improvement with preserved usage-report behavior and no urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • 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 (1 earlier review cycle)
  • reviewed 2026-10-25T03:32:22.907Z sha 10dbfef :: needs changes before merge. :: none

Reviewed October 25, 2026, 2:52 AM ET / 06:52 UTC (Revision 2).

@steipete
steipete marked this pull request as draft October 25, 2026 06:27
Use canonical repair keys already recorded in the pending session queue
instead of retaining a second set of every deferred transcript identifier.
Preserve alias, retry, publication and cancellation handling without
changing token or cost totals. Production code shrinks by two lines.

Extend the synthetic memory-soak harness with search and usage-report
churn, keeping list RPC timing separate from its preceding label update.

Validation: 22 focused refresh tests pass on base and candidate; changed
files pass formatting and lint. Independent review is clean after the
configured autoreview route proved unavailable.
@steipete
steipete force-pushed the steipete/perf-micro-cost-usage-refresh-20260919 branch from 10dbfef to 5bf8e47 Compare October 25, 2026 06:44
@steipete
steipete marked this pull request as ready for review October 25, 2026 06:48
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 7efdb87 into main Oct 25, 2026
197 of 199 checks passed
@steipete
steipete deleted the steipete/perf-micro-cost-usage-refresh-20260919 branch October 25, 2026 06:59
steipete added a commit that referenced this pull request Oct 25, 2026
Replace the deprecated ambient loadConfig call introduced by #183186 with the awaited async config reader used by sibling benchmarks. Load the synthetic run config before profiling begins.

Proof: deprecated-internal-config-api contract test fails on base and passes with this change (1 test). Focused Oxlint typechecking, format check, git diff --check, and Codex review pass. The scripts-wide typecheck cannot start with the external dependency layout.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…enclaw#183186)

* perf(usage): avoid duplicate backfill remainder tracking

Use canonical repair keys already recorded in the pending session queue
instead of retaining a second set of every deferred transcript identifier.
Preserve alias, retry, publication and cancellation handling without
changing token or cost totals. Production code shrinks by two lines.

Extend the synthetic memory-soak harness with search and usage-report
churn, keeping list RPC timing separate from its preceding label update.

Validation: 22 focused refresh tests pass on base and candidate; changed
files pass formatting and lint. Independent review is clean after the
configured autoreview route proved unavailable.

* test(perf): measure cold session usage refresh allocation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Replace the deprecated ambient loadConfig call introduced by openclaw#183186 with the awaited async config reader used by sibling benchmarks. Load the synthetic run config before profiling begins.

Proof: deprecated-internal-config-api contract test fails on base and passes with this change (1 test). Focused Oxlint typechecking, format check, git diff --check, and Codex review pass. The scripts-wide typecheck cannot start with the external dependency layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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