yetone
84f14e555c
usage: a Codex call with no response_id leaves compaction out of Usage requests instead of saying false ( #1591 )
...
Codex added token_usage_record and compaction_response_id together, in
openai/codex#41912 (2026-08-31). A call that magpie reads from a
token_count event alone, as in older rollouts, has no response_id. It
can't carry the compaction marker either way. The previous commit
reported such calls as `compaction: false`, which claims they were not
compactions. codexCompactionOf now returns no state for them, so the
ledger and the requests page leave the field out, as they do for any call
with no native evidence.
What was run:
- New test TestCodexCallWithoutResponseIDHasNoCompactionState. On the
previous commit it fails with `ledger: a call with no response_id claimed
a compaction state: {..."compaction":false...}`, and with the same message
for the requests page. It passes now.
- go test -tags nogui ./internal/sessions ./internal/usage: ok.
For all three commits on origin/main 1ad60446f :
- gofmt -l on the changed files: clean.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./...: ok.
- go build for darwin, linux (nogui) and windows: ok.
- Full suite: go test -tags nogui -timeout 40m ./... (pipefail, sandbox
HOME): 53 packages ok, exit 0.
- No GUI asset changed, so no Playwright run.
- Not tried: a real Codex subagent rollout (legacy or paginated). The
formats are from Codex's source, and Hogeexxl checked two real paginated
subagents.
- Rebased onto origin/main f255a3e3b (12 commits newer, including #2233 and
#2234 in internal/sessions; no cache-version clash). Rerun there: go
test -tags nogui -count=1 ./internal/sessions ./internal/usage
./internal/gui, gofmt and vet on both packages: ok.
2026-10-15 04:21:31 +08:00
..
2026-10-14 14:35:23 +08:00
2026-10-13 18:17:47 +08:00
2026-10-11 04:44:13 +08:00
2026-10-14 05:43:47 +08:00
2026-10-07 02:14:29 +08:00
2026-10-13 18:17:47 +08:00
2026-10-13 18:17:47 +08:00
2026-10-07 02:14:29 +08:00
2026-10-07 02:14:29 +08:00
2026-10-15 04:21:31 +08:00
2026-10-14 22:45:40 +08:00
2026-10-15 04:21:31 +08:00
2026-10-11 04:44:13 +08:00
2026-10-15 04:21:31 +08:00
2026-10-10 04:24:18 +08:00
2026-10-13 18:17:47 +08:00
2026-10-07 02:14:29 +08:00
2026-10-09 11:33:47 +08:00
2026-10-11 12:58:03 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 11:48:41 +08:00
2026-10-13 16:34:59 +08:00
2026-10-15 04:21:31 +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-10-09 02:48:29 +08:00
2026-10-09 02:48:29 +08:00
2026-10-09 06:54:28 +08:00
2026-10-13 18:17:47 +08:00
2026-10-13 04:31:07 +08:00
2026-10-04 23:30:56 +08:00
2026-10-04 23:30:56 +08:00
2026-10-12 01:16:36 +08:00
2026-10-06 13:32:03 +08:00
2026-10-13 06:43:50 +08:00
2026-10-12 01:16:36 +08:00
2026-10-13 01:41:50 +08:00
2026-10-14 15:26:28 +08:00
2026-10-10 19:15:12 +08:00
2026-10-14 15:26:28 +08:00
usage, gui: Usage › Requests' All opens at once after magpie has been up a few seconds, and in half the time before (the owner) — Requests on All stayed a skeleton for 39 s on the owner's magpie right after it started: the first All parses every session file (12.3k here: 11k Codex sessions, 1.2k Claude Code projects' files), one after the other, each a wait on the disk. Those a query has to parse are now read 8 at a time ahead of the loop that takes them in order (prefetchSources), at most 32 waiting, so the history is never all held at once; and magpie reads the whole history in the background once it is up, right after the Sessions page's own warm-up and not beside it on the disk, so the page opens on the kept index. Tested in a sandbox HOME on a copy of the owner's real ~/.codex and ~/.claude history (magpie app, dev UI): the first All right at startup took 10.6 s before and 4.6–4.9 s now; opened 20 s after startup it took 10.0 s before and 0.01 s now; later Alls 0.3–0.4 s as before. TestPrefetchSources (each source handed back as its own, read in parallel, no more than the window ahead, every one read once, an unwanted one read when asked) is new. go vet, go test -race ./internal/usage, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 20:18:46 +08:00
2026-10-11 04:44:13 +08:00
2026-10-13 10:13:15 +08:00
2026-10-13 17:23:00 +08:00
2026-10-15 04:21:31 +08:00
2026-10-13 06:32:03 +08:00
2026-10-13 06:32:03 +08:00
2026-10-07 06:17:56 +08:00
2026-10-07 02:14:29 +08:00
2026-10-07 19:43:01 +08:00
2026-10-07 19:43:01 +08:00
2026-10-15 04:21:31 +08:00
2026-10-14 22:45:40 +08:00
2026-10-11 12:58:03 +08:00
2026-10-07 02:14:29 +08:00
2026-10-08 15:15:37 +08:00
2026-10-12 00:44:47 +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-10-12 00:44:47 +08:00
2026-10-03 23:44:06 +08:00
2026-10-11 04:44:13 +08:00
2026-10-13 12:08:10 +08:00
2026-10-13 16:34:59 +08:00
2026-10-10 20:47:00 +08:00
2026-10-07 02:14:29 +08:00
2026-10-14 15:26:28 +08:00
2026-10-07 03:03:06 +08:00
2026-10-15 04:21:31 +08:00
2026-10-13 18:17:47 +08:00
2026-10-14 12:53:09 +08:00
2026-10-14 12:53:09 +08:00