Commit Graph
1 Commits
Author SHA1 Message Date
yetone 099d2b4612 agents: Codex back on ChatGPT after the reset says to restart its app, with a Restart
A bug report by mail (11-04): after the ChatGPT allowance reset, Codex
was back on its account, but the Codex app still showed no account and
no usage. The app's app-server was the one it started while magpie
served Codex, and the app reads account/read only as that starts. With
"Restart the Codex app when magpie switches its account back" off (the
default, #4550), codexAppStep leaves it running, and nothing said so;
the takeover's hover even said "It all comes back on its own at the
reset". On Windows StaleCopies lists only the daemon, so no hint showed
there either.

- provider: codexAppStep remembers the app-servers it left running when
  magpie gave Codex its account back (c.out && !out, not magpie's own
  account switch, which codexAppLeft already says). CodexAppBack() is
  true till they are gone (rechecked every 30s; a failed listing keeps
  it), a route change clears it, and RestartSwitchedCodexApp clears it.
- gui: /api/state's Codex row carries appBack (not for a WSL Codex).
  The Agents row says "Back on ChatGPT · restart the Codex app to see its
  account" with a Restart, and the row opened says why, with the same
  Restart; it posts codex/daemon/restart-app, as the Providers page's
  "still signed in as" Restart does. The takeover text now says the
  account and usage come back once the app-server restarts, and that
  this row offers it.
- i18n: zh, zh-TW, ja, de for every new and changed string.

Run (on mote unless named; rebased on origin/main d892dd6a2, then 8b902e287 (checkin only; vet and CodexApp/Checkin tests ok there), the gui budget/i18n Go tests, CodexApp and i18n-keys, codex-app-back, codex-app-out ran again at this head: ok, 148 of 148):
- go test ./internal/provider -run CodexApp: ok; also ok on Windows
  (win-run) and Linux (wsl-run, with go vet ./internal/provider).
- go test ./internal/gui: one red, TestMainWindowCorners/macOS_26_SDK,
  which is #3949 (macOS 27 on mote), nothing else.
- GOOS=windows go vet ./internal/provider ./internal/gui: ok. Linux vet
  of internal/gui needs gtk4/webkitgtk dev packages the WSL distro
  lacks, so it was not run.
- gofmt -l internal/: nothing.
- GUI: every codex-*, agent*, ag-* and i18n* file (86 files), both
  engines: 1484 of 1486. The two reds are codex-auto-reset webkit de
  1100/420, red the same alone at origin/main e0ee9265e; #4790 (noted
  there that macOS has it too). The new codex-app-back.test.cjs: 20 of
  20, every language, both engines, 980 and 440 px, line and row opened.
- Broken by hand: leftBack forced false, TestCodexAppBackSaidTillItRestarts
  went red ("the app left on the takeover's app-server isn't said");
  restored.

Not tried: a real Codex app through a real reset; the state machine is
driven with stubbed app-server listings.
2026-11-05 01:45:17 +08:00