xiaoq6285 on Discord (v0.1.2700): Codex on an official ChatGPT account
ran out of quota, and after switching to another account or provider in
magpie, the Codex app's Send button stayed grey. magpie has no chat
composer of its own; the button is the Codex app's, which greys Send for
every model while the app-server it runs is on a ChatGPT account the app
holds. magpie lifts that by restarting the app's app-server
(codexAppStep), but never while a Codex turn is open in its sessions, for
up to codexTurnWindow (30m). When quota runs out mid-turn the turn is
left open, so the restart, and the grey, waited.
cc81ad4ea let a quiet stuck turn be restarted past (codexTurnStuckAfter,
2m) only after SwitchWhenSpent's own switch. Two siblings that leave the
app-server on the same used-up account still waited the 30 minutes:
- a switch by hand (Accounts, CLI) off an account last read held:
noteCodexSwitch now marks it spent when the account's reading in hand
says Held (codexHeldKnown: cache only, no I/O; a failed read or none
is not held);
- magpie becoming Codex's provider for the used-up account (codex.out):
codexAppStep marks the change into out spent. The way back at the
reset still waits for any open turn, as a real one may run there.
A turn still writing its session or sending through magpie in the last
2 minutes holds the restart as before.
Tests, both red on the old code:
- TestCodexAppServerRestartedPastATurnStuckWhenMagpieTakesOver
- TestCodexHandSwitchOffAHeldAccountIsSpent
docs/subsystems/agent-wiring.md says so.
Run at this head on mote:
- go test -tags nogui ./internal/provider: ok (151s), at this head
after the rebase on 52195b6b0 (it changed provider_test.go and two
more provider files, so provider was run again).
- Before the rebase (on 07f4d46c5): provider ok, agent ok, gui ok;
gateway red on TestCodexPoolSaysTheClientsVersion alone (#4807, red in
a full package run, passes alone; -count=5 alone ok at this change);
cli red on TestEveryRouteHasACommandOrIsNamed (#4826), red the same
on origin/main 52195b6b0 just fetched.
- gofmt -l clean; GOOS=linux go vet -tags nogui, GOOS=windows go vet
and go vet of ./internal/provider ./internal/agent ok at this head.
- Not run: the full go test ./... (agent, gateway, gui, cli and provider
are what reach this code). No GUI change, so no GUI suite.
Broken by hand, each red, then restored:
- spent not set on the takeover (c.spent && into): the takeover test
failed "a turn stuck on the used-up account as magpie took over:
ended [], want [60]".
- noteCodexSwitch never marking spent: the hand-switch test failed
"switched off out@x: switched true, spent false, want true, true".
Not tried: the real Codex app with an account actually out of quota
(no such account to hand), and Windows/Linux runs of the package (the
change is OS-independent logic; GOOS vet run). Not confirmed with the
reporter that their case is a turn left open; their screenshot wasn't
seen here.