LEO_CHEN_X on X (https://x.com/LEO_CHEN_X/status/2113864310367961569):
on opening the lid, Codex's 5-hour window always shows 4h59m left, and
they took it to mean the auto-start is broken.
The code does what it should. keepWarm (internal/provider/codex_warmup.go)
checks every minute on a Go timer. On macOS that timer runs on
mach_absolute_time, which stops during sleep, so it fires within a minute
of waking. The 5-minute look goes by the wall clock, so the look is due
at once. warmNow then finds the window past its reset (asOf, even on a
read cached before sleep) and idle, and sends the one request. A window
still running at wake is not idle and gets nothing (checked in a scratch
test: an account warmed at 20:00 and woken at 22:00 sent nothing, and
one woken at 04:00 sent one). Nothing can send during sleep, and magpie
doesn't schedule a wake. Starting at wake is the earliest start there
is, no later than the user's own first request would make it.
What was wrong is that the row never said so. Daily warm-up's title
explains what a sleeping computer does with its time, and Warm up on
reset said nothing. Codex's and Claude Code's Warm up on reset lines now
carry a title (index.html data-tt, translated with the page) saying
nothing is sent while the computer sleeps, and that a window which
resets then starts on waking and counts from then. Translated into zh,
zh-TW, ja and de. The title is static, so app.js doesn't change and
TestCoreScriptBudget keeps its budget (an app.js version came in 754
bytes over).
Run at this tree:
- gofmt -l internal/: nothing. go vet, GOOS=linux go vet -tags nogui,
GOOS=windows go vet on ./internal/gui ./internal/provider: ok.
go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok.
- go test -tags nogui -timeout 45m -count=1 ./internal/gui: ok (92s).
- New internal/gui/tests/warm-reset-asleep.test.cjs: 10 of 10 in
Chromium and WebKit, en zh zh-TW ja de. With the old index.html it
fails 10 of 10.
- Both engines, 13 files: gui-de, gui-ja, gui-zh-tw, header-relang,
i18n-keys, settings-general, settings-groups, settings-search,
settings-sections, settings-tabs-stick, warm-at-own, warm-at-times
and warm-reset-asleep, 162 of 162 pass.
Not run: the full GUI suite, since app.js is unchanged and no selector,
API or layout changed. Also not run: go test ./... and a real sleep and
wake of a Mac with a real account (the wake path was read in the code
and checked with the scratch test above).