assemble and assembleListed asked CodexTitles for each Codex session,
and each ask took the index's lock and stat'ed session_index.jsonl. A
start's stats step assembles every session, so on the owner's data
(sbpairs copy: ~10G Claude, ~50G Codex rollouts) CodexTitles was 60ms
of step 0's 860ms CPU profile. codexTitleOf gives a pass one function
that looks at the index on its first ask and again only when another
reader loaded a different index in between; every caller of assemble
and assembleListed makes one per pass, beside its pricer().
Run at this head (rebased on origin/main below):
- zzwarm step 0 CPU profile on the sbpairs real data: CodexTitles,
codexTitlesAt and loadCodexTitles 60ms -> absent; statsRead 340ms ->
270ms cum. Wall times at load 40-76 were within noise both ways.
- TestCodexTitleOfLooksOnce: no index, an index made mid-pass not seen
in that pass, seen in the next, a rename mid-pass keeps the first
name. Broken by hand (re-ask on every call): red at "an index made
after the first ask".
- go test ./internal/sessions ./internal/usage ./internal/gui ok;
-race ./internal/sessions ok; GOOS=linux/windows go vet -tags nogui
./internal/sessions ok; gofmt clean.
Not changed: gui's own CodexTitles callers (trace.go, context.go) ask
for a few ids at a time already.
Not tried: a Linux or Windows real-data run.
* feat(routing): group requests by session with names and estimated costs
* fix(routing): address session view review feedback
Preserve Luna Reserve and other header fallbacks for ordinary Codex turn metadata; reuse metadata and the kind across trace and native accounting. Default to By request and persist the grouping choice. Store only token accounting fields in route history while retaining legacy JSON compatibility.
Add regressions for helper precedence, native kind accounting, history compatibility and grouping preferences.