Repository navigation
Conversation
On source checkouts, version-bound Codex rebuilt with the host must win over an npm generation that only matches the calendar version. Doctor no longer treats those installs as stale-version-bound for npm refresh, and retires shadowing npm records with an explicit decision note. Closes openclaw#145266
|
🦞👀 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 11, 2026, 6:30 PM ET / 22:30 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor keeps source-built Codex selected on dev checkouts, retires shadowing npm records and recoverable generations, and rechecks updater authority before retention writes. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful fix for an unresolved convergence defect. Both prior code findings are addressed, and the new loader trace strengthens the evidence, but required installation and upgrade proof remains incomplete. Priority: P1 Review scores
Verification
How this fits togetherDoctor reconciles configured plugins with bundled code and installed package records. Its decisions determine which Codex plugin the Gateway loads after an update or restart. flowchart TD
A[Configured plugins and update channel] --> C[Doctor convergence]
B[Bundled code and npm records] --> C
C --> D{Usable source bundle on dev?}
D -->|Yes| E[Retire npm shadows and exclude recovery]
D -->|No| F[Preserve registry repair behavior]
E --> G[Gateway selects plugin]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +119, Tests +534. Total +653 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing convergence and retention owners, preserve release-channel selections, and establish published-driver upgrade compatibility for the dev-only repair. Do we have a high-confidence way to reproduce the issue? Yes, from source and the supplied host record: a matching global npm install outranks the ordinary bundle, while equal release versions do not detect SDK artifact skew. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes: repairing convergence and excluding retired generations from recovery addresses the producer of the shadowing state. The new loader/import trace addresses the previous crash-path gap, while candidate identity and upgrade compatibility remain to be established. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 304261a77818. LabelsLabel 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
HistoryReview history (3 earlier review cycles)
|
Gate bundled Codex npm-record retirement on the Doctor-resolved registry channel so stable/beta source checkouts keep healthy registry selections.
|
@clawsweeper re-review Ownership fence + gateway reload / bundled Codex loader proof are in the latest commits and PR body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @DonnieFi for the report, reproduction, and artifact-skew evidence. #145356 has landed as the canonical fix in fe05653. The shared manifest registry now keeps the plugin rebuilt with the running source checkout authoritative, and update-source handling records why a registry artifact without matching host SDK build identity was not admitted. The same selection carries through named/bulk plugin updates and release-cohort preflight, while preserving dormant npm records and strict ownership checks for active packages. Closing this draft as superseded by #145356. Your reporting and reproduction are credited in the landed squash commit and PR. |
Closes #145266
What Problem This Solves
On git/dev source checkouts, Doctor’s post-core convergence treated a version-bound Codex npm install as
stale-version-bound-runtimewhenever the calendar version lagged the host, then refreshed from@openclaw/codex. The published npm tarball can share the host version string while still importing a pre-#144828 SDK export (registerRetainedNativeHookRelayForBundledRuntime), while the host-rebuilt bundled plugin and SDK use the renamed export. Loader precedence then prefers the npm generation (origin: global) and every Codex harness turn fails before reply.Why This Change Was Made
Pete’s guidance on #145266: on git/dev installs the plugin rebuilt with the host stays authoritative; an npm generation must not be admitted on the version string alone; record the decision. ClawSweeper review required (1) retirement only on the dev registry channel, (2) retained-generation markers so recovery cannot re-admit shadows, (3) per-mutation updater authority rechecks before marker writes, and (4) live loader recovery proof.
Shipped Solution
isUsableSourceCheckoutBundledPluginRoot).resolveRegistryUpdateChannel(...) === "dev".beforePersistentEffectintomarkRetainedManagedNpmInstalland recheck immediately before eachmkdir/writeFileso a revoked updater cannot publish recovery-exclusion markers.User Impact
Git/dev updates keep Codex on the host-rebuilt bundle instead of a mismatched npm generation. Release-channel registry selections are preserved. Retention writes respect updater ownership across async filesystem work.
Behavior proof
Host: git/dev (
/opt/openclaw),update.channel: "dev", CLIOpenClaw 2026.9.4 (15285e5).Pre
Matching #145266: Codex
origin: globalfrom npm…g-1153…@2026.9.4; host bundle unused; npm importedregisterRetained…while host SDK exportsregisterNative…; journal showed Doctor refresh then repeated harness failures.Post — ledger repair
Post — gateway reload (loader selection)
systemctl --user restart openclaw-gateway.service→ new pid1563882, connectivity probe ok.Host SDK exports
registerNativeHookRelayForBundledRuntime(not Retained). Bundledthread-lifecycle-*.jsimports Native; dynamic import of that module succeeds (lifecycle module import: ok) — the previous crash path.Authority-chain unit coverage: revocation after
stat/ aftermkdir/ mid-loop does not publish further retention markers (managed-npm-retention.test.ts).Negative (stable/beta)
Unit:
retains a healthy same-version npm Codex record on %s source checkoutsforstable/beta.Published-driver / fresh-install
Not run on this long-lived git/dev host. Package hosts keep the non-source-checkout npm refresh path covered in unit tests.
Evidence
node scripts/run-vitest.mjs src/commands/doctor/shared/missing-configured-plugin-install.test.ts src/plugins/managed-npm-retention.test.ts src/plugins/bundled-dir.test.tsStatus
Draft — addresses ClawSweeper rev2 ownership fence + loader recovery proof. Request
@clawsweeper re-reviewafter this body lands if automation does not pick it up.