diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index f38731676..301bfe319 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -228,8 +228,8 @@ export namespace ACP { const metadata = permission.metadata || {} const filepath = typeof metadata["filepath"] === "string" ? metadata["filepath"] : "" const diff = typeof metadata["diff"] === "string" ? metadata["diff"] : "" - - const content = await Bun.file(filepath).text() + const file = Bun.file(filepath) + const content = await file.exists() ? await file.text() : "" const newContent = getNewContent(content, diff) if (newContent) {