summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-04-10 21:01:33 +0000
committeropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-04-10 21:01:33 +0000
commit57b2e64345c81fdbc9ea22cbba3889de994d2d53 (patch)
treef15016107eb83efad157d6f7ef756e843e4d91a3
parent346b3e1b8d1925970e451583d6bb84e491eb9a99 (diff)
downloadopencode-57b2e64345c81fdbc9ea22cbba3889de994d2d53.tar.gz
opencode-57b2e64345c81fdbc9ea22cbba3889de994d2d53.zip
chore: generate
-rw-r--r--packages/opencode/src/tool/write.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/opencode/src/tool/write.ts b/packages/opencode/src/tool/write.ts
index 444ff6ea6..23a975abc 100644
--- a/packages/opencode/src/tool/write.ts
+++ b/packages/opencode/src/tool/write.ts
@@ -33,7 +33,9 @@ export const WriteTool = Tool.defineEffect(
}),
execute: (params: { content: string; filePath: string }, ctx: Tool.Context) =>
Effect.gen(function* () {
- const filepath = path.isAbsolute(params.filePath) ? params.filePath : path.join(Instance.directory, params.filePath)
+ const filepath = path.isAbsolute(params.filePath)
+ ? params.filePath
+ : path.join(Instance.directory, params.filePath)
yield* assertExternalDirectoryEffect(ctx, filepath)
const exists = yield* fs.existsSafe(filepath)
@@ -74,7 +76,9 @@ export const WriteTool = Tool.defineEffect(
if (errors.length === 0) continue
const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE)
const suffix =
- errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""
+ errors.length > MAX_DIAGNOSTICS_PER_FILE
+ ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more`
+ : ""
if (file === normalizedFilepath) {
output += `\n\nLSP errors detected in this file, please fix:\n<diagnostics file="${filepath}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`
continue