fix(webui): keep multi-file apply_patch edits

This commit is contained in:
chengyongru
2026-06-24 20:04:39 +08:00
committed by Xubin Ren
parent c915e98c15
commit 943191f0c0
6 changed files with 227 additions and 12 deletions
@@ -513,6 +513,50 @@ describe("AgentActivityCluster", () => {
expect(screen.getByText("-3")).toBeInTheDocument();
});
it("renders every file from one apply_patch call", () => {
render(
<AgentActivityCluster
messages={[{
id: "t-file-many",
role: "tool",
kind: "trace",
content: "apply_patch()",
traces: ["apply_patch()"],
fileEdits: [
{
call_id: "call-patch",
tool: "apply_patch",
path: "USER.md",
phase: "end",
added: 0,
deleted: 3,
approximate: false,
status: "done",
},
{
call_id: "call-patch",
tool: "apply_patch",
path: "MEMORY.md",
phase: "end",
added: 0,
deleted: 4,
approximate: false,
status: "done",
},
],
createdAt: 3,
}]}
isTurnStreaming={false}
hasBodyBelow={false}
/>,
);
const fileRefs = screen.getAllByTestId("activity-file-reference");
expect(fileRefs).toHaveLength(2);
expect(fileRefs[0]).toHaveTextContent("USER.md");
expect(fileRefs[1]).toHaveTextContent("MEMORY.md");
});
it("renders CLI app runs as dedicated activity rows", () => {
const line = 'run_cli_app({"name":"blender","args":["--background","scene.blend"],"json":true})';
render(