Commit Graph
10 Commits
Author SHA1 Message Date
yetone 087985c778 usage, gui: a Codex turn of one call too short to time tells its whole-turn floor only at 1,000 tokens or more, as Claude Code's does (Fallmonkey on Discord)
Fallmonkey's report: an 11-token gpt-6-astra answer in 2.75 s, too short
after its first token to be measured, showed "≥4 tok/s" from the
whole-turn fallback (def3a41e3), while an 815-token Claude Code reply,
told by the same formula (all output over the whole time, the wait for the
first token in it), showed nothing, because that floor needs 1,000 tokens.
The gate now follows the formula: a Codex turn of one call that is neither
measured nor tells its answer's floor (the answer over the time after the
first token, still held to 1 s and 100 tokens) tells its output over the
whole turn only when that is 1,000 tokens or more over a second or more,
the rule every other whole-time floor has (Row.Floor; app.js ledFloor_).
Under that, the wait is too much of the time to tell anything.

Changed: internal/usage/ledger.go (Row.Floor drops the Codex-only
any-size fallback and falls through to the shared 1,000-token rule),
internal/gui/assets/app.js (ledFloor_ the same), docs/reference.md.

Tests:
- TestCodexWholeTurnFloorNeedsAThousandTokens (new): Fallmonkey's 11
  tokens in 2.75 s tell no floor, as Claude Code's 815 in 18 s; 1,000 in
  12 s tell one for both. TestCodexRowsTellAFloor and
  TestCodexTurnMeasuredOnlyOverASecondAndAHundredTokens updated (380 in
  7 s, 496/224 in 11 s, 60, 99, 400 tokens now tell none; 1,200 and 1,300
  token one-push turns and a 1,000-token one at 999 ms still do).
  With the old ledger.go: FAIL, "astra's 11 tokens over 2.75 s: floor
  11/2750 ms, want none", and 8 more cases in the two older tests.
- usage-speed-count.test.cjs: the 496-token and 380-token rows and
  Fallmonkey's 11-token astra row show "—", a 1,200-token one-push turn
  "≥120 tok/s" with the whole-turn tooltip; in en, zh, zh-TW, ja, de at
  five widths. With the old app.js: FAIL "496 tokens over the whole turn
  tell nothing".

Ran: go test -tags nogui ./internal/usage; gofmt -l; go vet (darwin,
GOOS=linux -tags nogui, GOOS=windows) on internal/usage; GUI suites
usage-speed-count, reasoning-speed, usage-ledger-detail, usage-ledger-fit,
usage-ledger, usage-session-speed, usage-speed, usage-sum-whole,
panel-usage, i18n-keys in Chromium and WebKit. No strings changed. Not
tried on Fallmonkey's own session files.
2026-10-13 12:08:10 +08:00
yetoneandMonkeyLeeT dfbe001ff9 usage, gui: re-land def3a41e3, a Codex one-call turn timed only over a second and 100 tokens after its first token
2c30e5cee held def3a41e3 back "until Fallmonkey says what context it
missed". Fallmonkey answered on Discord: no objection, ship it. This
reverts the revert. app.js conflicted with aabdd6126 (larger sample
first); the resolution keeps aabdd6126's first_text_ms > 0 guard on the
reasoning check and adds back the Codex window check below it.

Run: go test -tags nogui ./internal/usage; usage-speed-count (52),
usage-speed, usage-ttft-rounding, i18n-keys green in chromium and
webkit; gofmt -l clean; go vet darwin, linux nogui, windows.

Reported-by: Fallmonkey (Discord)
Co-authored-by: MonkeyLeeT <MonkeyLeeT@users.noreply.github.com>
2026-10-13 09:10:14 +08:00
yetoneandMonkeyLeeT aabdd6126a gui: a model's speed leads with the figure from more replies, counts written out, TTFT on its own line
Fallmonkey (Discord) read "75 tok/s (3) · ≥54 tok/s (289)" on the Output
speed card and the Usage ranking as the 3-reply figure being the model's
speed, with the 289-reply floor tucked behind it, and "(3)" not saying
what was counted.

Now, everywhere a group's speed shows (the Output speed card, the
overview lists and the Usage ranking by speed):
- the figure from more replies comes first and is the big one; a tie
  keeps the measured one first. The ranking orders and bars by it.
- counts are written out, without parentheses:
  "≥54 tok/s · 289 replies; 75 tok/s · 3 timed replies"
  zh "≥54 token/秒 · 289 次回复;75 token/秒 · 3 次计时",
  with zh-TW, ja and de strings of their own.
- on the card the second figure is its own line, and the average wait
  for the first token is a line of its own with its count
  ("first token in 1.2 s on average · 3 timed replies"), wrapping rather
  than cut off. In the big figure the count is a muted caption without
  the dot, so a wrapped count never starts a line with "·".
- the tooltips are unchanged; the threshold for the floor is unchanged.

What was run:
- usage-speed and usage-ttft-rounding now expect the TTFT line's
  count; green in both engines.
- usage-speed-count.test.cjs (rewritten for the new rule) in Chromium
  and WebKit, 5 languages x widths 1400/983/789/700/560: 26/26 each.
  On origin/main's assets it fails ("125 tok/s (1) · ≥50 tok/s (259)").
- 55 related suites (usage-*, ledger-*, reasoning-speed, routing-*-speed/
  metrics, panel-usage, gui-de/ja/zh-tw, i18n-keys, click-scroll,
  tray-usages) in both engines: all green.
- gofmt -l, go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
  internal/gui; go test -tags nogui ./internal/gui: ok.
- Screenshots of the card and ranking at 560 and 1400 in en, zh, de.

Reported-by: Fallmonkey (GitHub MonkeyLeeT)
Co-authored-by: MonkeyLeeT <MonkeyLeeT@users.noreply.github.com>
2026-10-13 08:19:28 +08:00
yetone 2c30e5cee7 usage, gui: revert def3a41e3 until Fallmonkey says what context it missed
Fallmonkey asked on Discord (#feedback, 10-12 19:55) to hold the
single-call Codex threshold: "先别做?感觉你漏掉context了". It is not in a
release yet, so take it off main until the rule is agreed, rather than
ship a speed rule its own requester has paused.

This reverts commit def3a41e36.

Run: gofmt -l, go vet, go test ./internal/usage.
2026-10-13 04:07:30 +08:00
yetone def3a41e36 usage, gui: a Codex turn of one call is measured only over a second and 100 tokens after its first token, else told as the least it wrote over the whole turn (Fallmonkey on Discord)
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.
2026-10-13 03:51:38 +08:00
yetone 18e82adc62 gui: the window's pages down a sidebar in groups, the open page's tabs under it, and a button to have the header's tabs instead
From 1024 points wide (SIDE_AT) the window lays its pages down the left
as a Mac app's sidebar: Work (Agents, Sessions, Library), Models
(Providers, Routing, Gateway), Insights (Usage), Extend (Plugins), with
Settings and the gateway's address at the foot. The open page's own tabs
(Usage, Library, Plugins, Settings) are listed under it, opening and
folding on an iOS-like spring, and the page's strip is hidden. The header
becomes a breadcrumb, and pages whose head held only tools have them in
the title bar. Graphite: the open page is in the text's ink, not purple.
A pressed row darkens and never shrinks. The selection under the tabs
sets off as the row is pressed, on a 0.3s curve (it felt behind the
finger), and is the list's only shape: a sub-row hovered or pressed has
no ground of its own, which showed a block under the finger before the
selection slid there. The page's tab is clicked at once, so what is
typed next goes to it.

The title bar's button (or ⌃⌘S, Ctrl+Shift+S), there at every width,
picks the sidebar or the header's tabs. The choice is kept in
localStorage magpie.navLayout (side or top) at every width, so it is laid
out from the first frame; picked in a narrow window the sidebar is 184
points under 860. The two trade places in
a view transition: the sidebar slides, each tab flies to its place, and
the page slides as one. Without view transitions or under reduced
motion, the change is at once.

With nothing picked, narrower than 1024 the page beside a sidebar would
be narrower than Usage's requests table needs, so the header's tabs come
back. A resize
drops what a click held (heldWidth). Usage's KPI strip goes two to a line
by the room the page gives it (a container query), and Japanese counts
wrap there. Tests whose window is 1024+ were updated for the sidebar,
and docs/subsystems/gui-shell.md says how it works.

Run: sidebar.test.cjs and side-toggle.test.cjs 16/16 in chromium and
webkit, in en, zh, zh-TW, ja and de. Each was broken by hand (press
shrink, address cut, press glide, sub-row ground, view transition, kept
choice) and went red. Every page at 560 points with the sidebar picked,
zh and de, both engines: nothing scrolls sideways. session-identity's
ledger row sits under the footer beside the sidebar; WebKit's click
doesn't scroll to it, so the test wheels it up first. Animation frames were checked from a recorded video. The 105
affected GUI files in both engines; their reds were rerun alone and fixed
(filter-ime: the sub-row's click now at once; session-identity, above) or
fail the same on main (tray-logos). The full GUI suite in chromium, on
the rebase onto d5cae267a, was cut short at 352 tests on the owner's
"ship": 6 reds (account-alias, account-models, codex-auto-review,
codex-credits, context-text) each pass alone, here and on main d5cae267a,
so they are timing under the full run's load and are to be filed. After
rebasing onto e4e22b23e: sidebar, side-toggle, session-identity,
filter-ime, library-instr-busy, usage-speed-count and view-scrollbar,
50/50 in chromium and webkit. go build ./... passes.
2026-10-12 00:41:34 +08:00
yetone 47ccb7165b gui: Usage's Output speed card keeps its number inside it, and a page's bar across its foot is as thin as at its side on mac (#1623, fanbuz)
At ~983px on Usage › Requests the Output speed figure with its reply
count ("48 token/秒(781 次)", since 3964ea65) ran past its card, as
.led-strip .v is nowrap, in zh, zh-TW and ja. The page then scrolled
sideways, and the mac page scrollbar rule set only width: 8px, so that
bar across the foot was drawn at the engine's default thickness.

- ledGroupSpeed also gives the figure in parts (the speed, then the
  count), and renderLedgerDash draws an array value as parts: each kept
  whole (ellipsised only if one alone is wider than the card), the count
  going under the speed in a card too narrow for both.
- body.mac's page/dialog scrollbar gets height: 8px beside width: 8px.
- usage-speed-count.test.cjs: widths 1400, 983, 789 (guzi171's window,
  #1634, the same overflow), 700, 560; the "read whole"
  check measured an element box that never overflows, now it measures
  every visible .led-strip .v's text (Range rects) against its card,
  which also covers the sibling cards and #ledVia's .led-strip; the
  sideways check reads #view-usage, the real scroller, not
  documentElement.
- view-scrollbar.test.cjs: a 3000px-wide page's bar across its foot is
  8px, as at its side.

Run: on the old code usage-speed-count fails in WebKit (zh, zh-TW, ja:
'75 token/秒(3 次)' outside its card) and view-scrollbar fails (foot
17px WebKit, 16px Chromium); with the change both pass in Chromium and
WebKit, en/zh/zh-TW/ja/de. Whole GUI suite (concurrency 4, load average
70-180): Chromium 3138 pass / 8 fail, WebKit 3135 / 9. None in Usage
but usage-stale-answer, red on main alone (#1632). The others pass alone
or fail the same alone on origin/main 756fef492: market-have (#1631),
routing-side-calls (#1640), redact-rule-row (#1653), privacy-hides-
accounts WebKit (#1632), segs-press-redraw (b0e25696e on main since),
routing-save/routing-flood (pass alone); library-instr-busy is #1624's
test, run here before its change.
2026-10-12 00:10:59 +08:00
yetone 310991d78f gui: a group with measured replies and floors shows both, the measured speed first, "125 tok/s (1) · ≥50 tok/s (259)" (Fallmonkey on Discord)
A group's speed showed its measured speed when it had one and dropped
its floors. With the commits before this one, a Codex model can have
one measured reply and hundreds of floors, and "125 tok/s (1)" stood
for all of them. Fallmonkey asked to see both.

ledGroupSpeed now joins the two, the measured one first:
"125 tok/s (1) · ≥50 tok/s (259)". Its tooltip has a line for each,
and the measured line drops "the others tell no speed" when the others
tell a floor (new strings in zh, zh-TW, ja and de). The Output speed
card keeps the measured speed as its figure, so a narrow card isn't
clipped, and puts the floor in its sub line. A ranking by speed still
orders and bars a group by its measured speed, or by its floor when it
has none. docs/reference.md says so.

Tests: usage-speed-count.test.cjs adds floors to sol and a new
measured-only group (astra, 62). It checks the joined text and the two
tooltip lines, the card's figure and sub line, and the ranking order
and bar, in en, zh, zh-TW, ja and de, in Chromium and WebKit, at 1400
and 560 px, with no clipping. It fails on the old app.js.

Ran: usage-speed-count, usage-session-speed, usage-ledger-detail,
usage-speed, reasoning-speed, usage-ledger-fit, usage-model-at-provider,
routing-request-metrics, gui-ja, gui-de, gui-zh-tw and i18n-keys in
both engines; go test ./internal/gui; gofmt -l; GOOS=linux/windows go
vet.
2026-10-11 12:49:27 +08:00
yetone e5b82cf38a usage, gui: Codex rows tell the least they wrote at: a call in a turn of several over its whole time, a turn of one call that reasoned by its answer after the first token (Fallmonkey on Discord)
Codex's session rows told no floor. A call in a turn of several could be
timed from inside itself; the commit before this one times it from what
asked for it, before its first output item, to its last, as Claude Code's
is. So Codex joins usage.FloorAgents and app.js's LED_FLOOR_AGENTS, and
such a call tells its output over its whole time, by the same 1,000-token
rule. On 622 stripped recent rollouts only 4 of 1,367 such calls have
1,000 tokens or more, so the floors will be few, but they are true.

A Codex turn of one call that reasoned has its first token (the turn's
time_to_first_token_ms) but not its first text, so DecodeOf tells no
speed. Fallmonkey asked for its whole output, reasoning too, over the
time after the first token. That reads high: OpenAI's reasoning is
written before the first content, so it isn't in that time. On a gateway
reply of 496 tokens, 224 of them reasoning, 827 ms after a 10.2 s first
token, that is 600 tok/s against a measured answer speed of 415 (the
bug e6dd5d20b fixed). Instead the answer, its output less the reasoning,
which all came after the first token, over that time: 329, a true floor
of the answer's speed. Any size tells one, as the wait isn't in it;
DecodeWindow's bounds still hold. The Requests row's tooltip says so, and
a group's floor tooltip now says the file doesn't say when the answer
began, true of both kinds, in en, zh, zh-TW, ja and de.

The 1,000-token rule stays (Fallmonkey asked for 5 s instead): it bounds
the share of the time the wait for the first token can be, which a
duration doesn't (a 5 s reply can be 4 s of wait). On the owner's
gateway rows, where both are known, a floor of 1,000 tokens or more read
0.40 of the measured speed (n=25), one of 5 s or more 0.18 (n=550). The
reason is in Row.Floor's comment and docs/reference.md.

Tests: TestCodexRowsTellAFloor (new) and TestGroupSpeedSaysHowManyRepliesItIsOf
(sol's 259 calls in turns of several now tell 259 floors at 50) fail on
the old ledger.go. usage-speed-count.test.cjs gains a turn-of-several row
(≥50) and the 496/224 row (≥329, its tooltip) and fails on the old app.js;
usage-session-speed.test.cjs's Codex row now tells its floor.

Ran: go test ./internal/usage ./internal/gui; usage-speed-count,
usage-session-speed, usage-ledger-detail, usage-speed, reasoning-speed,
usage-ledger-fit, usage-model-at-provider, routing-request-metrics,
gui-ja, gui-de, gui-zh-tw and i18n-keys in Chromium and WebKit, at 1400
and 560 px; gofmt -l; GOOS=linux/windows go vet.
2026-10-11 12:49:27 +08:00
yetone 3964ea656c usage, gui: a group's speed says how many replies it is of, "125 tok/s (1)", and one with only floors says "≥100 tok/s (30)" (Fallmonkey on Discord)
Fallmonkey: the Usage ranking and the Output speed card showed
gpt-6.1-sol's tok/s from the one reply of its 260 that used no tool (the
only Codex turn its session file times) beside "260 requests", while
Claude Code, whose Requests rows say "≥N tok/s" by the dozen since
0192edf1, showed none. Asked for one rule for every source: measured
replies give "N tok/s (k)", only floors give "≥N tok/s (k)", neither
gives nothing.

usage.Totals now counts DecodeN, the replies its DecodeMs/DecodeOut are
of (add and addRow), and FloorOut/FloorMs/FloorN, the floors of rows read
from Claude Code's and Claude Desktop's session files (Row.Floor, the
same rule as app.js's ledFloorSpeed: source "log", not failed, no
measured speed, 1,000+ tokens over 1 s+, under 10,000 tok/s). Floors are
never in Speed(); the Speed trend and `magpie usage` are unchanged.
app.js's ledGroupSpeed applies the rule to the ranking's rows (main page
and tray panel; the "Other" row sums the new fields), the Output speed
card and the overview's agent/model lists, with a tooltip saying which
it is and how many replies; a ranking by speed orders and bars a
floor-only group by its floor. Strings in en, zh, zh-TW, ja, de;
docs/reference.md says the rule.

Run: TestGroupSpeedSaysHowManyRepliesItIsOf (sol 260 calls, 1 measured
at 125 tok/s; Claude Code 42 calls, 30 floors at 100, a short, a failed
and a gateway row telling none; the page sums; summarize) fails to build
on the old code and goes red with the agent check taken out of
Row.Floor. usage-speed-count.test.cjs (overview, Requests rows, ranking
by tokens and by speed with order, titles and bars, the card for all and
for Claude Code's model alone, no clipping, no sideways scroll) passes in
Chromium and WebKit, en/zh/zh-TW/ja/de at 1400 and 560 px, and fails
against origin/main's assets. Related GUI suites (click-scroll, gui-de,
gui-ja, gui-zh-tw, i18n-keys, ledger-*, panel-usage, reasoning-speed,
routing-burst-speed, usage-*): 389/389 in both engines. go test -tags
nogui ./... (temp HOME) passes; gofmt -l clean; go vet nogui for darwin,
linux and windows on internal/usage and internal/gui. Not tried with
Fallmonkey's own data.
2026-10-11 10:04:15 +08:00