Repository navigation
fix(plugins): preserve bundled install ownership - #123063
Conversation
Punchcard-Session: ember-meadow-river-68
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 4:15 AM ET / 08:15 UTC. ClawSweeper reviewWhat this changesThe PR preserves managed install ownership when bundled and managed-install discovery encounter the same plugin source in one scan. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: current main still drops managed install ownership at same-scan deduplication, while this PR repairs that producer-boundary gap without changing bundled precedence or ambiguity handling. Priority: P2 Review scores
Verification
How this fits togetherPlugin discovery combines bundled locations with managed-install records into one plugin registry. Manifest and installed-index construction carry the selected install owner to lifecycle actions such as update and uninstall. flowchart LR
A[Bundled plugin roots] --> C[Plugin discovery]
B[Managed install records] --> C
C --> D[Same-source deduplication]
D --> E[Manifest and installed index]
E --> F[Managed lifecycle actions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +19, Tests +59. Total +78 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared ownership-merge helper, land it after exact-head validation, and preserve the existing fail-closed result for conflicting install records. Do we have a high-confidence way to reproduce the issue? Yes. Current main's exact same-source early return drops later managed-install ownership, and the added fixture exercises that ordering without needing an external service. Is this the best way to solve the issue? Yes. Merging only authoritative ownership metadata into the first retained candidate fixes the owner boundary while preserving bundled precedence and existing ambiguity behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b54034d5c22a. 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
|
|
Maintainer merge-risk decision: retain the shared ownership-merge helper. The Waiting for the remaining exact-head CI jobs before merge. The heavy bundled-plugin shard remains deferred, not waived, while beta.2 validation capacity is reserved. |
|
Merged via squash.
|
Punchcard-Session: ember-meadow-river-68
What Problem This Solves
Fixes an issue where a bundled plugin discovered before its managed install record could lose package ownership during same-scan source deduplication. Lifecycle actions then lacked the authoritative install owner even though the install ledger claimed the same plugin root.
Why This Change Was Made
Discovery now merges only install-owner and ambiguity metadata into the retained first candidate before returning from same-pass deduplication. Bundled precedence, origin, package metadata, and source stay unchanged; conflicting install records still fail closed as ambiguous with the existing diagnostic.
Root cause:
addCandidatereturned on itsseencheck before ownership from the later managed-install pass reached the retained bundled candidate.Production delta:
+31/-12(+19net), justified by restoring the lifecycle ownership boundary without replacing or revalidating the retained candidate. Test delta:+59.User Impact
Operators can use managed lifecycle actions for package-less and package-backed bundled plugins whose install records point at the same discovered root. Conflicting ownership remains unavailable rather than selecting an unsafe owner.
Evidence
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/plugins/discovery.test.ts src/plugins/manifest-registry-installed.test.ts src/plugins/install-persistence.test.tsnode scripts/check-changed.mjs -- src/plugins/discovery.ts src/plugins/discovery.test.tspnpm format:check src/plugins/discovery.ts src/plugins/discovery.test.tsgit diff --checknothing_found, high confidence, best-fix verdictThe heavy bundled-plugin shard is deferred, not waived, while beta.2 validation capacity is reserved. Exact-head ordinary CI and ClawSweeper review remain required before merge.
AI-assisted: yes. I reviewed and understand the implementation and tests.