Files
magpie/internal/gui
yetone a71aa25d22 routing: a session's Avg. speed says the wait for the first token is left out, and gives the speed with it counted
@verymoes on X (tweet 2121533934332985393): an opencode session over
the Command Code plugin read "平均速率 142 token/秒" on Routing's
By session row, while CC Switch read ≈77 tok/s for the same 26-27
requests and opencode's footer 76.7 tok/s, and asked whether magpie
counts wrong.

It doesn't; the three divide by different times. magpie's average is
Σ answer tokens over Σ (end − first token) of the timed replies
(decodeOf; for a reply that reasoned, its answer from its first text),
so the wait for the first token is left out. CC Switch's "≈" is its
estimate from the session log's timestamps, which it documents as
counting the wait for the first token (src/components/usage/format.ts,
docs/user-manual 4.4). opencode's footer is one turn, not the session,
and counted from the request until #63321 (11-11) moved it to the first
streamed token, with reasoning tokens added in. With a ~28K-token
prompt each and short agent replies, the wait is about half of a
request's time, which is the gap. Nothing in the measurement is wrong,
so it isn't changed; the tooltip now says what it measures:

- "the time from each reply's first token to its end; the wait for the
  first token, and replies without usable timing, are left out" in
  place of "total decode time; excludes waiting";
- a line with the same timed replies over their whole time, the wait
  and the reasoning counted ("Over each request's whole time ...:
  N tok/s"), the number a tool that times the whole request reads.
In zh, zh-TW, ja and de. The Usage page's speeds and a row's own speed
already say "from its first token to its end".

routing-request-metrics checks the tooltip's wording and its whole-time
number (4,000 tokens over 82 s, 49 tok/s, beside the 133 average) in
en and zh, both engines.

Run on mica at this tree (mote was over its 18 cores):
- node --test, Chromium then WebKit: routing-request-metrics,
  reasoning-speed, routing-burst-speed, routing-speed-first,
  routing-row-floor-speed, routing-sessions, routing-by-key,
  routing-session-title, i18n-keys, gui-ja, gui-de, gui-zh-tw.
  Chromium 191/191; WebKit 101/102, the one red reasoning-speed's
  cut-off fetch (#1350), fixed in the commit before this.
- Broken by hand: the test against the old client.js and i18n.js is red
  in all four (chromium/webkit × en/zh) at "the tooltip says the wait
  for the first token is left out".
No Go code changed. Not tried with the reporter's data: their session
isn't on this machine, and the owner's Command Code account answers
401.
2026-11-14 18:01:16 +08:00
..
…
…