From 6cf2c3e3db629757bcace9528b0c84f107bf73a7 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 26 Jan 2026 20:57:42 -0500 Subject: [PATCH] fix: use Instance.directory instead of process.cwd() in read tool --- packages/opencode/bunfig.toml | 2 -- packages/opencode/src/tool/read.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/opencode/bunfig.toml b/packages/opencode/bunfig.toml index c227328d5..db64a09a9 100644 --- a/packages/opencode/bunfig.toml +++ b/packages/opencode/bunfig.toml @@ -3,5 +3,3 @@ preload = ["@opentui/solid/preload"] [test] preload = ["./test/preload.ts"] timeout = 10000 # 10 seconds (default is 5000ms) -# Enable code coverage -coverage = true diff --git a/packages/opencode/src/tool/read.ts b/packages/opencode/src/tool/read.ts index 028a007cc..93c1b751f 100644 --- a/packages/opencode/src/tool/read.ts +++ b/packages/opencode/src/tool/read.ts @@ -24,7 +24,7 @@ export const ReadTool = Tool.define("read", { async execute(params, ctx) { let filepath = params.filePath if (!path.isAbsolute(filepath)) { - filepath = path.join(process.cwd(), filepath) + filepath = path.join(Instance.directory, filepath) } const title = path.relative(Instance.worktree, filepath)