feat: add file edit diff progress view

Capture file edit snapshots through runner tool lifecycle hooks and render unified diffs in the WebUI with folding and truncation controls.
This commit is contained in:
chengyongru
2026-07-09 10:42:43 +08:00
committed by Xubin Ren
parent 207813d3b5
commit 7768672c5b
40 changed files with 2224 additions and 1753 deletions
+8
View File
@@ -47,6 +47,12 @@ async def test_runner_calls_hooks_in_order():
[tc.name for tc in context.tool_calls],
))
async def before_execute_tool(self, context, tool_call, tool, params) -> None:
events.append(("before_execute_tool", context.iteration, tool_call.name, params))
async def after_execute_tool(self, context, tool_call, tool, params, result) -> None:
events.append(("after_execute_tool", context.iteration, tool_call.name, result))
async def after_iteration(self, context: AgentHookContext) -> None:
events.append((
"after_iteration",
@@ -75,6 +81,8 @@ async def test_runner_calls_hooks_in_order():
assert events == [
("before_iteration", 0),
("before_execute_tools", 0, ["list_dir"]),
("before_execute_tool", 0, "list_dir", {"path": "."}),
("after_execute_tool", 0, "list_dir", "tool result"),
(
"after_iteration",
0,