diff options
| author | kenryu42 <[email protected]> | 2026-01-17 05:32:05 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-16 14:32:05 -0600 |
| commit | 98578d3a7b4cbb0e700236df346100141c724fd8 (patch) | |
| tree | 27d96458a45f6a819d59b32b9327d8474d9f046b /packages | |
| parent | bc3616d9c636b885bdf322ead70217b216a90cda (diff) | |
| download | opencode-98578d3a7b4cbb0e700236df346100141c724fd8.tar.gz opencode-98578d3a7b4cbb0e700236df346100141c724fd8.zip | |
fix(bun): reinstall plugins when cache module missing (#8815)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/bun/index.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts index fe2f0dec3..a18bbd14d 100644 --- a/packages/opencode/src/bun/index.ts +++ b/packages/opencode/src/bun/index.ts @@ -2,6 +2,7 @@ import z from "zod" import { Global } from "../global" import { Log } from "../util/log" import path from "path" +import { Filesystem } from "../util/filesystem" import { NamedError } from "@opencode-ai/util/error" import { readableStreamToText } from "bun" import { createRequire } from "module" @@ -71,7 +72,10 @@ export namespace BunProc { await Bun.write(pkgjson.name!, JSON.stringify(result, null, 2)) return result }) - if (parsed.dependencies[pkg] === version) return mod + const dependencies = parsed.dependencies ?? {} + if (!parsed.dependencies) parsed.dependencies = dependencies + const modExists = await Filesystem.exists(mod) + if (dependencies[pkg] === version && modExists) return mod const proxied = !!( process.env.HTTP_PROXY || |
