Repository navigation
fix(cpu): account late-discovered session processes - #112
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 7, 2026, 7:52 PM ET / 23:52 UTC. ClawSweeper reviewWhat this changesThe Linux CPU collector accepts processes born during sampling but discovered later, using their lifetime counters and elapsed lifetime to calculate CPU usage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain The reported discovery gap remains on main, so this PR is still useful. However, its lifetime averaging can incorrectly certify CPU budget compliance and needs a focused correction. Priority: P2 Review scores
Verification
How this fits togetherKova samples OpenClaw processes and their wait owners to measure product resource usage. Its CPU accountant feeds per-process and aggregate measurements into release qualification thresholds. flowchart TD
A[OpenClaw processes] --> B[Process discovery]
B --> C[Linux counters and clocks]
C --> D[CPU baseline accounting]
D --> E[Resource summaries]
E --> F[CPU budget evaluation]
F --> G[Pass fail or blocked]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain session-birth detection while admitting only conservative interval evidence, leaving unresolvable discovery gaps BLOCKED and lifetime averages diagnostic. Do we have a high-confidence way to reproduce the issue? Yes, from source: main rejects delayed discovery after a process's birth, and the patch's new denominator admits a calculable false-pass case. These paths were inspected, not executed. Is this the best way to solve the issue? No. Session-birth detection is useful, but substituting a lifetime average violates the established interval-bound contract consumed by qualification. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b30b95e12f3. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Exact release proof is now green with the frozen target's schema-compatible fixture contract:
The previous proof run forced the newer canonical config fixture, causing the 7.33 gateway to reject |
A late-discovered process could turn a 225% CPU interval into a passing 187.5% lifetime average. Preserve conservative interval bounds and block qualification when earlier CPU evidence is missing. Carry discovery gaps through later product-role assignment and child counter transfers without invalidating fully observed product children of external supervisors. Keep existing CPU thresholds unchanged. Related: #112. Preserve @RomneyDa's session-birth discovery contribution.
Summary
Why
OpenClaw 2026.7.33 performance validation twice produced a single blocked repeat while all product CPU/RSS budgets passed. The resource sampler began before
ocm service start, but the Gateway PID became discoverable several samples later./proc/<pid>/statproved the Gateway was born after the sampler's initial Linux clock, yet the accountant rejected it as an unbaselined historical process.For a process born after the session baseline, its cumulative Linux CPU counters cover its complete lifetime inside the measurement session. Dividing those counters by its measured lifetime gives valid evidence without importing pre-session work.
Validation
npm run test:cpu-accounting— 19 passed, 8 platform skipsnpm run check:fulladvanced through all CPU-accounting tests; the subsequent self-check isolation test hit an unrelated local JSON timeout on Node 24.15.0git diff --checkRelease evidence
f9e17bacb91b85d28456df15c504ea324c96859cMissing CPU baseline for process 32164