diff --git a/src/agents/pi-tools.host-edit.ts b/src/agents/pi-tools.host-edit.ts index f58d391de76..0a17ff8a110 100644 --- a/src/agents/pi-tools.host-edit.ts +++ b/src/agents/pi-tools.host-edit.ts @@ -63,6 +63,7 @@ export function wrapHostEditToolWithPostWriteRecovery( oldText !== undefined && oldText.length > 0 && content.includes(oldText); if (hasNew && !stillHasOld) { return { + isError: false, content: [ { type: "text", diff --git a/src/agents/pi-tools.read.host-edit-recovery.test.ts b/src/agents/pi-tools.read.host-edit-recovery.test.ts index 225aea1a7d0..7faf2a5c912 100644 --- a/src/agents/pi-tools.read.host-edit-recovery.test.ts +++ b/src/agents/pi-tools.read.host-edit-recovery.test.ts @@ -61,6 +61,8 @@ describe("createHostWorkspaceEditTool post-write recovery", () => { : []; const textBlock = content.find((b) => b?.type === "text" && typeof b.text === "string"); expect(textBlock?.text).toContain("Successfully replaced text"); + // isError must be explicitly false so the framework does not surface a false failure notification + expect((result as { isError?: unknown }).isError).toBe(false); }); it("rethrows when file on disk does not contain newText", async () => {