Skip to content

Commit 894e638

Browse files
opencode-agent[bot]rekram1-node
authored andcommitted
chore: generate
1 parent 8113a43 commit 894e638

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎packages/opencode/src/tool/apply_patch.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,15 @@ export const ApplyPatchTool = Tool.define(
151151
}
152152

153153
case "delete": {
154-
const source = yield* Bom
155-
.readFile(afs, filePath)
156-
.pipe(
157-
Effect.catch((error) =>
158-
Effect.fail(
159-
new Error(
160-
`apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`,
161-
),
154+
const source = yield* Bom.readFile(afs, filePath).pipe(
155+
Effect.catch((error) =>
156+
Effect.fail(
157+
new Error(
158+
`apply_patch verification failed: ${error instanceof Error ? error.message : String(error)}`,
162159
),
163160
),
164-
)
161+
),
162+
)
165163
const contentToDelete = source.text
166164
const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, ""))
167165

‎packages/opencode/test/tool/apply_patch.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ describe("tool.apply_patch freeform", () => {
206206
const target = path.join(fixture.path, "example.cs")
207207
await fs.writeFile(target, `${bom}using System;\n\nclass Test {}\n`, "utf-8")
208208

209-
const patchText = "*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch"
209+
const patchText =
210+
"*** Begin Patch\n*** Update File: example.cs\n@@\n class Test {}\n+class Next {}\n*** End Patch"
210211

211212
await execute({ patchText }, ctx)
212213

0 commit comments

Comments
 (0)