fix(auto-update): clean stale OMO plugin specifier cache roots#3713
Open
deopa0402 wants to merge 2 commits intocode-yeongyu:devfrom
Open
fix(auto-update): clean stale OMO plugin specifier cache roots#3713deopa0402 wants to merge 2 commits intocode-yeongyu:devfrom
deopa0402 wants to merge 2 commits intocode-yeongyu:devfrom
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Targeted cleanup of OMO-specific cache/lockfile entries with robust testing and isolation to prevent regressions in unrelated packages.
Author
|
I have read the CLA Document and I hereby sign the CLA |
Puri12
added a commit
to Puri12/oh-my-openagent
that referenced
this pull request
Apr 28, 2026
Picks up @deopa0402 CLA signing (PR code-yeongyu#3713).
VoidChecksum
added a commit
to VoidChecksum/oh-my-openagent
that referenced
this pull request
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
OpenCode can keep loading an old OMO plugin install from a stale package specifier cache root such as
~/.cache/opencode/packages/oh-my-openagent@latest, even after the valid cached package has been updated elsewhere. In that state, OMO may continue running outdated plugin code until the stale specifier root is manually removed.Summary
node_modules/<pkg>to stale<pkg>@<specifier>cache directories.Changes
invalidatePackage()to expand the default OMO package name to all accepted package names:oh-my-opencodeoh-my-openagentpackages/oh-my-opencode@latestpackages/oh-my-openagent@latestinvalidatePackage("some-other-package")only invalidates that packagebun.lockinvalidation more surgical:lock.packagesotherandsome-other-packagebun.lockbfallback behavior unchanged:bun.lockis presentTesting
bun test src/hooks/zauc-mocks-cache/cache.test.tsResult:
bun test src/hooks/auto-update-checker/checker/cached-version.test.ts \ src/hooks/auto-update-checker/checker/package-json-locator.test.ts \ src/hooks/zauc-mocks-cache/cache.test.tsResult:
Both passed.
Additional isolated integration checks:
HOME,XDG_CACHE_HOME, andXDG_CONFIG_HOME.invalidatePackage()removes selected OMO cache entries:oh-my-openagent@latestoh-my-opencode@latestnode_modulescache entries~/.cache/opencode~/.config/opencodeOld-vs-current A/B verification:
oh-my-openagent@latestremainedNote: raw
bun testcurrently fails on unrelated existing/environmental test isolation issues outside the changed cache files.Related Issues
Related to #3522 and #3704.
Related prior attempt: #2395 tried to invalidate stale OpenCode plugin cache from
postinstall, but it was not merged due to concerns around shared cache/lockfile deletion. This PR takes a narrower approach: it does not run frompostinstall, does not delete the shared textbun.lockwholesale, and removes only accepted OMO package entries plus stale OMO specifier-root directories.Complements #2291 by covering stale OMO specifier-root cache directories that are not handled by the existing
node_modules/<pkg>invalidation.Need help on this PR? Tag
@codesmithwith what you need.Summary by cubic
Fixes stale OMO plugin cache so OpenCode doesn’t load old code by removing specifier-root cache dirs (e.g.,
oh-my-openagent@latest) and narrowing lockfile edits. Invalidation now covers bothoh-my-opencodeandoh-my-openagentwhile preserving unrelated cache and lock entries.packages/foroh-my-opencodeandoh-my-openagent; also clear matchingnode_modulesentries.bun.lockhandling to delete only targeted OMO entries; keepbun.lockbbehavior unchanged.invalidatePackage("some-other-package")affects only that package.invalidatePackage()andgetCachedVersion()for deterministic tests.Written for commit 1b01fc3. Summary will update on new commits. Review in cubic