The first Sessions page after a start that showed Codex rows read
usage.CodexModelEffort cold, from the whole ledger, while the page
waited. The warm-up now reads it as its last step, after the stats it
already warmed, and only when those stats hold a Codex session; every
later ask is answered from what CodexModelEffort keeps per period.
The steps move into warmSteps() so a test can run them.
TestWarmUpReadsCodexEffort: with Codex keys in the stats the step reads
the effort once, with none it reads nothing. With the step removed: red,
"read 0 times, want 1".
Measured on the same sandbox as the commit before (600k gateway calls,
~4,600 sessions), base 1a3b92688 against this branch, back to back, at a
load average of 350-480 (nine agents running suites):
manage?agent=codex, asked 3.5s after the routes:
base 226s / 190s / 232s (cold) new 247s / 222s / 246s (cold)
It is not faster here: asked at 3.5s, the page arrives before the
warm-up reaches its last step, and both read the ledger at once; the
load makes every one of these numbers mostly CPU wait. The step helps a
first Codex page opened after the warm-up is done, which is the case in
#2776 (a page opened some time after a restart). Not measured at that
point under this load.
Run on origin/main 2ceff7370 with all four #2776 commits' changes
(this one and the three beside it), load average 291-568 (nine agents
running suites), macOS:
- go test -p 4 ./... -timeout 45m, 09:35-10:49: 62 packages ok,
among them agent (2310s), gateway (1707s), provider (764s), usage
(83s). Red:
- internal/sessions: TestWSLOmpProfiles, TestWSLStoppedDistroKept,
TestWSLStoppedSinceNotOpened, TestWSLNoneWithoutHomes, each
"TempDir: mkdir ...: no space left on device" (the disk filled
mid-run). After space was freed, ./internal/sessions alone: ok
(139s).
- internal/gui: TestDockJoinLeadsCommandTab, TestPanelCloseHidesIt,
TestPanelJoinsFullScreenSpaces, TestPluginPageLoadsItsFilesInTheWindow,
TestDockReopenKeepsTheWindowsSpace (each killed at 30s) and
TestMainWindowCorners (86s): the real-window AppKit tests under
load, already filed as #2645 and #1936. Rerun alone at load ~335:
all pass, with TestSetAnswersWhileDevinAndProvidersHang (17s).
- gofmt -l: none. go vet: darwin, GOOS=linux -tags nogui and
GOOS=windows all exit 0.
- No internal/gui/assets file changed, so the GUI Playwright suite was
not run.