diff options
| author | opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> | 2026-04-22 08:06:06 +0000 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2026-04-23 00:25:37 -0400 |
| commit | 894e63891483cb0d79f7ca28410dcdfa604d35bf (patch) | |
| tree | c15ab81c3b69723dd15d973f1b753e4f9051afda | |
| parent | 8113a4360e789fb25ac16d5619e732f3152ad3df (diff) | |
| download | opencode-894e63891483cb0d79f7ca28410dcdfa604d35bf.tar.gz opencode-894e63891483cb0d79f7ca28410dcdfa604d35bf.zip | |
chore: generate
| -rw-r--r-- | packages/opencode/src/tool/apply_patch.ts | 16 | ||||
| -rw-r--r-- | packages/opencode/test/tool/apply_patch.test.ts | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/packages/opencode/src/tool/apply_patch.ts b/packages/opencode/src/tool/apply_patch.ts index e36d5a65d..a4cf1e853 100644 --- a/packages/opencode/src/tool/apply_patch.ts +++ b/packages/opencode/src/tool/apply_patch.ts @@ -151,17 +151,15 @@ export const ApplyPatchTool = Tool.define( } case "delete": { - const source = yield* Bom - .readFile(afs, filePath) - .pipe( - Effect.catch((error) => - Effect.fail( - new Error( - `apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`, - ), + const source = yield* Bom.readFile(afs, filePath).pipe( + Effect.catch((error) => + Effect.fail( + new Error( + `apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`, ), ), - ) + ), + ) const contentToDelete = source.text const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, "")) diff --git a/packages/opencode/test/tool/apply_patch.test.ts b/packages/opencode/test/tool/apply_patch.test.ts index 7ce483726..fa8843213 100644 --- a/packages/opencode/test/tool/apply_patch.test.ts +++ b/packages/opencode/test/tool/apply_patch.test.ts @@ -206,7 +206,8 @@ describe("tool.apply_patch freeform", () => { const target = path.join(fixture.path, "example.cs") await fs.writeFile(target, `${bom}using System;\n\nclass Test {}\n`, "utf-8") - const patchText = "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch" + const patchText = + "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch" await execute({ patchText }, ctx) |
