Skip to content

Commit d086f87

Browse files
authored
🤖 fix: stabilize streaming barrier token count in stories (#744)
The interval callbacks that maintain streaming state were adding 1 token every 2 seconds, causing flaky token counts (72 vs 73) depending on test timing. Setting `tokens: 0` keeps streaming state active without affecting the displayed count. _Generated with `mux`_
1 parent e18a1dc commit d086f87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/browser/App.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,13 +996,14 @@ export const ActiveWorkspaceWithChat: Story = {
996996
}, 100);
997997

998998
// Keep sending reasoning deltas to maintain streaming state
999+
// tokens: 0 to avoid flaky token counts in visual tests
9991000
const intervalId = setInterval(() => {
10001001
callback({
10011002
type: "reasoning-delta",
10021003
workspaceId: workspaceId,
10031004
messageId: "msg-12",
10041005
delta: ".",
1005-
tokens: 1,
1006+
tokens: 0,
10061007
timestamp: NOW,
10071008
});
10081009
}, 2000);
@@ -1108,13 +1109,14 @@ export const ActiveWorkspaceWithChat: Story = {
11081109
}, 100);
11091110

11101111
// Keep sending deltas to maintain streaming state
1112+
// tokens: 0 to avoid flaky token counts in visual tests
11111113
const intervalId = setInterval(() => {
11121114
callback({
11131115
type: "stream-delta",
11141116
workspaceId: streamingWorkspaceId,
11151117
messageId: "stream-msg-2",
11161118
delta: ".",
1117-
tokens: 1,
1119+
tokens: 0,
11181120
timestamp: NOW,
11191121
});
11201122
}, 2000);

0 commit comments

Comments
 (0)