Repository navigation
fix(doctor): avoid slow legacy ownership repair in source checkouts - #156238
Conversation
Load the lazy host binding repair through the existing native module loader and alias resolver before the supported source-transform fallback. Preserve synchronous recovery, applicability, migration results, and built JS loading; propagate dependency and evaluation failures without loading a second graph. Keep the real-reader ownership assertions and guard the host module boundary. Cover unsupported native loading and error propagation through existing owners. A matched same-base observation reduced the real-reader case from 34.330s to 2.356s. Historical CI timeout causality remains unproven. Independent P2 review, source/built Doctor, focused/sibling tests and exact-tree formatting passed; remaining ordered-cohort and published-updater proof are tracked before landing.
|
🦞👀 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 real behavior proof before merge. Reviewed September 23, 2026, 1:58 AM ET / 05:58 UTC. ClawSweeper reviewWhat this changesDoctor’s legacy channel-ownership repair now tries the existing native module loader before source transformation, with regression coverage for lazy loading, fallback, and error propagation. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, focused performance fix: current main and v2026.9.5 still force source transformation. No introduced correctness defect was found, but the runtime evidence and acknowledged upgrade validation are not yet complete. Priority: P2 Review scores
Verification
How this fits togetherDoctor and startup recovery normalize legacy configuration before validation and saving. This loader brings in channel-ownership repair only when applicable, preserving the migration owner used by both paths. flowchart TD
A[Legacy configuration] --> B[Doctor or startup recovery]
B --> C{Ownership repair applicable?}
C -->|No| G[Validate migration result]
C -->|Yes| D[Try native module loading]
D -->|Unsupported| E[Source transformation]
D -->|Loaded| F[Existing ownership repair]
E --> F
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +71. Total +84 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one synchronous repair owner, using native loading where supported and the established transform fallback otherwise, with verified source, packaged, and upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes, source inspection establishes that applicable multi-agent repairs on current main force transformation even when native loading is available; the precise slowdown was not independently executed here. Is this the best way to solve the issue? Yes, reusing the existing native loader and alias resolver is a narrow solution that preserves the repair owner and fallback contract; runtime and upgrade validation still need completion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 44d24c38bd8b. LabelsLabel 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
|
* commit '3ab93b4ea59804b34d02a696382db16dc95189bb': (80 commits) fix(gateway): keep session refreshes moving during unrelated writes (openclaw#156286) chore(deps): update fs-safe to 0.18.2 (openclaw#156262) refactor(plugins): extract ClawHub plugin archives once (openclaw#156246) improve(llm-core): avoid unnecessary tool validation sets (openclaw#152066) fix(backup): verification accepts archives missing captured databases (openclaw#156211) fix: cancel Guest work when its original access is revoked (openclaw#156106) fix(test): classify drained legacy migration refusals fix(anthropic): finish Opus 5.5 defaults and thinking display (openclaw#156093) refactor(agents): share native harness tool execution (openclaw#154217) fix(ui): carry typed ownership through short-route resolution test(worktrees): accept additive gc result fields (openclaw#156127) test(tasks): close sqlite borrowers before registry reload (openclaw#156131) chore(autoreview): sync Astra high defaults (openclaw#156175) refactor(node-host): await prepared workspace storage (openclaw#149519) improve: speed up cold Node test planning (openclaw#156234) fix(doctor): avoid slow legacy ownership repair in source checkouts (openclaw#156238) improve: speed up native build artifact validation (openclaw#156219) fix(ui): preserve short-route resolution ownership fix(doctor): name retained session metadata conflicts (openclaw#156162) perf(tasks): bound creation selection to matching runs (openclaw#156183) ...
…penclaw#156238) Load the lazy host binding repair through the existing native module loader and alias resolver before the supported source-transform fallback. Preserve synchronous recovery, applicability, migration results, and built JS loading; propagate dependency and evaluation failures without loading a second graph. Keep the real-reader ownership assertions and guard the host module boundary. Cover unsupported native loading and error propagation through existing owners. A matched same-base observation reduced the real-reader case from 34.330s to 2.356s. Historical CI timeout causality remains unproven. Independent P2 review, source/built Doctor, focused/sibling tests and exact-tree formatting passed; remaining ordered-cohort and published-updater proof are tracked before landing.
What Problem This Solves
Fixes slow legacy channel ownership repair when Doctor or startup recovery runs from a source checkout.
User Impact
Source installations can repair legacy ownership without transforming the host runtime a second time. Existing migration decisions, backups, synchronous recovery, and the packaged JavaScript path remain unchanged; no configuration changes are required.
Why This Change Was Made
The lazy binding repair entry point always used the plugin source transformer, even when the runtime could load it natively. A CPU profile attributed 31.2 seconds to that load and 102 milliseconds to the repair itself. Reuse the existing native module loader and alias resolver, retaining the established transform fallback only when native loading is unsupported. Dependency or evaluation errors still propagate.
The applicability gate remains lazy. The real-reader regression protects the host module boundary while retaining the original ownership assertions; unit coverage checks unsupported loading and error propagation.
Evidence
--maxWorkers=1:legacy-config-compat.test.ts, 6 cases in 15.39 seconds;automatic-startup-config-repair.test.ts, 25 cases in 21.76 seconds. CI timing will be recorded when available.70cd657a0f95900ef32269de38bc7e7824c9d7ffbefore the final cohort and updater checks completed; both subsequently passed. The original five-group cohort preserved its ordering and two-plan/two-worker concurrency: 3,282 passed, eight existing skips, 491.277 seconds wall; the real-reader ownership case passed in 5.271 seconds. The four changed files and five bound loader/runtime/test-wrapper dependencies match the reviewed hashes at the merged commit.already-currentno-op all passed. Doctor exited 0 with a recorded recoverable loopback/node-hosting advisory in the service-free fixture; the update succeeded without activation. No version-skew warning occurred.2026.9.5baseline was too recent for the repository's seven-day release-age policy. The canonical full package build fixed preparation; the final cell reused that validated immutable tarball with policy-eligible2026.9.4(published September 11). No policy, harness assertion, or legacy-warning allowance changed.Source and built Doctor runtime proof
Linux/Node 24.19.0, pnpm 12.4.0. The source probe used the real config reader and automatic repair planner. The built probe ran
pnpm openclaw doctor --fix --non-interactiveagainst isolated synthetic legacy configuration. It asserted the repaired explicit roster, default-account ownership, preservation of the narrower peer binding, byte-for-byte original backup, and the exact native runtime path. The built trace contained only JavaScript binding-repair loads.The retained output is from candidate tree
e92759d92b6e49110331a9bdb22808e55785efe8; the final tree4eec5a3f81ef6d106ac553f041595a8e6ef3199bonly changes test-spy cleanup. Production file SHA-256 is unchanged:614c55a011e5e38584c5166d78b05454a74043f020ae65220ad43861836ded7e.Published updater receipt
Provider: Blacksmith Testbox, run 35824888880. The delegated command completed with exit 0 in 162.695 seconds; the lease was then stopped and verified completed. Source tree:
4eec5a3f81ef6d106ac553f041595a8e6ef3199b. Candidate SHA-256:341f873c49dff83c0174c92ce85b3d3ef7669e0c0033242731b377470cd108ff. The package's carrier commit identifies remote materialization of that exact tree.{ "passed": true, "baselineVersion": "2026.9.4", "candidateVersion": "2026.9.5", "candidateBuildId": "2026.9.5-a7daf4ed8523-2026-09-23T06-31-51.144Z", "appliedStatus": "ok", "appliedAfterBuildId": "2026.9.5-a7daf4ed8523-2026-09-23T06-31-51.144Z", "doctorExitCode": 0, "noopStatus": "skipped", "noopBuildId": "2026.9.5-a7daf4ed8523-2026-09-23T06-31-51.144Z" }The Doctor receipt recorded:
core/doctor/node-hosting-preconditions: Gateway is only bound to loopback, followed by the existing recoverable update-time advisory. The full fixture checks included exact candidate identity after installation, an unchanged build on the second invocation, offline/service-free behavior, and original source cleanliness.