Skip to content

The open source coding agent.

TypeScript

tweak: add newline between <content> and first line of read tool output to prevent confusion (#21070)

Aiden Cline3a0e00dd7f91
diff --git a/packages/opencode/src/tool/read.ts b/packages/opencode/src/tool/read.ts
index 366993020ba..0b44c7ad5a7 100644
--- a/packages/opencode/src/tool/read.ts
+++ b/packages/opencode/src/tool/read.ts
@@ -185,7 +185,7 @@ export const ReadTool = Tool.defineEffect(
)
}
- let output = [`<path>${filepath}</path>`, `<type>file</type>`, "<content>"].join("\n")
+ let output = [`<path>${filepath}</path>`, `<type>file</type>`, "<content>" + "\n"].join("\n")
output += file.raw.map((line, i) => `${i + file.offset}: ${line}`).join("\n")
const last = file.offset + file.raw.length - 1