-
Notifications
You must be signed in to change notification settings - Fork 7.9k
feat(bun): track provider packages for automatic cleanup #10275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat(bun): track provider packages for automatic cleanup #10275
Conversation
When a provider switches SDK packages, the old package is now automatically removed to avoid accumulating unused dependencies in the cache. - Add provider tracking in package.json under opencode.providers section - Modify BunProc.install() to accept optional providerID parameter - Remove old package when provider switches to a different SDK - Add comprehensive integration tests for provider tracking
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds automatic tracking and cleanup of npm packages used by providers to prevent accumulation of unused dependencies when providers switch SDKs.
Changes:
- Adds provider-to-package tracking in
package.jsonunderopencode.providerssection - Modifies
BunProc.install()to accept an optionalproviderIDparameter for tracking - Implements automatic removal of old packages when a provider switches to a different SDK
- Adds
OPENCODE_TEST_CACHEenvironment variable for test isolation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/opencode/src/bun/index.ts | Implements provider tracking logic, package switching detection, and automatic cleanup of old packages |
| packages/opencode/src/provider/provider.ts | Passes model.providerID to BunProc.install() to enable tracking |
| packages/opencode/src/global/index.ts | Adds dynamic getter for cache path that respects OPENCODE_TEST_CACHE env var |
| packages/opencode/test/bun.test.ts | Adds 10 integration tests covering provider tracking, package switching, and backward compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Don't remove package if other providers still use it - Fix version comparison to handle "latest" correctly - Add test for shared package scenario
8328b99 to
326ca0e
Compare
326ca0e to
0607311
Compare
Fixes #10276
What changed
Track provider packages in
package.jsonunderopencode.providers. When a provider switches SDK, the old package is removed if no other provider uses it.How to verify
bun test test/bun.test.ts