Repository navigation
fix(doctor): plan and execute plugin migrations from one inventory - #157479
Conversation
Carry the selected plugin records through deferred session repair so startup cannot rediscover an owner excluded during planning. Preserve declaration, action-order, and maintenance-authority checks. Live external-plugin proof is blocked by install ownership resolution; retain this as a draft pending that gate.
|
Codex review: needs real behavior proof before merge. Reviewed September 24, 2026, 3:20 PM ET / 19:20 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch carries one selected plugin migration inventory through Doctor planning, Gateway startup, and post-session repair, with regression coverage and a documentation clarification. Merge readiness⛔ Blocked before merge - 7 items remain The startup action-order failure is still present on current main, and this PR has a focused repair. It remains blocked because the prepared inventory can carry an outdated plugin trust decision into the final repair. Priority: P0 Review scores
Verification
How this fits togetherDoctor and Gateway startup inspect installed plugin manifests, plan legacy-state repairs, and run eligible plugin actions after session repair. Those actions can change retained session state and, for channel plugins, durable ingress queues. flowchart LR
A[Installed plugin manifests] --> C[Prepared inventory]
B[Deferred plugin list] --> C
C --> D[Migration plan]
D --> E[Session repair]
E --> F[Plugin repair under leases]
F --> G[State and repair receipts]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The inventory handoff can preserve an obsolete official-plugin trust decision through to a write-capable migration. PR surfaceSource +15, Tests +214, Docs +2. Total +231 across 8 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 planned action order and deferred-owner selection, bind artifact identity and trust again under the final lifecycle lease, then verify the published updater completes the retained-state migration safely. Do we have a high-confidence way to reproduce the issue? No current-main execution was run in this read-only review. The PR reports an exact baseline startup failure, and current-main source still rediscovers plugin actions after planning; the separate direct Doctor report remains unconfirmed by the PR's live comparison. Is this the best way to solve the issue? No. Carrying the selected inventory addresses the action-order mismatch, but the final writer must revalidate artifact identity and official trust before granting mutable migration access. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 37783fcbcf78. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What 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 (1 earlier review cycle)
|
Exercise the direct Doctor config and session-health flow after legacy roster repair, with both external plugin roots selected and no managed install records. This control passes before the production fix as well; only the startup case reproduces the immutable action-order refusal.
|
🦞👀 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. |
…penclaw#157479) * fix(doctor): plan and execute plugin migrations from one inventory Carry the selected plugin records through deferred session repair so startup cannot rediscover an owner excluded during planning. Preserve declaration, action-order, and maintenance-authority checks. Live external-plugin proof is blocked by install ownership resolution; retain this as a draft pending that gate. * test(doctor): cover direct repair with global npm plugins Exercise the direct Doctor config and session-health flow after legacy roster repair, with both external plugin roots selected and no managed install records. This control passes before the production fix as well; only the startup case reproduces the immutable action-order refusal.
…entory
2026.9.7 gateway startup refused its post-session plugin migrations
("do not match the immutable action order: acpx:..., codex:...") because
execution rediscovered plugin records that planning had excluded, leaving
the gateway down after the deploy. Backports upstream 47a84c8 (openclaw#157479),
adapted to the release's pre-refactor plan shape: the prepared inventory
rides alongside the planned actions instead of the upstream migration object.
(cherry picked from commit 47a84c8)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Still blocked upgrading from 2026.9.3 on macOS, Git install, stable channel. Latest attempt again selected eb377ac and failed candidate Gateway readiness. Activation was skipped. The UI stayed on “Validating” after the attempt had failed; I subsequently recovered the unloaded LaunchAgent with openclaw gateway start. Which published stable version includes #157479, and is that expected to address this failure? |
The sync agent resolved 35 conflicts but stopped before building. Its resolutions left fork additions pointing at names upstream had renamed or inlined: - sandbox fs-paths: toHostSegments is gone upstream (inlined as split/filter), and the new MOUNT_SOURCE_PRIORITY table lacked the fork's managedState source (shared and media mounts, rank 0 as before). - secret mounts: normalizeHostPath -> normalizeSandboxHostPath. - cron job cap: resolveEffectiveJobAgentId -> resolveCronJobEffectiveAgentId. - whisper-asr keyless auth: the LOCAL_KEYLESS_PROVIDERS declaration was dropped while its use survived. - session file previews: getSessionRootFile takes upstream's new assertCurrent, and the mounted-file preview now passes it too. The Ollama string-arguments fix was worse: its helpers stayed in stream.runtime.ts with no caller, and the checklist entry matched the helper, so it reported present while the fix was off. Move it next to upstream's compat wrapper in stream-compat.ts, wire it for openai-completions, assert the wiring call, and add a regression test with object arguments (it fails with the wrapper unwired). Also: drop the fork's openclaw#157479 backport (the re-cut ships 47a84c8), retire the checklist entry for an upstream test file upstream deleted, and teach the sync prompt to skip superseded cherry-picked backports. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The sync agent resolved 35 conflicts but stopped before building. Its resolutions left fork additions pointing at names upstream had renamed or inlined: - sandbox fs-paths: toHostSegments is gone upstream (inlined as split/filter), and the new MOUNT_SOURCE_PRIORITY table lacked the fork's managedState source (shared and media mounts, rank 0 as before). - secret mounts: normalizeHostPath -> normalizeSandboxHostPath. - cron job cap: resolveEffectiveJobAgentId -> resolveCronJobEffectiveAgentId. - whisper-asr keyless auth: the LOCAL_KEYLESS_PROVIDERS declaration was dropped while its use survived. - session file previews: getSessionRootFile takes upstream's new assertCurrent, and the mounted-file preview now passes it too. The Ollama string-arguments fix was worse: its helpers stayed in stream.runtime.ts with no caller, and the checklist entry matched the helper, so it reported present while the fix was off. Move it next to upstream's compat wrapper in stream-compat.ts, wire it for openai-completions, assert the wiring call, and add a regression test with object arguments (it fails with the wrapper unwired). Also: drop the fork's openclaw#157479 backport (the re-cut ships 47a84c8), retire the checklist entry for an upstream test file upstream deleted, and teach the sync prompt to skip superseded cherry-picked backports. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The sync agent resolved 35 conflicts but stopped before building. Its resolutions left fork additions pointing at names upstream had renamed or inlined: - sandbox fs-paths: toHostSegments is gone upstream (inlined as split/filter), and the new MOUNT_SOURCE_PRIORITY table lacked the fork's managedState source (shared and media mounts, rank 0 as before). - secret mounts: normalizeHostPath -> normalizeSandboxHostPath. - cron job cap: resolveEffectiveJobAgentId -> resolveCronJobEffectiveAgentId. - whisper-asr keyless auth: the LOCAL_KEYLESS_PROVIDERS declaration was dropped while its use survived. - session file previews: getSessionRootFile takes upstream's new assertCurrent, and the mounted-file preview now passes it too. The Ollama string-arguments fix was worse: its helpers stayed in stream.runtime.ts with no caller, and the checklist entry matched the helper, so it reported present while the fix was off. Move it next to upstream's compat wrapper in stream-compat.ts, wire it for openai-completions, assert the wiring call, and add a regression test with object arguments (it fails with the wrapper unwired). Also: drop the fork's openclaw#157479 backport (the re-cut ships 47a84c8), retire the checklist entry for an upstream test file upstream deleted, and teach the sync prompt to skip superseded cherry-picked backports. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The sync agent resolved 35 conflicts but stopped before building. Its resolutions left fork additions pointing at names upstream had renamed or inlined: - sandbox fs-paths: toHostSegments is gone upstream (inlined as split/filter), and the new MOUNT_SOURCE_PRIORITY table lacked the fork's managedState source (shared and media mounts, rank 0 as before). - secret mounts: normalizeHostPath -> normalizeSandboxHostPath. - cron job cap: resolveEffectiveJobAgentId -> resolveCronJobEffectiveAgentId. - whisper-asr keyless auth: the LOCAL_KEYLESS_PROVIDERS declaration was dropped while its use survived. - session file previews: getSessionRootFile takes upstream's new assertCurrent, and the mounted-file preview now passes it too. The Ollama string-arguments fix was worse: its helpers stayed in stream.runtime.ts with no caller, and the checklist entry matched the helper, so it reported present while the fix was off. Move it next to upstream's compat wrapper in stream-compat.ts, wire it for openai-completions, assert the wiring call, and add a regression test with object arguments (it fails with the wrapper unwired). Also: drop the fork's openclaw#157479 backport (the re-cut ships 47a84c8), retire the checklist entry for an upstream test file upstream deleted, and teach the sync prompt to skip superseded cherry-picked backports. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Closes #157362
Related: #157415
What Problem This Solves
Fixes candidate Gateway startup refusing post-session plugin repairs when an external owner excluded during planning reappears during execution.
User Impact
Admitted plugin repairs finish while a deferred plugin and its retained inputs remain pending. Manifest declarations, immutable action order, and maintenance-authority checks remain enforced.
The direct Doctor report remains unproven: the tested global-npm shape completes on the pre-fix baseline as well as the candidate, including an earlier legacy-roster repair. This PR does not claim that report is fixed.
Why This Change Was Made
Startup prepares a live inventory inside the deferred-plugin scope, then leaves that scope before completing session repair. The old handoff retained only action IDs, so execution discovered owners again and reintroduced a loadable deferred codex owner beside the admitted acpx action.
The registry now retains its selected records in the prepared inventory. The migration graph, deferred handoff, and execution consume those records. Installation-driven replanning still selects the replacement generation. The action-order check is unchanged.
Direct Doctor uses the live resolver too, preserves its metadata/deferred scope through session health, and refreshes the plan after package repairs. Its added control covers both external owners after config repair, with global npm prefix paths and no OpenClaw-managed install records. Duplicate bundled copies remain untouched.
Production: +27/-12 lines (net +15); tests: +214 lines; docs: +2 lines.
Evidence
6e8d06876fd166064abbec4928fb3bb109ebe999, the startup case fails with the exact refusal below while the direct Doctor case passes. On the candidate both pass. The startup assertion verifies that only admitted external acpx executes, codex's obligation and inputs remain pending, and neither bundled copy executes.agents.list, then completes both external plugin actions. It passes before the production fix, so it is coverage rather than a claimed direct-Doctor regression.node scripts/run-vitest.mjs src/commands/doctor-config-preflight.plugin-action-inventory.test.ts --maxWorkers=1. Compiler preparation accounts for most wall time; hosted CI timing is pending.node scripts/check-changed.mjs --base origin/upd/doctor-plugin-action-order-externalpassed for the follow-up, including Doctor test types, lint with zero warnings/errors, and unused-export guards. Fresh Codex autoreview at P0–P2 was scoped-clean.git diff --checkpassed.pnpm pack, then installed both usingnpm install -ginto an isolated prefix. Explicitplugins.load.pathsselected those roots as documented. Both baseline and candidate reported both plugins loaded from that prefix, with the Gateway stopped and isolated home/state/config paths. Each dist was rebuilt throughOPENCLAW_FORCE_BUILD=1 pnpm openclaw --version;doctor --fix --non-interactivecompleted with exit 0 on both. The exercise, including setup correction and cleanup, stayed within the 30-minute limit.Baseline startup regression:
Sanitized live results:
The initial isolated prefix lacked the
openclawhost peer: a native Codex migration chunk reportedERR_MODULE_NOT_FOUND. npm linked the host into the same prefix within the original time limit, after which the paired runs completed. The prior package-owner guard did not recur with explicit global-root selection. Advisory missing-credential/workspace diagnostics are expected for this empty, secretless fixture; no operator state or Gateway was touched.Direct Doctor follow-up: additional inputs from the affected upgraded installation are needed to reproduce the reported divergence. The copied-state resolver is not used by the tested direct path. Auto-merge remains off for the lead to arm.