fix(auto-update-checker): use OpenCode cache paths for updates#2380
Merged
acamq merged 4 commits intocode-yeongyu:devfrom Mar 8, 2026
Merged
fix(auto-update-checker): use OpenCode cache paths for updates#2380acamq merged 4 commits intocode-yeongyu:devfrom
acamq merged 4 commits intocode-yeongyu:devfrom
Conversation
Align version lookup, invalidation, and bun install with OpenCode's cache directory so updates target the loaded plugin location. Keep dependency declarations intact during invalidation so auto-update can reinstall instead of converging to uninstall.
Collaborator
Author
|
@cubic-dev-ai review |
@acamq I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 6 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Fixes path consistency by using cache directory and improves update reliability with better invalidation logic. Includes comprehensive regression tests.
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 4/5
- This PR is likely safe to merge with minimal risk: the reported problem is confined to test behavior in
src/hooks/auto-update-checker/cache.test.ts, not a clear runtime production regression. - Most severe issue: dynamic import cache busting does not affect dependencies, so
constants.tscan remain cached and make this test flaky/non-deterministic in CI. - Given the 6/10 severity and high confidence (9/10), this is a real reliability concern for test stability, but it appears limited in scope rather than merge-blocking functionality risk.
- Pay close attention to
src/hooks/auto-update-checker/cache.test.tsandconstants.ts- dependency caching can undermine cache-busting assumptions and cause flaky test outcomes.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/hooks/auto-update-checker/cache.test.ts">
<violation number="1" location="src/hooks/auto-update-checker/cache.test.ts:63">
P2: Dynamic import cache busting does not apply to dependencies, causing test flakiness due to `constants.ts` caching.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Mock constants directly in cache.test to avoid transitive module-cache reuse when importing cache.ts. This removes Date.now query cache-busting and makes the test deterministic across runs.
- Support binary bun.lockb format by deleting entire file (cannot parse) - Add workspace check: verify package.json exists before bun install - Quote paths in error messages for Windows/paths with spaces
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.
Summary
node_modules+ resolved lock package entry) while preserving declared dependencies so update flow does not converge to uninstallSummary by cubic
Fixes the auto-update flow to use the OpenCode cache directory and correctly handle Bun lockfiles, so updates target the loaded plugin and don’t uninstall it.
getOpenCodeCacheDir():CACHE_DIR,INSTALLED_PACKAGE_JSON, and lockfile paths; runbun installin that directory.package.jsonexists; improve timeout handling with quoted paths and safer process kill logging.node_modules/oh-my-opencodeand thepackagesentry frombun.lock; supportbun.lockbby deleting it; keeppackage.jsonand workspace dependency declarations intact.bun installcwd.Written for commit c4112f8. Summary will update on new commits.