Repository navigation
fix: keep the full Doctor timing line in update reports - #206290
fuller-stack-dev merged 3 commits into
Conversation
…stic Each Doctor step now traces a doctor.pending.<step> decision. The update's section-timing collector counted those zero-length entries as timed sections, so they filled the bounded "Doctor sections" line and cut off the late sections and the slowest contributions. The collector now skips pending decisions; the startup trace itself is unchanged.
…iagnostic-pending
|
🦞👀 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: passed. What this changesThis PR excludes Doctor pending decisions from update timing summaries while preserving operator-enabled traces. Example: A captured Linux first-update trace contains 153 Doctor lines, including 73 pending decisions.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep open: current main still admits pending decisions into timing diagnostics, and this PR makes a focused correction with no blocking code findings. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherUpdate Doctor runners stream child stderr through the timing collector, which converts startup-trace durations into bounded step diagnostics for update reports. flowchart LR
A[Doctor maintenance] --> B[Startup trace on stderr]
B --> C[Update timing collector]
C --> D[Timed sections and contributions]
D --> E[Update step diagnostics]
E --> F[Run record and JSON report]
Technical reviewBest possible solution: Exclude pending decisions in the existing timing collector while preserving the producer's trace and existing bounds. Do we have a high-confidence way to reproduce the issue? Current-main source admits doctor.pending entries as sections, and the supplied base failure trace demonstrates the resulting truncation; no target code was executed during this review. Is this the best way to solve the issue? The filter repairs classification at its existing owner without raising limits, removing producer evidence, or adding another diagnostic path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3ffd7660334a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +77. Total +80 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 26, 2026, 9:00 PM ET / November 27, 2026, 02:00 UTC. |
|
Merged via squash auto-merge.
|
) * fix(update): keep Doctor pending decisions out of the sections diagnostic Each Doctor step now traces a doctor.pending.<step> decision. The update's section-timing collector counted those zero-length entries as timed sections, so they filled the bounded "Doctor sections" line and cut off the late sections and the slowest contributions. The collector now skips pending decisions; the startup trace itself is unchanged. * test(update): type the Doctor sections replay helper
Related: #204775
What Problem This Solves
openclaw updaterecords a "Doctor sections" diagnostic for each Doctor it runs: where the Doctor's time went, section by section, plus its five slowest contributions. Update reports and outage investigations rely on that line. Since #206152, each Doctor step also writes adoctor.pending.<step>decision to the startup trace (about 94 per run). The update's collector counted each decision as a 0.0 s section, so on a first update the line hit its 1024-character limit after about 17 decisions. Everything afterconfig-flowwas cut:contributions,external-config,maintenance-ready,sqlite-reclamation,maintenance.finish,maintenance.release, and the whole "slowest contributions" list.User Impact
The update run record and
update --jsonoutput carry the full Doctor timing line again, with the same content they had before #206152. No user-visible behavior changes otherwise. The startup trace still has everydoctor.pending.<step>line whenOPENCLAW_GATEWAY_STARTUP_TRACE=1is set by the operator, and later Doctor work depends on that.Update behavior. The collector runs in the release that owns the Doctor child:
createUpdateDoctorSectionTimingis called by this release's package/fresh Doctor runners and by its finalization. A published driver (for example 2026.11.10) hands its Doctor run to the new release, so the first update onto a release with this fix already gets the full line. Nothing in the installed updater changes; no stored field, run-record shape, limit or config changes.Why This Change Was Made
A pending decision is not a timing; its 0.0 ms duration is the cost of a read-only check. The section-timing owner (
src/infra/update-doctor-section-timing.ts) now skips trace names that start withpending.when it collects phases, so they use neither the line's length budget nor its 256 phase slots. I did not raise the length limit, and I did not add a summary of decisions (no consumer for it exists). The Doctor's trace emitter (traceDoctorMaintenancePending) is untouched.Competing explanation ruled out: the line was not already near its limit before #206152. The same captured trace with the pending lines removed (what the parent of
d0f76989509emits; the owner file has no commits in between) produces a 690-character line with every section.Evidence
Tested commits: red on
origin/main2ab7b31a13d, green on this PR's heada93cc2d4bdc.Real capture. One
doctor --fixtrace from a real first update on Linux (npm global, systemd user Gateway): published 2026.11.10 as the driver, a candidate packed frommainatfcc9a0648c2(after #206152). 153 Doctor trace lines, 73 of themdoctor.pending.*. The recordings replay that stderr throughcreateUpdateDoctorSectionTiming().wrap(...)andannotate(...), the same calls the update's Doctor runners make, then run the owner's tests. I did not run a new update cell for this change: the fix is inside the line collector, and the capture already contains the exact Doctor output an update feeds it.2ab7b31a13d: line length 1024, truncated, 17 pending entries, 6 sections and the slowest contributions missing. The new regression test fails.a93cc2d4bdc: line length 690, not truncated, no pending entries, every section present. Byte-identical to the line the same owner produces from the pre-refactor: record which doctor --fix steps have work before the Gateway stop can become conditional #206152 shape of the trace.….OPENCLAW_GATEWAY_STARTUP_TRACE=1set by the operator, the wrapped Doctor stderr is returned unchanged, with everydoctor.pending.line.Red, base
2ab7b31a13d:doctor-sections-red-base-2ab7b31a13d.mp4
Green, head
a93cc2d4bdc:doctor-sections-green-head-a93cc2d4bdc.mp4
Raw: red replay and tests on base
Raw: green replay and tests on head
Test file audited:
src/infra/update-doctor-section-timing.test.ts(whole file). Added three cases: the regression (fails onmainwith the truncated, pending-filled line), the operator-trace pass-through, and the bound on long timed lists (no prior test covered truncation). The two existing cases (chunked UTF-8 decoding with trace stripping and retirement widenings; observer stop/throw after a display failure) cover distinct behavior and stay unchanged. Nothing removed.Commands and results (on
a93cc2d4bdc; later commits on the branch type the test helper and mergemain, headd21fce2d59a, owner test rerun there: 8 passed):node scripts/run-vitest.mjsover the owner test and its consumers (update-command-package-doctor,update-command-fresh-doctor,update-finalization-lifecycle,progress): Test Files 2 passed (2); Tests 37 passed (37); Test Files 3 passed (3); Tests 162 passed (162).node scripts/check-changed.mjs --base origin/main: exit 0 withOPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1(core typecheck, core test typecheck, lint, guards). The dead-export scan fails onmainitself for three exports this PR does not touch (readUpdateDatabaseEngineConfig,DoctorContributionPending,formatUpdateSnapshotCapacity).git diff --check: clean. Autoreview (Codex): scoped-clean, no findings.Not proven: no new end-to-end update cell on this head; macOS and Windows Doctor traces were not replayed (the collector is platform-independent).