Repository navigation
chore(test): retain Doctor fixture settlement diagnostics - #155944
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: needs changes before merge. Reviewed September 22, 2026, 5:14 PM ET / 21:14 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds bounded diagnostics to Doctor configuration tests showing unfinished operations, fixture settlement, and overlapping fixtures while keeping successful runs quiet. Merge readiness⛔ Needs changes before merge - 1 item remains The work remains useful and is absent from current main. No actionable code defect was found; the prior timing follow-up is partially resolved, with the cost justification still outstanding. Priority: P3 Review scores
Verification
How this fits togetherDoctor checks and repairs OpenClaw configuration. These test fixtures exercise that flow in temporary homes and report lifecycle observations to CI logs when tests fail or remain unsettled. flowchart TD
A[Doctor configuration tests] --> B[Temporary home fixture]
B --> C[Existing Doctor operations]
C --> D[Bounded phase observations]
B --> E[Fixture settlement]
D --> F{Failed or unsettled?}
E --> F
F -->|Yes| G[Diagnostic receipt in CI logs]
F -->|No| H[Quiet completion]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +197. Total +197 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep diagnostics in the existing fixture owner, preserving failure behavior and cleanup while making future timeout investigation more informative. Do we have a high-confidence way to reproduce the issue? Not applicable to this diagnostic-only patch: the original CI timeout is documented, but no deterministic current-main reproduction or causal repair is claimed. Is this the best way to solve the issue? Yes. Observing existing promises and the existing fixture lifecycle is a focused approach that preserves assertions and avoids changing timeout or cleanup policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b060cfed1b71. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat 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
History |
|
Merged via squash.
|
* commit '7d7f977ccfc1ac177526232e4f4960febd010015': (91 commits) test: avoid unused target setup in package profile fixtures (#155972) fix(worktrees): batch snapshot metadata reads test(plugin-state): distinguish borrowed and foreign lifecycle owners refactor(agents): share external harness session and attempt machinery (#152181) chore(i18n): refresh native locales (#156006) chore(test): retain Doctor fixture settlement diagnostics (#155944) perf(codex): reuse unchanged inference request bytes (#155987) perf(test): prepare snapshot ownership subprocess imports (#155973) perf(test): consolidate channel registry coverage (#155014) fix(runtime): preserve Node worker dependencies and cleanup diagnostics (#155292) perf(test): prepare worktree GC child runtime (#155928) fix(ui): open browser cards after delayed panel renders (#153253) fix(update): retain the running updater by hard link instead of copying the package (#155977) feat(decisions): add explicit evaluation and Labs opt-in foundation (#155134) fix(state): preserve lifecycle custody across worker dispatch improve: reuse shared tooling fixtures and defer legacy updater proof (#155731) improve(ui): reduce real-Gateway test preparation (#155979) perf(state): move session RPC SQL off the Gateway main thread (#155740) docs(freebsd): explain native Codex runtime limits (#155980) fix(qa): count Code Mode nested tool activity as transcript tool evidence (#155976) ...
Related: #155905
What Problem This Solves
Doctor configuration tests can time out without identifying the unfinished operation or showing whether their temporary-home fixture settled before the next case began.
User Impact
No user-visible or runtime behavior change. Failed or unsettled test fixtures emit bounded diagnostic receipts; successful fixtures remain quiet. This is an observation change, not a claimed fix for the CI failure.
Why This Change Was Made
Observe the existing awaited phases in the two affected suites and report body/fixture settlement, outstanding phases, and overlapping fixtures. Preserve the original test order, deadlines, mocks, temporary-home ownership, SQLite worker-scope reuse, and cleanup. Receipts contain static labels, synthetic identifiers, timings, and a home-ownership boolean, without paths, configuration contents, or credentials. The finished hook observes state after existing afterEach hooks; it does not identify the exact timeout instant or establish causality.
Evidence
7a1e0c520b33d2f5967645f25967086bd32bdc69found no actionable issues; the pinned Vitest 5 hook/state contract was inspected directly. Syntax, pinned oxfmt, andgit diff --checkpass. Test-only delta: +300/-103; production delta: zero.[doctor-fixture]receipts appeared on this successful run. Source/input hashes, clean tracked source, non-shared dependency directories, Node 24.19.0, pnpm 12.4.0, and patched Vitest 5.0.0 passed before/after guards. The test command exited, and the one-shot lease closed: https://github.com/openclaw/openclaw/actions/runs/35781238902. Native one-shot cleanup can mark the backing workflow cancelled even when the delegated command passes.hosted-2group with the same 24 files and order, timing key, config, fallback worker limit of 2, and plan concurrency of 1. This was planner evaluation only; no full qualification was dispatched. Ordinary PR CI may select a smaller changed-consumer group.Measured test costs
Ordinary exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/35782086482.
--maxWorkers=1command wallsrc/commands/doctor-config-preflight.test.tssrc/commands/doctor-config-flow.billing-route.test.tsdoctor-config-preflight.test.ts(94.95 s) protects the real preflight boundary between active config files, last-known-good recovery, and SQLite state. Its cases verify updater write ownership, profile/custom-path selection, repair of readable legacy config before fallback recovery, preservation of agent ownership and state locators, durable rereads, and idempotent recovery without extra clobber backups. A pure migration/schema test can check transformed objects; it cannot prove that the actual preflight selects and preserves the correct file and state store across repair and reread. This fixture change therefore retains the existing file’s integration coverage and case order, including repeated calls and shared worker-scope cleanup.doctor-config-flow.billing-route.test.ts(111.23 s) protects billing-route migration and update-ledger commit ordering through real Doctor context preparation and config writes. It checks inherited routes for single/multiple agents, warning deduplication after repeated writes and a fresh context, and deferred model retirement through both update correlation channels. Completion must follow a durable valid config write; missing correlation must leave the run unchanged, and write refusal must preserve the deferred receipt and original file. Mocking migration, auth-store reads, config persistence, or the ledger would remove these cross-owner assertions; a resolver-only or receipt-formatting unit test cannot prove them.These measurements are the existing file-level execution cost, including startup/compilation, not a claim that every second is irreducible or that observer overhead has been isolated. The scoped proof retains these persistence/lifecycle boundaries; it does not reproduce the original shared-shard timeout.
Single-worker measurements ran
time -p corepack pnpm test <file> --maxWorkers=1sequentially, preflight then billing, on exact head7a1e0c520b33d2f5967645f25967086bd32bdc69: https://github.com/openclaw/openclaw/actions/runs/35783965610. The receiver had 4 logical CPUs and 16.56 GB RAM, Node 24.19.0, pnpm 12.4.0, and the pinned patched Vitest 5.0.0. Both commands exited 0; final source/input and runtime guards passed, diagnostic receipts stayed quiet, and the native one-shot lease closed. Wall times include the package-manager/test wrapper and startup/compilation, excluding dependency installation; they do not isolate observer overhead.The CI jobs configured
OPENCLAW_VITEST_MAX_WORKERS=2and ran each selected file in a separate Vitest invocation. The billing job observed 2 logical CPUs and 8.22 GB RAM, with 2 outer plans requested and 1 admitted; the actual Vitest pool cardinality was not emitted. The affected files belonged to different changed-test jobs, so this is not the original shared 24-file shard. Within-file test order and deadlines remain unchanged.