diff --git a/packages/opencode/test/acp/tool.test.ts b/packages/opencode/test/acp/tool.test.ts index c5dc85d7dd8a..1713f6faf09b 100644 --- a/packages/opencode/test/acp/tool.test.ts +++ b/packages/opencode/test/acp/tool.test.ts @@ -1,3 +1,4 @@ +import { resolve } from "path" import { describe, expect, test } from "bun:test" import { completedToolContent, @@ -38,8 +39,9 @@ describe("acp tool conversion", () => { { path: "/tmp/outside" }, ]) expect(toLocations("bash", { cmd: "pwd" }, "/workspace")).toEqual([{ path: "/workspace" }]) + // Relative workdir resolves against cwd via the platform path resolver (backslashes on Windows). expect(toLocations("bash", { command: "pwd", workdir: "subdir" }, "/workspace")).toEqual([ - { path: "/workspace/subdir" }, + { path: resolve("/workspace", "subdir") }, ]) expect(toLocations("bash", { command: "pwd", workdir: "/abs/dir" }, "/workspace")).toEqual([{ path: "/abs/dir" }]) expect(toLocations("bash", { command: "printf hello" })).toEqual([])