Commit Graph
3 Commits
Author SHA1 Message Date
yetone b027ca264d sessions: a pass over every session looks at Codex's title index once (#3493)
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.
2026-10-25 08:40:59 +08:00
Zhu Wang a13923a1e3 fix(routing): automatically group Codex title requests with their chats (#768)
* fix(routing): associate Codex title requests with applied chat titles

* fix(routing): address automatic title grouping review
2026-10-04 18:56:31 +08:00
Zhu Wang 1adb2b571e feat(routing): group requests by session with names and estimated costs (#396)
* 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.
2026-10-01 20:50:15 +08:00