Repository navigation
fix(doctor): prevent plugin load errors after read-only inspection - #160446
Conversation
Keep cache-owned source and native captures in the original profile's temporary storage while Doctor redirects database state into disposable snapshots. Preserve native admission integrity and custody across later channel setup loads.
|
🦞👀 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 maintainer review before merge. Reviewed September 28, 2026, 12:33 PM ET / 16:33 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor lint keeps plugin source and native captures in the original profile’s temporary storage so later channel setup can load them after inspection snapshot cleanup; the branch also adds a regression test and documentation. Regression provenancePossible regression — probable (failure trace; reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open. Current main still has the capture lifetime defect, while this PR has positive published-updater proof and no blocking finding from the introduced change. Priority: P1 Review scores
Verification
How this fits togetherDoctor runs health checks during updates using disposable database snapshots. Plugin inspection also creates files that the plugin cache may need for later channel setup. flowchart LR
A[Published updater] --> B[Doctor lint]
B --> C[Disposable database snapshot]
B --> D[Plugin inspection]
D --> E[Profile temporary captures]
E --> F[Plugin cache]
F --> G[Later channel setup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +12, Tests +92, Docs +4. Total +108 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep captured plugin files under cache custody in the profile’s protected temporary storage while Doctor isolates database inspection in disposable snapshots. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source retains the snapshot-bound allocation path, and the reported baseline Package Acceptance run failed in Doctor; this read-only review did not execute a fresh current-main reproduction. Is this the best way to solve the issue? Yes. Scoping the existing capture allocator to the original profile addresses the lifetime mismatch while preserving Doctor’s disposable database reads and existing capture cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b4e363171c93. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
CI note: 85b4fb7 failed only |
|
CI note: after the recorded UI rerun, 85b4fb7 failed only |
|
Merged via squash.
|
…penclaw#160446) Keep cache-owned source and native captures in the original profile's temporary storage while Doctor redirects database state into disposable snapshots. Preserve native admission integrity and custody across later channel setup loads.
What Problem This Solves
Fixes Doctor reporting plugin load errors during upgrades when an earlier read-only inspection has removed native plugin capture files.
User Impact
Channel setup and validation can reuse admitted plugin files after Doctor finishes an inspection. This repairs the candidate-side failure seen when the published 2026.9.6 updater reaches Doctor; the published updater needs no changes.
Why This Change Was Made
Doctor redirects state into disposable SQLite snapshots, but native admission facts live with the plugin cache. Native captures therefore outlived their enclosing directory and later loads failed with
ENOENT, including Discord and WhatsApp in Package Acceptance.Pin source and native capture allocation to the original profile's temporary storage across nested inspections. Existing native integrity checks, custody tokens, cache retirement, and the prohibition on publishing admission receipts during read-only inspection stay in place.
The state-derived capture root was introduced by eeb75c8; 9faa93d subsequently added the cache-retained native admission path seen in this failure. Doctor's ambient state redirection predates both (6f1b678). The separate CPU-bound model-runtime startup stall is not established to have this root cause and is not claimed fixed here.
Evidence
published-upgrade-survivor-2026.9.6, candidate 4e97ea3.ENOENTbeneath nestedopenclaw-sqlite-readonly-v2-*paths.pnpm test src/commands/doctor-lint.plugin-captures.test.ts --maxWorkers=1passes; test time 2.578s / cold wrapper wall 33.07s initially; final allocation-expression cleanup also passes, 9.828s test / 159.26s wrapper under heavy host CPU contention (worker preparation dominated). The test needs the real Doctor snapshot and plugin-loader lifetime boundary; no sleeps, polling, or Gateway boots are added.MODULE_NOT_FOUND); a bounded task-local-cache attempt reproduced that failure. The dead-export scan is unverified. All remaining schema, database-policy, media-helper, runtime-sidecar, webhook, and auth guards passed when run separately.The full published-driver upgrade lane has not been rerun for this patch. No live Gateway or operator state was used by the regression.