Fallmonkey's repro: a Codex turn whose first token came at 6.8 s (the
model working) and the rest 0.2 s later in one network push read as
thousands of tok/s from its session file. The promised rule, now in:
- A Codex turn of one call read from its session file (source "log",
turn TTFT known) tells a measured speed only when the window after its
first token is 1 s or more and its body 100 tokens or more
(usage.CodexWindowMs, CodexBodyTokens; Row.Decode, app.js ledDecode).
- The floor from e5b82cf38 for such a turn that reasoned (its answer over
the time after the first token, "②") is held to the same threshold:
827 ms after a 10.2 s first token no longer reads ≥329, as that window
can be one push too.
- A turn that tells neither tells its output over the whole turn
(Row.Floor, ledFloor_ "turn"), the wait in it, of any size: everything
it wrote was written in that time, so it is a true floor. 380 tokens in
6.8 + 0.2 s read ≥54 tok/s. Its tooltip says the whole turn was used and
why, with the time after the first token (new string in en, zh, zh-TW,
ja, de).
Gateway rows and other agents' rows keep DecodeOf as before; Codex calls
in turns of several keep the 1,000-token rule. The ledger's period sum
now adds each row after it is built (Totals.addFrom) so it uses
Row.Decode too. docs/reference.md says the rule.
Tests: TestCodexTurnMeasuredOnlyOverASecondAndAHundredTokens (new: 380
over 0.2 s after 6.8 s, 60 over 2 s, the 1 s/100 edges, gateway and
Claude rows unchanged, group, ledgerWith sum, Part) and
TestCodexRowsTellAFloor (updated cases) fail on the old ledger.go and
usage.go; the sum check fails with only the ledger closure reverted.
usage-speed-count.test.cjs: the 496/224 row now ≥45 with the whole-turn
tooltip, a 1,000-token answer over 10 s ≥100, Fallmonkey's row ≥54;
fails on the old app.js.
Ran: go test -tags nogui ./internal/usage ./internal/gui ./internal/cli;
gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/usage and internal/gui; 50 GUI suites (usage-*, ledger-*,
reasoning-speed, routing-burst-speed, routing-request-metrics,
panel-usage, gui-de/ja/zh-tw, i18n-keys) in Chromium and WebKit: 506/507,
the one red usage-sum-whole chromium ja at 780px under load, reproduced
on origin/main 5c82e6880 and filed as #1864. On copies of the owner's
recent Codex rollouts (955 calls), 2 were turns of one call; one, 13
tokens 315 ms after a 4.3 s first token, moves from 41 tok/s to a floor.
Not tried with Fallmonkey's own sessions.