* fix(plugin): recover OMP stale catalog installations Refresh owned marketplace catalogs before reuse and validate the native cache identity when removing an installation. Preserve that identity through interrupted cleanup and report blocked batch updates as failures so retries remain safe and visible. * fix(plugin): preserve reviewed versions during OMP recovery Keep native removal identity separate from reviewed receipts so interrupted cleanup can retry safely. Expose isolated failures in previews and dry-run exit status while allowing healthy targets to proceed. * fix(plugin): resume interrupted OMP update cleanup Retry matching pending removals before reinstalling after registry-first interruption, and clarify isolated failure reporting. Strengthen recovery fixtures and restore accurate installation guidance. * test(plugin): model OMP cached catalog installs Use the cached marketplace entry for native install version and source so the stale catalog regression exercises the real version-to-cache relationship. * test(plugin): align OMP batch expectations with safety checks Require catalog refresh before reinstalling from an owned marketplace and assert isolated failures when native OMP ownership cannot be verified, while healthy targets update. * fix(plugin): skip native upgrade checks for OMP imports Imported plugins have no reviewed source to upgrade, so requiring native upgrade capability makes a safe batch skip fail unnecessarily. Cover that case and OMP dry-run failures, and align translations and native verification runbook with the failure and removal behavior. --------- Co-authored-by: Willie <egg358358@gmail.com>
6.9 KiB
OMP 18.6.1: shared plugin cache prevents a complete safe lifecycle
Verified upstream contract
The inspected source is can1357/oh-my-pi tag v18.6.1, commit
2a2c6dcbbb558c0f8145f67f28b3370984f2bf60.
marketplace/manager.tslists the user registry and only the current project's registry. Its uninstall code (around lines 616–636) deletes an install directory when neither of those two registries references it. Other projects are not considered.marketplace/cache.tsidentifies cached installations by marketplace, plugin name and version, not by project. Installing/upgrading the same identity can replace shared contents.
Reproduced behavior
Native OMP 18.6.1 with Bun 1.3.14 and the Linux ARM64 native addon was exercised
inside the devcontainer, using the disposable omp-plugins-409 ssenv, never a
real user's configuration or a running Agent session.
- Install one local marketplace plugin in user scope and project B scope.
- From the isolated HOME, native inventory shows only the user installation.
- Native
omp plugin uninstall <id> --scope userremoves the shared cache, leaving project B'snode_moduleslink dangling. - A same-version native upgrade replaces cache contents; an upgrade to another version can remove the old directory still referenced by project B.
Retaining the marketplace registration does not fix this: native uninstall can delete the installed cache independently of marketplace removal. Checking only the opposite scope visible from the current directory is also insufficient.
Skillshare boundary
The adapter therefore does not provide a complete OMP plugin lifecycle:
- Reviewed local/Git marketplace installation is allowed for OMP 18.6.1 or later
(
ompMinVersion), a verified cache root, a previously absent cache identity and an absent runtime destination in the selected scope. The reviewed source establishes the runtime package name; preview binds the destination and apply rechecks it before native installation, which otherwise recursively removes that destination. - An unknown root/source, an unparsable, prerelease or pre-18.6.1 version, or an unreadable/linked/non-directory destination blocks installation. Reinstall picks a fresh marketplace/cache identity when retained cache exists; old content and shared registrations are never replaced. Cached install paths from old registrations are not trusted as the next destination.
- Native update/uninstall commands are not invoked. Reviewed updates use scoped removal followed by installation into a fresh cache identity. An existing owned marketplace catalog is refreshed before installation.
- The minimum replaced an exact 18.6.1 pin after the sources this boundary relies on
were compared across every tag from v18.6.1 to v18.10.2:
marketplace/cache.ts,manager.ts,types.ts,cli/plugin-cli.ts,extensions/loader.ts,pi-natives/src/file_lock/mod.rsandresolveActiveProjectRegistryPathindiscovery/helpers.tsare unchanged. Native 18.8.7 install and scoped removal passed in an isolated HOME. Later releases are accepted without that comparison; repeat it when OMP changes its plugin cache, registry or CLI output. - Scoped removal uses
omp_remove.go: delete only the verified scope's registry entry, runtime selection and link, retaining all cache, marketplaces and plugin settings. The plugin is genuinely uninstalled in that scope, not disabled. Ambiguous JSON/ownership, an unsafe native version or cache path, foreign links, real module folders and npm collisions refuse writes. A missing cache manifest requires a unique runtime-lock key whose link targets the exact cache; otherwise active removal fails closed instead of guessing the marketplace name. Windows native writes require private ACLs. - Interrupted removal is retryable from retained cache and the pending verified native identity. Revisions include native registry, runtime lock, dependency/package metadata and link target. Skillshare removals share a lock, but native OMP plugin commands do not; concurrent native mutations are unsupported, not an atomic native CAS.
- Profile/root overrides block plugin management. Cache relocation invalidates reviewed revisions. npm/Git/link packages remain inventory-only.
- Standalone extension selection is separate: verified rows can still be changed
with native locks and revision checks. Runtime lock-only plugin registrations
are valid even without a root
package.jsonand do not falsely block selection.
The UI uses the same Preview/Apply workflow as other Agents, without an OMP-only execution confirmation. Resource loading notes are conditional, not a claim that Markdown-only plugins execute code. Unsafe plans still disable Apply. No native trust prompt is bypassed and no extension code runs during management.
Evidence
TestOMPNeverRunsCacheDestructiveNativeCommands: invisible-project regression; destructive requests emit no native mutation command.TestOMPInstallGuardFailsClosed: unknown version/root/source and unreadable destinations refuse installation.TestOMPPreviewBindsNativeCacheRoot: an XDG-root change invalidates approval.TestOMPExtensionsLockOnlyPlugins: real-directory and linked marketplace runtime entries work with or without the optional root package manifest.- Native isolated tests reproduced the defect and verified blocked Skillshare operations preserve the affected registry, cache and project link.
- Review follow-up in
omp-review-fix-verified-409verified that an undeclared runtime directory and its foreign file survive blocked preview/apply, an empty destination accepts the inert plugin, unverifiable missing-manifest ownership blocks removal, and missing cache metadata still permits complete scoped removal using the proven runtime link name. No Agent or extension code ran. TestOMPRemoveRetainsCacheUsedByInvisibleProject: user and project removal preserve foreign registry/link/cache, unrelated raw values and plugin settings.TestOMPRemovalRefusesForeignLinkAndStaleNativeFile,TestOMPRemovalRefusesUnsafeMetadata, and partial-removal recovery tests cover fail-closed behavior without destructive native commands.TestOMPReinstallAllocatesFreshIdentityWithoutTouchingRetainedCacheverifies stable review and non-destructive reinstallation.- Native
omp_plugins_removal_runbook.mdpassed both real 18.6.1 scenarios: user removal/reinstall preserves an invisible project's cache; project deselection-plus-sync preserves the user installation.
The scoped removal adapter also supports reviewed updates through removal and fresh-cache installation. Native cache collection and native upgrades remain outside its scope. macOS and Windows runtime behavior remains unverified.