fix(webui): show generic tool arguments in activity

This commit is contained in:
chengyongru
2026-07-07 15:41:45 +08:00
committed by Xubin Ren
parent 3f33ff3143
commit 0f88927364
2 changed files with 55 additions and 1 deletions
@@ -767,6 +767,31 @@ describe("AgentActivityCluster", () => {
expect(screen.getByText("url: http://localhost:3000/dashboard")).toBeInTheDocument();
});
it("shows readable argument previews for generic tool traces", () => {
render(
<AgentActivityCluster
messages={[{
id: "t-generic-tools",
role: "tool",
kind: "trace",
content: 'grep({"pattern":"dream_cursor"})',
traces: [
'find_files({"query":"thread","glob":"*.tsx"})',
'list_dir({"path":"memory"})',
'grep({"pattern":"dream_cursor"})',
],
createdAt: 1,
}]}
isTurnStreaming
hasBodyBelow={false}
/>,
);
expect(screen.getByText("find_files query: thread · glob: *.tsx")).toBeInTheDocument();
expect(screen.getByText("list_dir path: memory")).toBeInTheDocument();
expect(screen.getByText("grep pattern: dream_cursor")).toBeInTheDocument();
});
it("summarizes long shell traces instead of dumping scripts", () => {
const command = [
"cat << 'EOF' | bash",