summaryrefslogtreecommitdiffhomepage
path: root/src/features/chat
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-22 11:37:37 +0900
committerAdam Malczewski <[email protected]>2026-06-22 11:37:37 +0900
commit82802a14bc5921c6b62756c3a1a8953c087b5b0d (patch)
tree413824bc99b95243d911db95feeb24ae4173f79b /src/features/chat
parentd6f60f4a81d9714176ef3d8cc60938c01c55b7d6 (diff)
downloaddispatch-web-82802a14bc5921c6b62756c3a1a8953c087b5b0d.tar.gz
dispatch-web-82802a14bc5921c6b62756c3a1a8953c087b5b0d.zip
fix(metrics): skip unanchored step-metrics — no more empty bubbles at tail
Step-metrics are only shown when anchored to their tool content (inline after the tool-call/result group). Steps whose chunks were trimmed (or text-only steps with no tool chunks) are now SKIPPED instead of piling up at the segment tail as empty 'step N · X tok' bubbles. The turn-total metrics row still shows the aggregate (tokens, duration, cache rate), so the conversation-level summary is preserved. Updated place.test.ts + ui.test.ts to anchor steps with tool-call groups where step-metrics are expected.
Diffstat (limited to 'src/features/chat')
-rw-r--r--src/features/chat/ui.test.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/features/chat/ui.test.ts b/src/features/chat/ui.test.ts
index e541015..94db0ae 100644
--- a/src/features/chat/ui.test.ts
+++ b/src/features/chat/ui.test.ts
@@ -329,6 +329,18 @@ describe("ChatView", () => {
chunk: { type: "text", text: "Hello!" },
provisional: false,
},
+ {
+ seq: 3,
+ role: "assistant",
+ chunk: {
+ type: "tool-call",
+ toolCallId: "tc1",
+ toolName: "test",
+ input: {},
+ stepId: "t1#0" as StepId,
+ },
+ provisional: false,
+ },
];
const turnMetrics: TurnMetricsEntry[] = [
@@ -502,6 +514,18 @@ describe("ChatView", () => {
chunk: { type: "text", text: "Response" },
provisional: false,
},
+ {
+ seq: 3,
+ role: "assistant",
+ chunk: {
+ type: "tool-call",
+ toolCallId: "tc1",
+ toolName: "test",
+ input: {},
+ stepId: "t1#0" as StepId,
+ },
+ provisional: false,
+ },
];
const turnMetrics: TurnMetricsEntry[] = [
@@ -547,6 +571,18 @@ describe("ChatView", () => {
chunk: { type: "text", text: "Hello!" },
provisional: false,
},
+ {
+ seq: 3,
+ role: "assistant",
+ chunk: {
+ type: "tool-call",
+ toolCallId: "tc1",
+ toolName: "test",
+ input: {},
+ stepId: "t1#0" as StepId,
+ },
+ provisional: false,
+ },
];
const turnMetrics: TurnMetricsEntry[] = [