The test timed its replies over a wait shortened from John's (first
content at 1.3 s, the end at 4 s). The held call is told held when its
flow (~245 ms for the 236 ms burst) is under a quarter of its window
from its first text (usage.HeldShare); a 2.5 s window put that bound at
~620 ms, so a single pause of ~400 ms that split the burst crossed it.
macOS CI under -race read flow 856 ms, ms 4517 (517 ms late) and
176 tok/s: one ~520 ms pause mid-burst.
Reproduced by injecting the pause (not rerunning): a 520 ms sleep in
the fake before the 25th write of the chat held call read 182 tok/s,
flow 773, ms 4405, as CI did. The classifier is right about such a
stream; the fixture sat too near its threshold. The wait is now first
content at 0.5 s and the end at 7 s: a 6.3 s window bounds flow at
~1.6 s, and the steady 50 tok/s reply stays within its 20% with a pause
as long.
Run:
- injected 1 s pause in the chat held call, held answer, steady, and
in all nine replies: ok each; a 2 s pause still fails the held call
(flow 2621), so the bound is where the comment says.
- break by hand: HeldShare check off -> the three held calls read
84 tok/s, red; ThinkPace check off -> the three held answers read
~2,237 tok/s, red.
- go test -race -count=10 -run '^TestKimiHeldBurst' ./internal/gateway/ ok.
- gofmt -l clean; go vet darwin/linux/windows ./internal/gateway/ ok.
John's Kimi Code rows after v0.1.1119 (OpenCode, group/k3-glm, api.kimi.ai,
Chat, k3-256k): 550 tokens, 22 of them reasoning, in 16 s with the first
content at 5.2 s read 2,237 tok/s, and 395 tokens in 19 s 2,012. 528 answer
tokens at 2,237 tok/s is 236 ms: the burst the vendor let go at the end.
de5455b8 measured how long the content took to come (flow) and took the
window as no longer than it, so a burst sent in one write (flow ~1 ms) fell
under the 100 ms floor and told none, but a burst let go over 236 ms of
many events read its tokens over those 236 ms, under the 10,000 tok/s
ceiling. The time a burst takes to come is not the time it took to write.
usage.DecodeOf now tells no speed for a reply held back and let go at its
end, both ways the burst can show:
- its content came in under a quarter of its window (flow*4 < window):
the text came early, the tool call it wrote over the rest of the time
came at the end (window 10.6 s, flow 236 ms);
- it reasoned, and its answer came over 20 times faster than its
reasoning came between its first content and its first text: the text
came with the burst, so the window from it is the burst itself (22
reasoning tokens over 10.5 s, then 528 in 236 ms). Hidden reasoning
(OpenAI's, Claude's omitted) comes before the first content and leaves
that time short; streamed reasoning comes at its answer's pace.
Between the two the window is the whole window again, not the flow.
routing.js's decodeOf and app.js's ledDecode do the same; docs/reference.md
says it.
Tests: TestKimiHeldBurstTellsNoSpeed, a fake Kimi Code (Chat: four
reasoning_content deltas, then text and a tool call whose arguments come
as 40 writes 6 ms apart over the last 236 ms; usage 538/550/22), through
the real gateway for a Chat, a Responses and an Anthropic agent, with the
wait shortened (first content 1.3 s, end 4 s): the held call and the held
answer tell none (before: 2,112 to 2,237 tok/s on all three), a steady
50 tok/s answer after the same reasoning keeps ~50. TestKimiHeldBurstAtJohnsTimes
feeds firstToken the same streams at John's times (5.2 s, 16 s): before,
2,138 and 2,237 tok/s. TestJohnsRowsTellNoSpeed: his rows as records
(before: 2,237, 2,237, 2,015). routing-burst-speed and usage-speed gain
his rows and a steady 50 tok/s one; they fail on the old routing.js and
app.js ("2237 tok/s", "2,237 tok/s") and pass now in Chromium and WebKit,
en and zh, with reasoning-speed, routing-request-metrics,
usage-ledger-detail, click-scroll, gui-ja, gui-de and i18n-keys.
Run: go test -tags nogui ./internal/... (golang:1.26.8 in Docker, as a
non-root user: as root, internal/agent's TestAside* write-refusal tests
fail because root ignores the file modes they rely on, unrelated to this);
-race -count=5 of the new and the burst tests; go vet (linux, windows,
nogui) on internal/gateway and internal/usage. Not tried against the real
Kimi Code API: the owner's Kimi Code key answers 403 (subscription has no
access), so how Kimi Code lets the reply go is inferred from John's
numbers; which of the two shapes his rows were is not known, and both are
covered.