fix(gemini): resolve companion from nested node_modules in cache#93
Merged
slkiser merged 2 commits intoMay 17, 2026
Merged
Conversation
node_modules in cache
Owner
|
@anthonyhaussman Thanks for fix! Could I ask what model(s) you use form Gemini? |
Contributor
Author
@slkiser, I use the |
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
Fix companion plugin resolution issue affecting both
opencode-gemini-authandopencode-antigravity-auth.When OpenCode caches companion plugins internally, it extracts them into a nested
node_modulesstructure (e.g.,~/.cache/opencode/packages/opencode-gemini-auth@latest/node_modules/opencode-gemini-auth/dist/index.js).Previously, the
opencode-quotacompanion resolution logic only probed the package root without traversing into this nestednode_modulesdirectory.This caused the resolution to fail and cache an invalid presence state when fallback resolutions were exhausted (which happens after a cache wipe).
This fix updates
getRuntimePackageRootsto also yield the nestednode_modules/[COMPANION_PACKAGE_NAME]path within the runtime cache directory structure, allowing the resolution logic to correctly locate and load the plugin's credentials.Linked Issue
This resolves the bug where executing
opencode-quotaoutside the context of a fully initialized OpenCode session (or afterwiping the
.cachefolder) would fail to resolve locally cached companion plugins.OpenCode Validation
Quality Checklist
pnpm run typecheckpnpm testpnpm run buildREADME.mdandCONTRIBUTING.mdwhen applicable)contributing/provider-template/or explained why the template does not apply.tstemplate incontributing/provider-template/and verifiedREADME.mdagainstsrc/lib/provider-metadata.ts(authentication/authFallbacks) and provider auth resolver/diagnostics behavior