review: address ds-review-bot findings on session-stats

- stateVersion starts at 1: the package is new, no persisted rows predate it
- pendingCalls pairs by own key so a provider callId naming a prototype
  property cannot fold toolMs to NaN on an unmatched crash-recovery result
- StatsLine folds the window fallback only when no sessionStats value is
  served, and gates the token group on actual token activity instead of
  steps, so failed-only sessions drop the zero-token group
- correct the crash-step counting semantics in the README and Agent Note:
  recovery closes interrupted steps with a synthetic step/end on reload
- reword the window-scoped alternative as a plain rejected option and name
  isTokenDelta's home beside the StreamChunk type
This commit is contained in:
07akioni
2026-08-12 21:43:35 +08:00
parent ae3f89e772
commit 62a437c082
20 changed files with 68 additions and 29 deletions

View File

@@ -120,7 +120,7 @@ describe('web e2e: settled Markdown math rendering', () => {
await expect.poll(() => page.locator('.katex-display').count(), { timeout: 10_000 }).toBe(2)
expect(await page.locator('.katex-error').count()).toBe(0)
await expect.poll(
() => page.getByText('Input 0 tok · Output 0 tok', { exact: false }).count(),
() => page.getByText('1 turns · 1 steps', { exact: false }).count(),
{ timeout: 10_000 },
).toBe(1)

View File

@@ -31,4 +31,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps

View File

@@ -27,4 +27,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps

View File

@@ -53,4 +53,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps LLM {{duration}}

View File

@@ -32,4 +32,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps LLM {{duration}}

View File

@@ -44,4 +44,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps LLM {{duration}}

View File

@@ -48,4 +48,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps LLM {{duration}}

View File

@@ -50,4 +50,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 1 turns · 1 steps Input 0 tok · Output 0 tok
- text: 1 turns · 1 steps

View File

@@ -354,4 +354,4 @@
- text: DeepSeek-V4-Flash
- img
- button "Send message" [disabled]
- text: 28 turns · 28 steps LLM {{duration}} Input 0 tok · Output 0 tok
- text: 28 turns · 28 steps LLM {{duration}}