Repository navigation
feat: report session list CPU time in diagnostics - #149291
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 17, 2026, 2:09 AM ET / 06:09 UTC (Revision 18). ClawSweeper reviewWhat this changesAdds six session-list CPU measurements to diagnostics and benchmark summaries, documents and tests their attribution, updates the approved UI bundle budget, and repairs Slack test fixtures. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, maintainer-sponsored contribution that current main does not replace. No blocking correctness defect was found; the recorded acceptance of measurement overhead does not require another decision. Priority: P2 Review scores
Verification
How this fits togetherGateway session lists and subscription snapshots turn stored sessions into visible rows. The existing diagnostics owner records selected processing costs for logs and benchmark summaries without changing the returned list. flowchart TD
A[Session list or subscription request] --> B[Cache selection]
B -->|New work| C[Load session store]
C --> D[Prepare and construct rows]
D --> E[Publish cached result]
B -->|Hit or follower| F[Respond to caller]
E --> F
C --> G[CPU diagnostics and benchmark summaries]
D --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +93, Tests +275, Docs +19, Other +6. Total +393 across 12 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep CPU accounting within the existing diagnostics owner, preserve its request-local attribution, and retain the accepted overhead caveat without implying a performance improvement. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: current main exposes elapsed session-list timings, and this PR adds CPU attribution. No target code was executed during this read-only review. Is this the best way to solve the issue? Yes. Extending the existing diagnostics and benchmark owners is a focused solution, and the implementation preserves activation, response behavior, and cache ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12a483edfbcb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (17 earlier review cycles; latest 8 shown)
|
3925f87 to
43b5188
Compare
d70c745 to
90485b4
Compare
90485b4 to
ea7c33e
Compare
Retain the hosted PR ancestry while integrating the current shared session-projection work budget. The complete tree matches the reviewed and tested session-list CPU diagnostics candidate.
Integrate current main, including the memory-test CI repairs. Strengthen the existing producer/follower test with a real yield between two rows while preserving exact CPU attribution and cache assertions. The strengthened case passes and rejects a deliberate probe spanning the row wait: 1006 ms observed instead of the expected 6 ms. Independent complete-candidate review through P2 is clean.
Keep synchronous CPU intervals around the current flattened model-source contract from main. Preserve the captured reader and fresh sharing entry during row projection and active-model refresh. The refreshed candidate passes 40 focused tests and independent review through P2. Production typechecking passes; the owning test-type graphs and final lint checks are being completed separately.
Restore three newly imported modules in the shared native PR wrapper inventory. Observe fs-safe Root.read through its current final-fence hook while preserving all aggregate byte, status, and inventory assertions. Both defects reproduced before repair. All 24 plugin-skill bundle cases pass; nine focused native-wrapper cases pass on Blacksmith Testbox with unchanged limits. Independent review through P2 is clean.
Give the shared receiver mock real EventEmitter listener ownership and an asynchronous acknowledgement sender, preserving the production envelope guard. Narrow WebSocket ArrayBuffer data before converting it so the loopback test typechecks without copying an existing Buffer. The former ingress-cleanup failure reproduces before this repair; all 120 selected Slack tests and the extension test-type graph pass afterward.
|
Merged via squash.
|
Retain main’s Slack RawData typing correction from openclaw#149291. Completion source and public resolver tests are byte-identical to qualified 9c53517.
* feat(gateway): measure synchronous session-list CPU * fix(ci): repair native wrapper and skill-read checks Restore three newly imported modules in the shared native PR wrapper inventory. Observe fs-safe Root.read through its current final-fence hook while preserving all aggregate byte, status, and inventory assertions. Both defects reproduced before repair. All 24 plugin-skill bundle cases pass; nine focused native-wrapper cases pass on Blacksmith Testbox with unchanged limits. Independent review through P2 is clean. * fix(ci): refresh measured UI budget and cold worktree fixture Record the approved 362706-byte startup baseline under a 355 KiB cap, preserving the 512-byte growth and 64-byte variance allowances. Exact base and merge builds emitted byte-identical UI assets; hosted CI measured the same size. Include the newly imported bundled plugin source utility in cold worktree fixtures, matching the repair already landed in openclaw#109506. Preserve all assertions and timeouts. * test(slack): align Socket Mode fixtures with SDK acknowledgements Give the shared receiver mock real EventEmitter listener ownership and an asynchronous acknowledgement sender, preserving the production envelope guard. Narrow WebSocket ArrayBuffer data before converting it so the loopback test typechecks without copying an existing Buffer. The former ingress-cleanup failure reproduces before this repair; all 120 selected Slack tests and the extension test-type graph pass afterward.
Related: #145679
What Problem This Solves
Session-list elapsed timings cannot identify which synchronous stages consume CPU when requests also yield or wait.
User Impact
Operators can inspect six optional current-thread CPU timings in existing session-list diagnostics and benchmark summaries. Responses, diagnostic activation, and the one-second warning threshold stay unchanged. Measurement overhead remains uncertain; this change makes no performance improvement claim.
The maintainer decision is to proceed for diagnostic utility with the disclosed overhead uncertainty. The unfavorable measurements remain part of the evidence.
Why This Change Was Made
Measure store loading, preparation, row construction, cache selection, cache publication, and synchronous response work in fractional milliseconds. Preparation and row measurements accumulate synchronous chunks and finish before registry readiness, scheduler waits, or unrelated microtasks run. They exclude worker CPU and diagnostic delivery and do not form a complete request CPU total. Hits and followers retain only their own work.
The integration uses main's shared list/detail projection work budget and preserves captured state context and admission checks, cache invalidation and one-second live reuse, and fixed expiration deadlines. Row CPU surrounds input reading, materialization, and presentation in main's current row pipeline. Metadata-only lists still skip transcript preparation, including its CPU probes. Parameter and timing types remain private to the list owner, avoiding the earlier shared-contract import cycle.
The inactive path reuses existing callbacks without additional measurement callbacks or selection result records. A failed CPU counter read omits all CPU fields for that request while preserving its response or original error.
Evidence
38d75d103205incorporates mainde4cb3de1cadand preserves the reviewed diagnostics integration fromdc402d97dfbdand main's flattened captured model-source contract. That unchanged integration passed 40 Gateway tests, production and owning test types, targeted lint/format checks, and independent review through P2. The preceding9fb487c84f84also passed a broader 98-test/nine-file suite; that is earlier proof, not a rerun on every integration. The CI follow-up passed the complete three-file changed gate and fresh independent review through P2. After resolving a subsequent main conflict by adopting its shared cold-fixture discovery (fix(pr): unify worktree source checks and suppress automatic repacks #150399), all 90 budget/worktree tests passed again. The ten diagnostics and budget files are byte-identical to the reviewed candidate; the worktree fixture and wrapper match main.7b6094ec7b7dand mergeb524940307fcproduced all 1,985 UI output files byte-identically, with both measuring 362,706 startup gzip bytes; none of the eight feature paths appears in the 333 source maps. This establishes zero UI growth from the feature in that local comparison. Darwin/Node 24.21.0 differs from CI's Linux/Node 24.20.0; the comparison does not replace hosted CI. The final follow-up changes CI budget policy; its temporary fixture repair was superseded by main. There is no user-facing UI change.Buffer.from. A local ingress-cleanup case reproduced the mock failure. The test-only repair uses a real EventEmitter with an async acknowledgement spy and narrows ArrayBuffer data; production guards, assertions and timeouts remain unchanged. All 120 selected Slack tests across nine files, including real SDK acknowledgement loopbacks, pass, as does the extension test-type graph. Independent review through P2 and formatting pass. Local packaged lint was blocked by ancestor dependency lookup in the native worktree; final-head hosted lint passed.38d75d103205, including the required CI gate, UI budget, packaged lint, test types and selected tests. The native watcher returned GREEN. Current-head measurement overhead remains unquantified; the disclosed diagnostic-utility tradeoff is unchanged.Earlier validation and overhead measurements
The first two results describe head
271d00a11d37; subsequent results identify their older revisions.