Repository navigation
docs(diagnostics): clarify whole-process CPU metrics - #138804
Conversation
Explain that diagnostic CPU ratios include worker and native threads, use core equivalents, and can exceed one. Distinguish process pressure from main-thread delay without changing measurements or readiness.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 4, 2026, 10:59 PM ET / September 5, 2026, 02:59 UTC. ClawSweeper reviewWhat this changesClarifies that diagnostic CPU ratios measure whole-process CPU usage, including worker and native threads, in documentation and exporter descriptions. Merge readiness✅ Ready for maintainer review Keep open. The clarification remains useful and is absent from fetched main and the latest release’s health guide. No actionable correctness or security defects were found. Priority: P3 Review scores
Verification
How this fits togetherGateway diagnostics combine process CPU timing with separate event-loop measurements. Readiness snapshots and telemetry exporters expose these observations to operators. flowchart LR
A[Process CPU time] --> C[Diagnostic sampling]
B[Wall time and event-loop measurements] --> C
C --> D[Readiness diagnostics]
C --> E[Prometheus and OpenTelemetry]
D --> F[Operator interpretation]
E --> F
G[Health guide and metric descriptions] --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Docs +31. Total +32 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the health guide as the shared semantic reference, with matching exporter descriptions that preserve established measurements. Do we have a high-confidence way to reproduce the issue? Not applicable: this clarifies existing measurement semantics rather than repairing a runtime failure; source and existing exporter tests support the explanation. Is this the best way to solve the issue? Yes. Updating the existing descriptions resolves the ambiguity directly; changing measurement behavior or adding per-thread metrics would unnecessarily expand the scope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c748cd5714b8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Validated the six-file candidate at The exact local commands passed: node --import ./scripts/tsx.mjs scripts/test-projects.mts extensions/diagnostics-prometheus/src/service.test.ts extensions/diagnostics-otel/src/service.test.ts -t 'liveness warning'
node scripts/check-docs-mdx.mjs docs README.md
node scripts/check-changed.mjs -- docs/gateway/health.md docs/gateway/diagnostics.md docs/gateway/prometheus.md docs/gateway/opentelemetry.md extensions/diagnostics-prometheus/src/service.ts extensions/diagnostics-otel/src/service-metrics.tsThe two selected exporter tests retain a CPU ratio of 1.4, MDX checked 752 files, and the supported local changed-file gate passed all selected guards. Independent P0–P2 review was clean. Production LOC is +3/-2 (description strings and wrapping), test LOC is unchanged, and docs are +32/-1. The six changed files and their six diagnostic producer/consumer owners have no drift between the proof base and the inspected main baseline Proof limits remain explicit: the first Testbox attempt refused an unexpected source entry before running any checks; its lease is closed and no remote pass is claimed. The full anchor audit found 12 preexisting ClawHub links to unchanged manifest/SDK pages and no failing changed-page links. This wording-only repair does not claim a production performance improvement or thread-level CPU attribution. Current-head CI run 33940357329 completed successfully. ClawSweeper reviewed this same head with no findings and no before-merge actions. The live PR rollup is 99 successful and 54 skipped checks, with a clean merge state. |
|
Merged via squash.
|
Explain that diagnostic CPU ratios include worker and native threads, use core equivalents, and can exceed one. Distinguish process pressure from main-thread delay without changing measurements or readiness.
* refs/remotes/origin/main: (602 commits) fix(plugins): trace trust refusals and repair legacy provenance (openclaw#138746) perf(sqlite): reuse compiled plugin state point reads (openclaw#138758) refactor: type chat prefetch dependencies and clean loading tests (openclaw#138793) ci: reduce Doctor test startup and core lint jobs (openclaw#138796) feat(update): retain run history and share outcome reports (openclaw#138690) chore(deps): update @openclaw/fs-safe to 0.8.1 (openclaw#138500) fix: preserve global board ownership from pinning to notifications (openclaw#138675) fix(gateway): deliver session catalog updates from slow hosts (openclaw#138674) perf(sessions): index pending conversation replies (openclaw#127182) perf(auth): reuse ordered provider alias entries (openclaw#138805) docs(diagnostics): clarify whole-process CPU metrics (openclaw#138804) perf(memory): narrow source reads and stream embedding cache rows (openclaw#138766) fix: allow older source on newer Testbox checkouts (openclaw#138782) fix(agents): preserve recovered task progress and lifecycle ownership (openclaw#138785) perf(codex): reduce rollout tail scan CPU (openclaw#138784) perf(gateway): stop projecting history deltas at the byte budget (openclaw#138655) fix(build): bound native declaration inputs to checkout (openclaw#138742) fix(cli): preserve foreground Gateway argument handling (openclaw#138765) fix(ui): align task toolbar with side-panel tabs (openclaw#138769) fix(logbook): drain accepted work before closing SQLite (openclaw#138754) ... # Conflicts: # src/agents/embedded-agent-runner/compact.queued.ts
What Problem This Solves
Operators can mistake the diagnostic CPU core ratio for main-thread utilization or a percentage capped at 100%. The existing metric measures CPU time across the whole process, including worker and native threads.
Why This Change Was Made
Clarify the Prometheus HELP text and OpenTelemetry description, with a shared health-guide explanation of core equivalents and values above one. Phase diagnostics also explain that concurrent work contributes to their process CPU totals.
Node's CPU usage contract and the existing diagnostic producers establish these semantics. Metric names, fields, measurements, thresholds, readiness behavior, and configuration stay unchanged. The production diff is description text only (+3/-2 lines, including formatting); documentation is +32/-1.
User Impact
Operators can distinguish whole-process CPU pressure from measured main-thread delay when reading metrics and health snapshots. A CPU degradation reason alone does not attribute CPU to a thread or prove a main-thread hang.
Evidence
git diff --checkpassed.plugin-validation-fixes.md, targeting unchanged manifest/SDK pages; no changed-page link failed.No runtime behavior changed, so the existing exporter tests and source contract review cover this wording repair; no additional production CPU workload was run.