Repository navigation
perf(update): defer optional lint during candidate validation - #155244
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 21, 2026, 9:23 PM ET / September 22, 2026, 01:23 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor, OpenClaw’s diagnostic CLI, defers optional inspections during private update validation, avoids their runtime metadata preparation, and reports follow-up commands. Merge readiness⛔ Blocked before merge - 1 item remains This remains useful work absent from the pinned main branch. No blocking defect was found, and the supplied published-driver upgrade evidence resolves the previous compatibility-proof concern. Priority: P2 Review scores
Verification
How this fits togetherThe updater runs candidate Doctor checks against a private copy of existing state before activation. Doctor selects diagnostics and returns findings to the updater, alongside separate migration, configuration, plugin, and Gateway readiness checks. flowchart TD
A[Installed updater] --> B[Private candidate state]
B --> C[Doctor lint selection]
C --> D[Required and plugin checks]
C --> E[Deferred optional inspections]
D --> F[Readiness result]
E --> G[Warnings and follow-up commands]
F --> H[Remaining validation and activation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +40, Tests +161, Docs +9. Total +210 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep optional diagnostics outside the candidate’s critical validation work while retaining mandatory gates and explicit commands to complete deferred inspections. Do we have a high-confidence way to reproduce the issue? Yes for unnecessary lint work: pinned main prepares runtime metadata and runs optional inspections during candidate validation, and the supplied comparison measures that cost. The reporters’ complete timeout failures were not reproduced by this review. Is this the best way to solve the issue? Yes. Reusing the existing inspection classifications and private-copy marker contract avoids a competing policy owner, preserves standalone selection, and works with the already-published updater. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c803800ac2bc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
…155312) Record cleanup phase failures through the test runner while preserving failed SQLite custody and continuing independent cleanup. Keep the lease for the existing process-death stale-lease sweep pending the retirement-fact decision. Include the exact lease identity in the host-broker refusal without changing cleanup authority or aggregation behavior. Refs #155244, #154920.
…penclaw#155312) Record cleanup phase failures through the test runner while preserving failed SQLite custody and continuing independent cleanup. Keep the lease for the existing process-death stale-lease sweep pending the retirement-fact decision. Include the exact lease identity in the host-broker refusal without changing cleanup authority or aggregation behavior. Refs openclaw#155244, openclaw#154920.
What Problem This Solves
Installed OpenClaw 2026.9.4 spends part of its fixed 300-second candidate-validation window on optional Doctor inspections that do not prove migration or Gateway readiness.
Related: #154381, #154674, #154114, #144858. Thanks @ZaneMc-AO and @agebreak0083 for the field reports and phase output.
User Impact
During private candidate validation, optional core inspections produce named warnings and commands to run after activation. Required checks still complete before the result is published; their errors and plugin errors remain gating. Standalone Doctor lint and explicit
--onlyselections retain their scope.This is the lint-deferral change only, based on main
14f8ec46c13366c23d7c22f15c44677fc9d950ef. It has no source dependency on the settlement repair in #155138 and is not stacked on that branch. It contains no settlement or generation-reuse implementation. No new options, dependencies, schemas, persisted operator-state shapes, retries or timeout increases.Why This Change Was Made
Doctor identifies the selected optional checks before preparing runtime metadata. It avoids the model/tool metadata graph when its optional inspector is deferred, then records an
update-inspection-deferredwarning with the check ID and follow-up command. The guard uses the complete private-copy marker contract already set by the published updater. The installed parent's migration-rehearsal, lint, config, plugin and canary phase order stays unchanged.The prior controlled comparison measured a 9.588-second median lint saving while holding generation reuse and settlement repair constant. The standalone comparison below isolates this three-file change: lint medians are 20.250 → 5.573 seconds, with disjoint ranges, and the median within-pair saving is 14.977 seconds. The total validating-ledger medians are 97.142 → 89.217 seconds, with overlapping ranges; these observations establish a lint saving, not a reproducible whole-update speedup.
Evidence
Three uninstrumented observations per variant on one Testbox and unchanged packages/fixture. Original AB pair retained, followed by BA then AB. Seconds: min / median / max.
Median within-pair lint saving: 14.977s. The original pair saved 6.504s but its non-lint phases also slowed; it was retained rather than replaced.
The validating ledger includes npm staging and is an upper bound on the combined validator interval. No measurements were discarded.
The first AB pair saved 6.504 seconds in lint while unrelated phases slowed. To examine that variance, the same lease, packages and fixture were retained for two prespecified pairs, BA then AB. Every observation is included above; no source changes, rebuilds or probes were introduced between cells.
All six hops passed using the genuine published
[email protected]driver, each restoring identical synthetic state: ten agents/ten v19 databases, 365.8 MiB total and 338.7 MiB largest; seven real npm 2026.9.5 plugins, 477.5 MiB total, including the Codex native bundle. Source, schema and generation-absence guards bind each package to its variant. All 60 resulting agent databases reached v22 with integrity and foreign-key checks passing and transcript/trajectory bytes preserved. There were no settlement faults or surviving marked child processes. Original proof inputs, package hashes and the pristine fixture content manifest were unchanged at completion. No settlement patch is injected, and no update failure is retried away.Command:
openclaw update --tag <candidate.tgz> --yes --json --no-restart --timeout 1800. The published combined-validation clamp remains unchanged. State and canary ports are isolated; no inference or operator Gateway is used. The validating ledger includes npm staging and is a conservative upper bound on the validator interval.The original-order Doctor process→budget replay passed 14 tests in two files, 34.03s wrapper wall / 31.99s Vitest wall; reported time was 70% transformation and 23% tests. The rehearsal case took 706ms. The longest case, preserving explicit selection, took 5.255s. No slow/flaky test was encountered.
The same rehearsal regression failed on unchanged main at the intended boundary: runtime metadata preparation occurred once, where a deferred inspector requires zero preparations. Its baseline case took 2.192s; the file took 27.77s wall, mostly transformation. The six unselected cases were filtered for this red proof; no test was disabled in source.
The per-check warnings and follow-up commands are verified at the CLI owner boundary. The published 2026.9.4 parent does not retain successful candidate-lint output in its compact result, so that result is not claimed as the warning-serialization proof.
The event-driven regression pauses a required check and verifies that no JSON result appears until it completes. Existing cases verify deferral reasons, skipped/opt-in selection, standalone lint, explicit selection, and required/plugin failures. It adds no timer, process fixture or production seam.
Full
check:changedpassed on the Testbox, including all 25 core-test type shards and the selected lint, formatting, documentation, schema, storage and auth guards. Commands:node scripts/run-vitest.mjs src/commands/doctor-lint-process.test.ts src/commands/doctor-lint.update-budget.test.tsin original order, followed bynode scripts/check-changed.mjs --base 14f8ec46c13366c23d7c22f15c44677fc9d950ef -- docs/cli/update/how-updates-run.md src/commands/doctor-lint.ts src/commands/doctor-lint.update-budget.test.ts. The focused baseline regression produced the expected failure; all candidate gates exited 0.Fresh P1 autoreview is scoped-clean with no actionable P0/P1 findings. Production +54/−14 (net +40); tests +233/−72 (net +161); docs +9. The seven existing test cases are retained and extended.
Lint-only head:
79d6acbc51bc696377c0021890940be39ba75951.Blacksmith Testbox leases (both stopped after collection):
tbx_01m32y7c8edhgvzbftr4v1wh09(run); initial pair and counterbalanced continuation both exited 0.tbx_01m32y7c8an9dxvcs41n9gnd8d(run); wrapper exit 0. Lease cleanup can mark the enclosing Actions job cancelled; the remote commands and collected receipts establish the results.Hosted PR CI is attached to this exact head and in progress at handoff. The earlier draft event was skipped as expected. Hosted results and test timings are not yet claimed.
Ready-PR authoring endpoint only. No landing or auto-merge.