The account Codex is signed in to can be paused in magpie while another
of its accounts is on (#263: the user's own ChatGPT account kept for
Codex's remote control and Computer Use, another doing the work). Turns
on Codex's own models already passed over it (codexAccounts, routing and
OwnPaused), but /responses/compact for one of those models still relayed
as it came, on the paused account's own token, and on history the
others had sealed.
compactOn now picks, for that case only, the first of the other accounts
on that isn't resting, and codexUpstreamOn relays the compaction signed
as that account (its token and chatgpt-account-id, through its proxy),
keeping the Accept Codex sent. A gateway key held to some accounts (#905)
is asked of the account it goes to, not the paused sign-in. Not paused,
nothing else on, an API-key Codex, or a request naming an account: the
relay is as before.
Not changed: a Codex provider switched off (Off) still relays Codex's own
model requests (the Codex app's gpt-5.6-luna/terra side generations,
memories, codex-auto-review, native compaction) on the sign-in as they
came; that is a design question, reported separately.
Tested: TestCodexPausedOwnAccountNotCompactedOn (in use: on the sign-in;
paused: acct-2 with its own token; key held to the paused sign-in: 403
with nothing asked; held to the spare: acct-2; the spare off: the sign-in
again) fails on origin/main at the paused step (tried [acct-1]) and
passes. gofmt; go vet -tags nogui ./internal/gateway on darwin, linux,
windows; go test -tags nogui ./internal/gateway ./internal/provider
./internal/agent under a temp HOME pass. Not tried with real accounts.