Repository navigation
fix(plugin): refresh stale OMP catalog and report blocked OMP updates - #853
Conversation
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.
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.
Retry matching pending removals before reinstalling after registry-first interruption, and clarify isolated failure reporting. Strengthen recovery fixtures and restore accurate installation guidance.
Use the cached marketplace entry for native install version and source so the stale catalog regression exercises the real version-to-cache relationship.
Require catalog refresh before reinstalling from an owned marketplace and assert isolated failures when native OMP ownership cannot be verified, while healthy targets update.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
runkids
left a comment
There was a problem hiding this comment.
Thanks for the thorough fix. All three asks from #851 are covered: install refreshes an already-registered catalog, removal follows the verified registry entry, and a blocked refresh under update --all --json now fails with a non-zero exit. CI is green. A few things to address before merge (details inline where they anchor to the diff):
1. Imported OMP plugins now fail every update --all (correctness) — see inline on service.go.
2. Translations out of sync (website/i18n/{ja,ko,zh-Hans,zh-Hant}/.../reference/commands/plugin.md)
- The bullet matching English
plugin.md~L502-504 still says an update skips an unreachable target:ja:300,ko:226,zh-Hans:328-329,zh-Hant:323. The English now says it reports a failed target, continues healthy ones, and that a dry run exits non-zero withfailed: truein JSON. - Instead, each locale gained a new dry-run paragraph near L52-57 that English does not have at that position, so the structure no longer mirrors the English page. Please move it into that bullet.
- All four also miss the clause "even if the binding version differs" in the OMP removal requirements.
3. Test gaps
- No test covers
update --allwith an imported (source-less) OMP binding — the case in (1). - The dry-run failure test uses a Claude binding; no dry-run case exercises an OMP failure.
4. E2E runbook — ai_docs/tests/omp_plugins_removal_runbook.md only gained a sentence in the intro. Since this hasn't been run against a real omp, please add steps and expected output for (a) removal when the native registry version differs from the binding, and (b) update --all reporting the unverifiable OMP target as failed while other targets update.
5. PR checklist — "reviewed every line" and "make check passing" are unticked, and the body says the tests weren't verified locally. CI now passes; please tick them once you've confirmed, per CONTRIBUTING.md's AI-assisted contributions section.
Cleanup suggestions are inline and optional.
| } | ||
| if r.isolatesTargets() && c.Action == "blocked" { | ||
| c.Action, c.batchError = "skip", true | ||
| c.Action, c.Failed = "skip", true |
There was a problem hiding this comment.
Regression: imported OMP plugins now make every update --all fail.
The removed special case also covered plugins.error.ompNativeDestructive, which is not a blocked refresh but a by-design "never upgrade without a reviewed source" outcome.
Scenario: skillshare plugin import --from omp demo@team (binding has Source == ""), then skillshare plugin update --all -g:
checkOrUpdatereturns the change unchanged asupdatefor a source-less binding (L842-852).ompGuardblocks it withompNativeDestructive(omp.go:164-166).- Here it becomes
skip+Failed, andlifecycle.go:152records a failure → exit 1 on every run.
For the hourly update --all job from #851 that is a permanent false failure, and the docs say imported code is simply never upgraded. Suggest keeping the skip for the source-less ompNativeDestructive case and only surfacing ompRefresh blocks as failures, plus a test for an imported OMP binding under update --all.
There was a problem hiding this comment.
Fixed in 73bcbc6b35d8369745df34ef134206ce229ffd1a. Source-less OMP updates already have an intentional skip, but native upgrade capability was checked before reaching it. The fix avoids that probe for imported OMP updates while preserving host errors and sourced-refresh failures.
TestOMPImportOfAPackagePluginIsRefusedWithItsReason now previews and applies update --all with an imported binding and unavailable native upgrade support, asserting a non-failing skip and no native mutation. TestPluginUpdateAllDryRunReportsOMPFailure separately checks that an OMP failure remains visible in JSON and returns an error. Current-head upstream CI is the runtime gate; no local suite was run.
| if c.Action == "remove" || c.Action == "uninstall" || c.Action == "forget" { | ||
| local := d.state.Bindings[c.Name][c.Target] | ||
| reviewedVersion := c.Binding.Version | ||
| if local.Pending != nil && (local.Pending.Action == "remove" || local.Pending.Action == "forget" || local.Pending.Action == "uninstall") && local.Pending.Store == s.storeIdentity(c.Target) && local.Pending.Binding.ID == c.Binding.ID && local.Pending.OMPRemovalVersion != "" { |
There was a problem hiding this comment.
Nit (optional): this pending-removal predicate duplicates L564, and the two copies already differ (this one adds OMPRemovalVersion != ""). A small helper, e.g. pendingRemoval(local, target, id) *receipt, would keep preview and prepare in step.
Also, mutating c.Binding.Version and restoring it after prepareOMPRemoval works today, but an early return added in between would leak the native version into the reviewed binding/receipt. Passing the removal version to prepareOMPRemoval explicitly would avoid that.
There was a problem hiding this comment.
Thanks for the suggestion. I left this optional extraction unchanged in the focused feedback commit 73bcbc6b35d8369745df34ef134206ce229ffd1a; the pending-removal and version-restoration paths retain their existing regression coverage. The correctness fix is limited to the imported-update capability probe, with the requested tests, translations and runbook steps alongside it.
| } | ||
| e := entries[0] | ||
| v := e.Version | ||
| if e.Scope != scope || v == "" || filepath.Base(v) != v || strings.ContainsAny(v, "\\/\r\n\x00") || !filepath.IsAbs(e.InstallPath) || filepath.Clean(e.InstallPath) != ompCachePath(cacheRoot, b.ID, v) || ompSafePath(e.InstallPath) != nil { |
There was a problem hiding this comment.
Nit (optional): the version-safety check (v != "" && filepath.Base(v) == v && !strings.ContainsAny(v, ...)) now appears three times (L104, here, and omp_cache.go:86). A validOMPVersion helper would keep them from drifting, and splitting this long condition would make each rejection reason distinguishable.
There was a problem hiding this comment.
I deferred the optional version-helper extraction in 73bcbc6b35d8369745df34ef134206ce229ffd1a to keep the feedback fix small. The existing version/path rejection checks remain intact; TestOMPRemovalRejectsUnverifiedNativeIdentity covers unsafe versions, scope/path mismatches and duplicate entries.
| Use native OMP 18.6.1 or later and an inert plugin to verify scoped removal, retained | ||
| shared cache used by an invisible project, and reinstall into a new cache | ||
| identity. No Agent session, extension code or real user configuration is used. | ||
| identity. A scope-matching native registry version may differ from the recorded binding when its cache path is verified. An unverifiable batch update reports failure while continuing other targets. No Agent session, extension code or real user configuration is used. |
There was a problem hiding this comment.
This states the new behaviours but adds no steps or expected output for them. See point 4 in the review summary.
There was a problem hiding this comment.
Added concrete scenarios in 73bcbc6b35d8369745df34ef134206ce229ffd1a: step 4 constructs a native registry/cache version different from the recorded binding, previews and removes it, and checks that both caches remain. Step 5 makes an OMP runtime destination unverifiable, then checks that dry-run and apply exit nonzero, JSON reports the failed OMP target, a healthy Cursor target updates, and the OMP registry stays unchanged. Both scenarios include expected output and assertions. The real-OMP runbook has not been executed.
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.
|
@codex review The maintainer feedback fix is pushed as |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
runkids
left a comment
There was a problem hiding this comment.
Re-reviewed 73bcbc6: all five points from the previous review are addressed. Merging; two small doc follow-ups (runbook Pass Criteria for steps 4-5, and the "present registry entry" nuance in the four plugin.md translations) will be handled separately.
#873) * fix(plugin): verify native support only for changes that run a command prepareChange probed native command support before applying the intentional skip rules. When the probe failed under update --all, the change was marked as a failed target, so the later skip never applied. An imported Grok plugin always hit this: Grok updates require native trust, so every update --all exited nonzero even though Grok plugins are documented as updated natively. #853 patched the same ordering for imported OMP plugins only. Run the probe after the skip rules instead, so a skipped change is never verified, and drop the OMP-specific exemption it made redundant. Host errors and changes that do run a native command still fail as before. * docs(plugin): align OMP removal wording and runbook pass criteria The translated plugin references said OMP removal requires a scope-matching native registration. English, and the code, only require that a registration match when one is present; a retry after native uninstall proceeds from the retained cache. The runbook's Pass Criteria also did not cover the two scenarios #853 added as steps 4 and 5.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Summary
An OMP install into a marketplace that was already registered used OMP's cached catalog, so OMP recorded an older version than the binding. The next update then could not find the cache to remove, and
update --allskipped it with exit 0.installnow runsomp plugin marketplace update <market>first, asupdatealready did.installed_plugins.jsonhas an entry for the binding, removal uses that entry's version and cache path, but only after checking scope, version, and thatinstallPathis the expected safe cache path. Shared caches are kept as before.ompRemovalVersion, optional field). A retry removes that version and keeps the reviewed binding version. Anupdatethat would install a sourced OMP binding with a pending removal for the same binding and store goes through the refresh path again.--all: a blocked OMP refresh is no longer turned into a silentskipped. Failed changes carryfailed: truein the plan JSON, show as failed in the CLI preview and Web UI, and make--dry-runexit nonzero. Healthy changes in the same batch still apply.skillshare plugin(English and translations) and the OMP notes are updated to match.Linked Issue
Issue #851 (closing line below).
Testing
Coverage includes
TestOMPStaleCatalogRecovery,TestOMPMismatchedNativeVersionRemoval,TestOMPRemovalRejectsUnverifiedNativeIdentity,TestPluginUpdateAllDryRunReportsFailures(text and JSON), the imported OMPupdate --allpreview/apply assertions inTestOMPImportOfAPackagePluginIsRefusedWithItsReason, andTestPluginUpdateAllDryRunReportsOMPFailure.The complete PR diff and feedback delta were read; two independent blind source reviews found no confirmed issue in
73bcbc6b35d8369745df34ef134206ce229ffd1a. Upstream CI on that head: Test run 43154959356 passed its unit job (including context, Herdr, formatting and vet), Ubuntu integration, Windows and redteam; Nix run 43154959476 passed. macOS integration and Docker-offline also passed; Docker-online and redteam-signal were skipped by the workflow. This covers themake checksteps through the workflow's context check, formatting, vet, Herdr tests, Go unit tests and integration tests. No local suite was run. Real-OMP execution and the website build remain unrun; runbook steps 4 and 5 now give explicit procedures and expected output for differing-version removal and an unverifiable batch target.The requested new Codex review was refused because the GitHub reviewer account reached its usage limit. No
roborev-ciworkflow or check is exposed for this PR; no local replacement was run.Checklist
make check) — equivalent CI steps passed on this head; see TestingCloses #851