Skip to content

The open source coding agent.

TypeScript

fix: use Instance.directory instead of process.cwd() in read tool

Aiden Cline6cf2c3e3db62
diff --git a/packages/opencode/bunfig.toml b/packages/opencode/bunfig.toml
index c227328d5ae..db64a09a988 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 028a007ccc0..93c1b751ffc 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)