chore: generate
This commit is contained in:
@@ -101,10 +101,7 @@ describe("AppProcess", () => {
|
|||||||
"truncates stderr when maxErrorBytes is set",
|
"truncates stderr when maxErrorBytes is set",
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const svc = yield* AppProcess.Service
|
const svc = yield* AppProcess.Service
|
||||||
const result = yield* svc.run(
|
const result = yield* svc.run(cmd("-e", "process.stderr.write('0123456789')"), { maxErrorBytes: 5 })
|
||||||
cmd("-e", "process.stderr.write('0123456789')"),
|
|
||||||
{ maxErrorBytes: 5 },
|
|
||||||
)
|
|
||||||
expect(result.exitCode).toBe(0)
|
expect(result.exitCode).toBe(0)
|
||||||
expect(result.stdoutTruncated).toBe(false)
|
expect(result.stdoutTruncated).toBe(false)
|
||||||
expect(result.stderrTruncated).toBe(true)
|
expect(result.stderrTruncated).toBe(true)
|
||||||
|
|||||||
@@ -633,11 +633,13 @@ export const maybeParseApplyPatchVerified = Effect.fn("Patch.maybeParseApplyPatc
|
|||||||
|
|
||||||
case "update": {
|
case "update": {
|
||||||
const updatePath = path.resolve(effectiveCwd, hunk.path)
|
const updatePath = path.resolve(effectiveCwd, hunk.path)
|
||||||
const originalText = yield* fs.readFileString(updatePath).pipe(
|
const originalText = yield* fs
|
||||||
Effect.catch((cause) =>
|
.readFileString(updatePath)
|
||||||
Effect.succeed(new Error(`Failed to read file ${updatePath}: ${cause}`, { cause })),
|
.pipe(
|
||||||
),
|
Effect.catch((cause) =>
|
||||||
)
|
Effect.succeed(new Error(`Failed to read file ${updatePath}: ${cause}`, { cause })),
|
||||||
|
),
|
||||||
|
)
|
||||||
if (originalText instanceof Error) {
|
if (originalText instanceof Error) {
|
||||||
return {
|
return {
|
||||||
type: MaybeApplyPatchVerified.CorrectnessError,
|
type: MaybeApplyPatchVerified.CorrectnessError,
|
||||||
|
|||||||
@@ -119,7 +119,11 @@ export const ApplyPatchTool = Tool.define(
|
|||||||
|
|
||||||
// Apply the update chunks to get new content
|
// Apply the update chunks to get new content
|
||||||
try {
|
try {
|
||||||
const fileUpdate = Patch.deriveNewContentsFromChunks(filePath, hunk.chunks, Bom.join(source.text, source.bom))
|
const fileUpdate = Patch.deriveNewContentsFromChunks(
|
||||||
|
filePath,
|
||||||
|
hunk.chunks,
|
||||||
|
Bom.join(source.text, source.bom),
|
||||||
|
)
|
||||||
newContent = fileUpdate.content
|
newContent = fileUpdate.content
|
||||||
bom = fileUpdate.bom
|
bom = fileUpdate.bom
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user