chore: generate

This commit is contained in:
opencode-agent[bot]
2026-04-10 23:43:20 +00:00
parent 0556774097
commit f2c492a8e6

View File

@@ -142,9 +142,9 @@ export const ApplyPatchTool = Tool.defineEffect(
} }
case "delete": { case "delete": {
const contentToDelete = yield* afs.readFileString(filePath).pipe( const contentToDelete = yield* afs
Effect.catch((error) => Effect.fail(new Error(`apply_patch verification failed: ${error}`))), .readFileString(filePath)
) .pipe(Effect.catch((error) => Effect.fail(new Error(`apply_patch verification failed: ${error}`))))
const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, "")) const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, ""))
const deletions = contentToDelete.split("\n").length const deletions = contentToDelete.split("\n").length
@@ -269,9 +269,7 @@ export const ApplyPatchTool = Tool.defineEffect(
if (errors.length > 0) { if (errors.length > 0) {
const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE) const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE)
const suffix = const suffix =
errors.length > MAX_DIAGNOSTICS_PER_FILE errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""
? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more`
: ""
output += `\n\nLSP errors detected in ${path.relative(Instance.worktree, target).replaceAll("\\", "/")}, please fix:\n<diagnostics file="${target}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>` output += `\n\nLSP errors detected in ${path.relative(Instance.worktree, target).replaceAll("\\", "/")}, please fix:\n<diagnostics file="${target}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`
} }
} }