The warm-up at start ran three reads within about two seconds: the
stats of every day, the stats of 30 days and the Requests page. Each
listed every Codex rollout again through codexFiles, about 12k lstat()s
and ~47 MB allocated a time. codexFiles now keeps its listing while
only the warm-up reads (quiet: inside Warm, no page asking) and for 10s
at most, the age statsFor's memo already answers with. Each caller gets
its own copy. A page asking meanwhile, and every read outside the
warm-up, lists fresh, and Warm drops the kept listing when it ends.
Measured on the owner's real sessions (sbpairs: Claude Code and Codex
history, warm index), the gui warm-up harness inside sessions.Warm, run
alternately with the parent b686a8dfe, three runs each:
allocated through step 3: 990/826/811 MB -> 751/732/734 MB
step 1 (stats of 30 days): 436/134/114 ms -> 65/57/57 ms
peak live heap: 170/163/160 MB -> 157/153/153 MB
phys_footprint_peak: 259/242/234 MB -> 233/250/250 MB (no change)
Step 2 and the whole warm-up time are within noise.
Run at this tree (b686a8dfe + this change):
go test -count=1 -timeout 45m ./internal/sessions/ ok
go test -count=1 -timeout 45m ./internal/usage/ one red,
TestUsageReadAfterAppendHashesNothingOnAFineClock/whole-second_stamp,
which is #3511/#3551; alone -count=5 it passes. That path never
enters Warm, so it never takes the kept listing.
go test -count=1 -run 'Warm|Session' ./internal/gui/ ok
GOOS=linux and GOOS=windows go vet -tags nogui ./internal/sessions/, gofmt -l: clean
Broken by hand: codexFiles always listing fresh makes
TestWarmUpListsRolloutsOnce red ("warm-up listed again"); handing back the
kept slice itself instead of a copy makes it red ("a caller's change
reached the kept listing").
Not tried: Windows (the box is unreachable over ssh).