From e51f92047416e87bd91b35a8175d9a7b483b8935 Mon Sep 17 00:00:00 2001 From: Nick <105120312+nick-vi@users.noreply.github.com> Date: Tue, 9 Dec 2025 22:36:26 +0200 Subject: [PATCH] fix: resolve 'latest' to actual version when caching plugins --- packages/opencode/src/bun/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts index edf74c310971..c0f90e6ca76c 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 }