Files
cindy/scripts
Dash 2cdab9a41d fix: measure live tok/s from each request's first byte, corrected by real usage
The speed panel counted streamed text with a word estimate that was only
replaced by real usage when a Claude Code turn ended, so a running turn showed
20-50% of its real output and average, and the curve dropped to zero after
every stretch of thinking. Codex divided each response by its model time
including the wait for the first byte and produced one reading per response;
Pi started its clock when the request was sent and showed a reply in flight at
about 45% of its output.

All three now share one meter:
- the clock runs from a request's first byte; waits, tools and approvals are
  not generation time
- each request's reported usage (with its thinking/reasoning count) replaces
  the stream estimate and calibrates the next one
- thinking is counted from its summary, from provider token estimates, or by
  its learned pace when it streams nothing
- output generated before the first byte is credited time at the measured
  speed instead of inflating it

Recorded Claude Code and Codex turns, reduced to timing and sizes, are kept as
fixtures; scripts/token-speed-capture.ts records new ones and
scripts/token-speed-replay.ts compares what the panel shows with real usage.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 13:16:30 +13:00
..
…