fix(core): plugins are always reinstalled #9675
Conversation
…and Config to utilize it for dependency checks
…n checking in BunProc and Config modules
|
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: The search results show that PR #9675 (the current PR) appears in the results, but no other open or merged PRs with the exact same title exist. The other results are related to plugin management and fixes, but they appear to be distinct issues:
No duplicate PRs found |
35a824e to
1038fc1
Compare
|
tests failing cause new config.get() does some more blocking for the dependency installation - will figure it out tommorow |
54a515e to
e6030de
Compare
e35f2a5 to
19c2aa4
Compare
|
ready for review |
|
|
||
| // Prevent Config.get() from performing networked `bun info` calls during tests. | ||
| // MCP.startAuth() calls Config.get(), and Config may check registry freshness. | ||
| mock.module("@/bun/registry", () => ({ |
There was a problem hiding this comment.
We don't want to do mocks really ever if we can help it
| const result = Bun.spawn([which(), "info", pkg, field], { | ||
| cwd, | ||
| stdout: "pipe", | ||
| stderr: "pipe", | ||
| env: { |
There was a problem hiding this comment.
can't we use BunProc here instead? it already bakes in the which() logic
|
/review |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
| async function waitFor(check: () => boolean, timeoutMs = 8_000) { | ||
| const start = Date.now() | ||
| async function loop(): Promise<void> { | ||
| if (check()) return | ||
| if (Date.now() - start > timeoutMs) { | ||
| throw new Error(`Timed out waiting for condition after ${timeoutMs}ms`) | ||
| } | ||
| await new Promise((resolve) => setTimeout(resolve, 10)) | ||
| return loop() | ||
| } | ||
| await loop() | ||
| } | ||
|
|
||
| // Mock UnauthorizedError |
There was a problem hiding this comment.
are these changes actually needed??
There was a problem hiding this comment.
I reverted those change but threw in a bigger timeout singe Config.get() takes a little longer now
|
/review |
|
lgtm |
What does this PR do?
Plugins
@latestwere always reinstalled even if their version was cachedHow did you verify your code works?
Check in the logs whether plugins are installed twice
For example
Run without any plugins
Add
oh-my-opencodeIt should say in the logs that it's installing
Run again and it shouldn't install it anymore