diff options
| author | Adam Malczewski <[email protected]> | 2026-06-22 11:37:37 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-22 11:37:37 +0900 |
| commit | 896b0faff1bfca90557ca5067ca160b3d41498f7 (patch) | |
| tree | 0900b2813217522ee039b2325d3a4f260daf6283 /src/features/chat | |
| parent | 54fc4f301cffa538ad30c8c157c73924a2b3955e (diff) | |
| download | dispatch-web-896b0faff1bfca90557ca5067ca160b3d41498f7.tar.gz dispatch-web-896b0faff1bfca90557ca5067ca160b3d41498f7.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.ts | 36 |
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[] = [ |
