yetone
4d79bebfa7
usage: speed counts all output, reasoning and tool calls too, from the first output (Archivemylife on X)
...
Archivemylife on X: speed should be the upstream's usage over the local
time, with no split into reasoning, tools and answer, since reasoning and
tool calls are tokens too.
Speed is now every output token the vendor's usage counts (reasoning and
tool-call arguments included) over the time from the first output of any
kind to the end of the reply. The first output is the earlier of the first
content (TTFT) and the first sign of reasoning, firstToken.reasoningMs in
ttft.go, which works the same in every protocol:
- a Responses reasoning item's start;
- an Anthropic thinking or redacted_thinking block's start;
- sealed (hidden) thinking;
- reasoning deltas spread over 100 ms or more. Deltas that came at once
are a buffered burst and tell none.
A summary is no sign (summaryPart: a Responses reasoning summary, a Gemini
thought, or a summary translated from another protocol via
firstToken.summarized), because it is written after some of the reasoning
it sums up (#1463 ). A reply that reasoned with no sign of when it began
counts only its answer, its output less the reasoning, from its first text,
and none with no text. Before this, a reply that reasoned always counted
only its answer, and a reply that wrote tool calls after reasoning told no
speed. Burst and held-content checks judge the answer's part.
The same definition holds everywhere:
- gateway: speed.go, trace.go, codex_backend.go;
- usage.DecodeOf, for the Usage cards, rows and `magpie usage`;
- the Usage page's ledDecode;
- the Routing page's decodeOf and its ranking (fast routing reads
noteTrySpeed, which uses DecodeOf).
settledCountVersion goes to 8, so settled heat totals are counted again.
The rule text is in en, zh, zh-TW, ja and de. Docs: reference.md, and
gui-shell.md under "Streamed output speed".
Red on the old code (scratch worktree at 589e4ba6d ):
- TestCodexPreambleThenReasoningTellsSpeed: "reasoning seen from 0 ms;
want 3166".
- TestVisibleReasoningSpeed: 100/1000 and 0/0 where 1500/14000 was
wanted.
Run at this head (rebased on dc507aefd ), on mote:
- go test -tags nogui -count=1 -timeout 45m ./...
- gateway ok (1132s), usage ok, routes ok.
- Red, filed, and caused by mote's own gateway on 127.0.0.1:3425:
internal/cli TestHealthcheckFindsTheRunningGatewayWithoutMagpieAddr,
TestUpdateRestartsTheGatewayItFindsWithoutMagpieAddr and
TestUpdateFindsAMagpieThatWroteNoRecord (#6223 , #6471 ); internal/gui
TestLaneLimitRoutes (#5150 ).
- go vet for gateway and usage on darwin, GOOS=linux -tags nogui and
GOOS=windows: ok. gofmt -l: clean.
- GUI, 18 files in Chromium and WebKit (reasoning-speed, usage-speed-*,
usage-ledger, routing and the i18n files): 242 of 270 pass. The rest are
usage-ledger "newest live route needs no return-to-live button" (#6003 )
and usage-speed-all-models "asked for 7d" (#5834 ). Both are red the same
way on origin/main dc507aefd , in a run of its own.
Rebased again on 70ad7cf30 , which touches gateway.go and usage/page.js.
At that head, on mote: go vet for gateway and usage; go test -run
"Reasoning|Speed|Decode|Ultra|Uncounted" for gateway and usage, ok;
reasoning-speed, usage-reads-note, usage-speed-every-row and i18n-keys in
both engines, 66 of 66.
Not tried: a real account per vendor. The timing is taken from recorded
stream shapes in the tests: Responses, Anthropic, Chat and Gemini, native
and translated.
2026-11-18 21:30:25 +08:00
..
2026-10-28 03:17:14 +08:00
usage: each subscription account's tokens and cost, by the account that answered ( #557 : 希望用量账本能按订阅账号统计,每个 Codex / Claude 账号各用了多少 token、多少钱) — a call's record named the upstream key it went out on (ProviderKeyID/Name, #500 ) but never the subscription account, so with two Codex accounts signed in, or a Claude account that took over after a failover, the ledger could say what Codex cost and not what each account did. A record now carries providerAccount, the account that answered as the Routing trace names it (Account.User: its email or login, never a token), set by the gateway at the try that went out (the candidate loop's last try, so a failover's answer is the account that took over and the refused try stays the first account's; an X-Magpie-Account pin is the pinned one), and on the decide, draw and video paths too. Record.Account() gives it, or for a record written before the field the account its host named (Where() has long written "chatgpt.com as dee@example.com" for an account), and otherwise "" — shown as "account not recorded", never inferred from today's sign-in. The summary groups calls by provider and account (Summary.Accounts, the same email on Codex and on Claude being two accounts), priced as every other group; the ledger's Filter has Account, the search finds a call by its account, the CSV has a provider_account column beside provider_key_name (the provider's identity columns together, the caller's still last), and the Requests page's packed rows keep it and offer the period's accounts. magpie usage prints an accounts table after the provider keys, and magpie usage --csv --account <name> keeps one account's calls. The app's Usage page lists Accounts on the Overview (tokens and cost per account, the provider under its name, an unrecorded one in the faint colour, no stripe down a row's side) and has an Account filter on Requests, each account noting the providers it answered for, which asks for and exports that account's calls without moving the page. OTLP export is an allowlist and does not carry the account. TestUsageNamesPinnedAccount (both pinned accounts on magpie's endpoint and on Codex's own, the trace's Who and the record agreeing, no token in usage.jsonl) and TestUsageNamesAccountThatTookOver (Ordered routing, the first account refusing: the answer recorded as the spare, the refusal as the first) fail without the gateway change; TestSummaryByAccount, TestLedgerByAccount and TestRequestPageByAccount cover the grouping, the host fallback, "not recorded", keyed providers kept out, the filter, the search, the CSV column and the packed rows; TestLedger and TestLedgerWithSessionLogCalls take the new column. usage-accounts.test.cjs (WebKit and Chromium, en and zh: the Overview's accounts and costs, the Account picker's notes, its request and export, All accounts clearing it, scrollTop unchanged) fails without the asset change; api-key-usage, click-scroll, panel-usage, request-archive-usage, tray-usages, claude-usage-asked and every usage-* test pass in WebKit. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed once on its TempDir cleanup, passes alone).
2026-10-02 20:15:33 +08:00
2026-11-15 02:50:48 +08:00
2026-11-06 10:07:06 +08:00
2026-11-17 18:59:48 +08:00
2026-10-21 23:21:41 +08:00
2026-11-17 22:41:26 +08:00
2026-11-12 02:01:31 +08:00
2026-11-12 02:01:31 +08:00
2026-10-31 08:31:15 +08:00
2026-11-01 07:06:19 +08:00
2026-11-14 17:00:00 +08:00
2026-10-14 05:43:47 +08:00
2026-10-25 10:53:45 +08:00
2026-10-16 21:59:33 +08:00
2026-11-07 04:03:01 +08:00
2026-11-13 19:42:11 +08:00
2026-11-13 19:42:11 +08:00
2026-11-01 18:19:53 +08:00
2026-10-29 04:44:43 +08:00
2026-11-10 18:01:13 +08:00
2026-10-19 14:34:18 +08:00
2026-10-13 18:17:47 +08:00
2026-11-10 04:44:07 +08:00
2026-10-07 02:14:29 +08:00
2026-10-28 20:43:10 +08:00
2026-10-28 20:43:10 +08:00
2026-10-07 02:14:29 +08:00
2026-10-15 04:21:31 +08:00
2026-10-29 00:14:17 +08:00
2026-10-29 06:30:58 +08:00
2026-10-30 13:42:11 +08:00
2026-10-27 08:04:30 +08:00
2026-10-29 06:30:58 +08:00
2026-11-12 18:31:50 +08:00
2026-10-29 00:57:04 +08:00
2026-10-29 16:11:26 +08:00
2026-10-27 18:37:16 +08:00
2026-10-27 18:37:16 +08:00
2026-10-31 18:57:39 +08:00
2026-11-10 16:45:02 +08:00
2026-10-15 09:36:26 +08:00
2026-11-04 22:45:40 +08:00
2026-10-31 03:13:28 +08:00
2026-11-12 18:31:50 +08:00
2026-11-11 06:56:39 +08:00
2026-11-14 17:00:00 +08:00
2026-11-16 18:56:32 +08:00
2026-11-15 02:50:48 +08:00
2026-11-13 13:12:12 +08:00
2026-11-13 19:42:11 +08:00
2026-10-02 19:15:56 +08:00
2026-11-13 14:17:49 +08:00
2026-11-12 22:40:15 +08:00
2026-11-15 21:58:28 +08:00
2026-11-14 08:31:52 +08:00
2026-11-12 13:14:43 +08:00
2026-10-29 06:21:46 +08:00
2026-11-11 08:51:15 +08:00
2026-10-19 14:34:18 +08:00
2026-10-19 14:34:18 +08:00
2026-10-24 02:48:50 +08:00
2026-11-11 15:09:32 +08:00
2026-10-19 14:34:18 +08:00
2026-11-09 23:56:13 +08:00
2026-10-31 10:24:23 +08:00
2026-11-14 04:02:26 +08:00
2026-11-14 00:40:00 +08:00
2026-11-18 21:30:25 +08:00
2026-10-31 03:13:28 +08:00
2026-11-08 00:12:29 +08:00
2026-11-10 16:45:02 +08:00
2026-10-27 02:25:45 +08:00
2026-11-10 16:28:04 +08:00
2026-10-19 14:34:18 +08:00
2026-10-19 14:34:19 +08:00
2026-11-13 16:31:24 +08:00
2026-10-01 16:18:02 +08:00
2026-11-01 11:19:26 +08:00
2026-11-06 09:57:18 +08:00
2026-11-17 20:18:02 +08:00
2026-10-31 20:48:05 +08:00
2026-11-10 00:36:16 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 07:20:48 +08:00
2026-10-09 02:48:29 +08:00
2026-11-13 08:51:24 +08:00
2026-11-13 10:09:27 +08:00
2026-10-03 01:15:29 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 02:48:29 +08:00
2026-11-01 17:57:15 +08:00
2026-11-13 08:51:24 +08:00
2026-11-11 09:32:03 +08:00
2026-10-29 00:09:24 +08:00
2026-11-14 08:31:52 +08:00
2026-10-27 11:24:15 +08:00
2026-11-02 19:08:59 +08:00
2026-11-10 16:45:02 +08:00
2026-10-30 15:00:16 +08:00
2026-11-09 19:58:17 +08:00
2026-10-15 05:39:01 +08:00
2026-10-15 05:39:01 +08:00
2026-10-13 01:41:50 +08:00
2026-10-25 15:10:47 +08:00
2026-10-31 03:13:28 +08:00
2026-11-17 23:13:03 +08:00
2026-10-30 20:21:52 +08:00
2026-10-30 23:20:35 +08:00
2026-10-30 15:22:55 +08:00
2026-10-14 15:26:28 +08:00
2026-11-10 02:01:37 +08:00
2026-11-10 02:01:37 +08:00
2026-11-03 05:16:57 +08:00
2026-11-01 22:14:19 +08:00
2026-11-01 22:14:19 +08:00
2026-11-10 12:22:53 +08:00
2026-11-10 12:22:53 +08:00
2026-11-11 16:12:43 +08:00
2026-10-11 04:44:13 +08:00
2026-11-14 01:06:11 +08:00
2026-11-14 01:06:11 +08:00
2026-10-13 10:13:15 +08:00
2026-11-18 00:38:36 +08:00
2026-10-24 23:49:08 +08:00
2026-11-18 21:30:25 +08:00
2026-10-30 13:42:11 +08:00
2026-10-30 13:42:11 +08:00
2026-10-28 11:15:57 +08:00
2026-10-19 14:34:18 +08:00
2026-10-31 13:44:29 +08:00
2026-10-30 06:48:56 +08:00
2026-10-28 21:40:12 +08:00
2026-10-28 21:40:12 +08:00
2026-10-25 05:02:18 +08:00
2026-11-12 02:01:31 +08:00
2026-10-07 06:17:56 +08:00
2026-10-30 15:16:30 +08:00
2026-10-25 16:56:02 +08:00
2026-10-31 00:28:43 +08:00
2026-10-25 16:56:02 +08:00
2026-11-13 10:09:27 +08:00
2026-11-13 10:09:27 +08:00
2026-11-13 19:42:11 +08:00
2026-11-01 18:10:04 +08:00
2026-10-01 17:42:10 +08:00
2026-10-01 17:42:10 +08:00
2026-10-30 23:20:35 +08:00
2026-10-07 19:43:01 +08:00
2026-11-17 23:13:03 +08:00
2026-10-31 03:13:28 +08:00
2026-10-31 10:24:23 +08:00
2026-11-14 10:22:25 +08:00
2026-10-25 16:56:02 +08:00
2026-10-25 03:11:41 +08:00
2026-10-21 23:21:41 +08:00
2026-11-14 08:31:52 +08:00
2026-10-19 14:34:18 +08:00
2026-11-14 10:22:25 +08:00
2026-11-01 18:10:04 +08:00
2026-11-05 23:57:33 +08:00
2026-11-01 02:29:59 +08:00
2026-11-10 07:37:34 +08:00
2026-11-01 07:06:19 +08:00
2026-10-28 03:17:14 +08:00
2026-10-24 17:07:35 +08:00
2026-11-07 00:22:13 +08:00
2026-10-12 00:44:47 +08:00
2026-10-27 18:54:31 +08:00
2026-11-02 19:26:26 +08:00
2026-10-10 19:55:29 +08:00
usage, gateway: a model the vendor spells with other separators isn't marked as another one (vincentzhang on Discord: 这个说明有点奇怪。看不明白。) — Volcengine Ark answers deepseek-v4.1-flash as deepseek-v4-1-flash, the dots written as hyphens, and the Usage page's Requests and the Routing page marked every such row amber 「实际 deepseek-v4-1-flash」, saying another model had answered, not the one asked for under a dated name. Swapped now compares the bare names without their separators (. - _ and spaces) and case, so deepseek-v4-1-flash, deepseek_v4_1_flash, GLM-4-6 for glm-4.6 and gpt-4-1-2025-04-14 for gpt-4.1 are the model asked for, while deepseek-v4-flash or deepseek-v4.1-pro for deepseek-v4.1-flash still are another. Rows and routes kept marked swapped before are read back as not swapped when the names differ only so (usage.SameSpelled, in rowChunk.row and Route.routedAgain). The tag's explanation says it in plainer words: asked for {sent}, the reply says {served} answered, likely another model; the same model under a dated name or spelled otherwise isn't marked (zh, ja, de). TestSwappedIgnoresSeparators fails on the old code; TestKeptRowSameSpelledNotSwapped, TestRouteKeptSpelledOtherwiseNotSwapped. usage-ledger (its expected title updated), remote-group-served, panel-routing, gui-ja and gui-de pass on WebKit. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (TestCodexVersion timed out once under load and passes alone).
2026-10-05 12:49:59 +08:00
2026-11-13 19:42:11 +08:00
2026-10-01 17:42:10 +08:00
2026-10-01 17:42:10 +08:00
2026-10-31 23:35:27 +08:00
2026-10-21 09:41:29 +08:00
2026-10-21 09:41:29 +08:00
2026-11-07 21:47:58 +08:00
2026-11-17 23:13:03 +08:00
2026-11-10 04:44:07 +08:00
2026-11-03 17:01:51 +08:00
2026-11-03 17:01:51 +08:00
2026-11-17 23:13:03 +08:00
2026-11-17 23:13:03 +08:00
2026-11-03 15:30:44 +08:00
2026-11-08 02:54:25 +08:00
2026-10-21 23:21:41 +08:00
2026-10-21 23:21:41 +08:00
2026-10-07 02:14:29 +08:00
2026-11-13 17:16:47 +08:00
2026-10-29 06:04:22 +08:00
2026-11-15 02:50:48 +08:00
2026-11-17 20:18:02 +08:00
2026-10-25 03:31:55 +08:00
2026-11-14 10:22:25 +08:00
2026-10-24 02:48:50 +08:00
2026-11-10 18:01:13 +08:00
2026-10-30 16:05:58 +08:00
2026-11-18 21:30:25 +08:00
2026-10-19 14:34:18 +08:00
2026-10-29 06:21:46 +08:00
2026-10-29 06:21:46 +08:00
2026-10-19 14:34:19 +08:00
2026-11-11 13:00:54 +08:00
2026-11-01 18:33:53 +08:00
2026-11-12 21:48:04 +08:00
2026-11-15 21:58:28 +08:00
2026-10-15 23:08:00 +08:00
2026-11-05 23:57:33 +08:00
2026-11-10 18:01:13 +08:00
2026-11-17 20:18:02 +08:00
2026-11-12 00:42:50 +08:00
2026-10-23 10:54:27 +08:00
2026-11-12 18:31:50 +08:00