Improve edit tool diff display with context-aware rendering

- Add generateDiffString() function in edit tool to create unified diffs with line numbers and 4 lines of context
- Store only the formatted diff string in tool result details instead of full file contents
- Update tool-execution renderer to parse and colorize the diff string
- Filter out message_update events from session saving to prevent verbose session files
- Add markdown nested list and table rendering tests
This commit is contained in:
Mario Zechner 2025-11-12 20:09:11 +01:00
parent 2f0f0a913e
commit c75f53f6f2
7 changed files with 584 additions and 64 deletions

View file

@ -192,7 +192,10 @@ describe("Coding Agent Tools", () => {
});
expect(getTextOutput(result)).toContain("Successfully replaced");
expect(result.details).toBeUndefined();
expect(result.details).toBeDefined();
expect(result.details.diff).toBeDefined();
expect(typeof result.details.diff).toBe("string");
expect(result.details.diff).toContain("testing");
});
it("should fail if text not found", async () => {