- #3124: Session tools now merge SDK and file-backed sessions for SQLite backend - #3125: Cache priming fixed for OpenCode >=1.3.14 empty workspace - #3127: Activity-based progress detection prevents infinite compaction on Kimi/Minimax All 29 new tests pass, 4885 total tests passing.
This commit is contained in:
@@ -64,7 +64,7 @@ describe("runBunInstallWithDetails", () => {
|
||||
expect(result).toEqual({ success: true })
|
||||
expect(getOpenCodeCacheDirSpy).toHaveBeenCalledTimes(1)
|
||||
expect(spawnWithWindowsHideSpy).toHaveBeenCalledWith(["bun", "install"], {
|
||||
cwd: "/tmp/opencode-cache",
|
||||
cwd: "/tmp/opencode-cache/packages",
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
})
|
||||
@@ -81,7 +81,7 @@ describe("runBunInstallWithDetails", () => {
|
||||
// then
|
||||
expect(result).toEqual({ success: true })
|
||||
expect(spawnWithWindowsHideSpy).toHaveBeenCalledWith(["bun", "install"], {
|
||||
cwd: "/tmp/opencode-cache",
|
||||
cwd: "/tmp/opencode-cache/packages",
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
})
|
||||
@@ -98,7 +98,7 @@ describe("runBunInstallWithDetails", () => {
|
||||
// then
|
||||
expect(result).toEqual({ success: true })
|
||||
expect(spawnWithWindowsHideSpy).toHaveBeenCalledWith(["bun", "install"], {
|
||||
cwd: "/tmp/opencode-cache",
|
||||
cwd: "/tmp/opencode-cache/packages",
|
||||
stdout: "inherit",
|
||||
stderr: "inherit",
|
||||
})
|
||||
@@ -174,7 +174,7 @@ describe("runBunInstallWithDetails", () => {
|
||||
expect(outcome.result).toEqual({
|
||||
success: false,
|
||||
timedOut: true,
|
||||
error: 'bun install timed out after 60 seconds. Try running manually: cd "/tmp/opencode-cache" && bun i',
|
||||
error: 'bun install timed out after 60 seconds. Try running manually: cd "/tmp/opencode-cache/packages" && bun i',
|
||||
} satisfies BunInstallResult)
|
||||
expect(killCallCount).toBe(1)
|
||||
} finally {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { existsSync } from "node:fs"
|
||||
import { join } from "node:path"
|
||||
|
||||
import { getOpenCodeCacheDir } from "../../shared/data-path"
|
||||
import { log } from "../../shared/logger"
|
||||
@@ -40,6 +41,10 @@ export async function runBunInstall(): Promise<boolean> {
|
||||
return result.success
|
||||
}
|
||||
|
||||
function getDefaultWorkspaceDir(): string {
|
||||
return join(getOpenCodeCacheDir(), "packages")
|
||||
}
|
||||
|
||||
function readProcessOutput(stream: ProcessOutputStream): Promise<string> {
|
||||
if (!stream) {
|
||||
return Promise.resolve("")
|
||||
@@ -67,7 +72,7 @@ function logCapturedOutputOnFailure(outputMode: BunInstallOutputMode, output: Bu
|
||||
|
||||
export async function runBunInstallWithDetails(options?: RunBunInstallOptions): Promise<BunInstallResult> {
|
||||
const outputMode = options?.outputMode ?? "pipe"
|
||||
const cacheDir = options?.workspaceDir ?? getOpenCodeCacheDir()
|
||||
const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir()
|
||||
const packageJsonPath = `${cacheDir}/package.json`
|
||||
|
||||
if (!existsSync(packageJsonPath)) {
|
||||
|
||||
Reference in New Issue
Block a user