Files
orca/src/main/codex-cli
Brennan Benson 1e46121504 fix(codex): make quota probes credential-safe (#12145)
* fix(codex): make quota probes credential-safe

Codex OAuth uses rotating refresh tokens, and Orca's quota probes spawned
real codex app-server processes inside live credential homes, hard-killed
them at a 10s deadline (cold starts run 10-25s), re-probed every inactive
account on each switch, and deselected accounts on torn auth.json reads.

- arm the RPC read deadline only after initialize responds (30s/40s boot
  budget), and terminate probes via stdin EOF + SIGTERM with a bounded
  drain before any hard kill; resolve only once the child exits
- serialize Orca-spawned codex processes per credential home (probe vs
  probe, probe vs commit-message/PR-fields/branch-name/model-discovery)
- keep the inactive-probe debounce across account switches and stagger
  inactive probes; the active account still refreshes immediately
- grade credential reads (present/missing/unreadable/no-credential) and
  require absence to outlive a grace window before deselecting

* fix(codex): close remaining credential races

* fix(codex): keep failed probes under home lock

* fix(codex): observe probe pipe failures

* fix(codex): await Windows generation tree kills

* fix(codex): preserve incomplete shared credentials
2026-08-02 19:06:43 -07:00
..