summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/bun/index.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts
index edf74c310..c0f90e6ca 100644
--- a/packages/opencode/src/bun/index.ts
+++ b/packages/opencode/src/bun/index.ts
@@ -127,7 +127,18 @@ export namespace BunProc {
await runInstall()
- parsed.dependencies[pkg] = version
+ // Resolve actual version from installed package when using "latest"
+ // This ensures subsequent starts use the cached version until explicitly updated
+ let resolvedVersion = version
+ if (version === "latest") {
+ const installedPkgJson = Bun.file(path.join(mod, "package.json"))
+ const installedPkg = await installedPkgJson.json().catch(() => null)
+ if (installedPkg?.version) {
+ resolvedVersion = installedPkg.version
+ }
+ }
+
+ parsed.dependencies[pkg] = resolvedVersion
await Bun.write(pkgjson.name!, JSON.stringify(parsed, null, 2))
return mod
}