Skip to content

Self-heal codex quota walls via CODEX_GATEWAY_POOL rotation#41

Merged
Octember merged 1 commit into
mainfrom
claude/codex-llm-rotate-985e3c
Jul 11, 2026
Merged

Self-heal codex quota walls via CODEX_GATEWAY_POOL rotation#41
Octember merged 1 commit into
mainfrom
claude/codex-llm-rotate-985e3c

Conversation

@Octember

Copy link
Copy Markdown
Owner

When a review dies rate-limited (the existing used === 'limit' path), the sweep now advances the gateway hostname in ~/.codex/config.toml to the next entry in CODEX_GATEWAY_POOL (an ordered ring of interchangeable ChatGPT-account gateways, e.g. exe.dev llm integrations). Codex re-reads the config each sweep, so the next sweep runs on the fresh account.

  • No probing: the real failure is the signal; a dead account fails fast and the ring advances again, converging on whichever account has quota.
  • Cooldown-guarded (CODEX_ROTATE_COOLDOWN_MIN, default 10) so a fully-drained pool cycles calmly.
  • Unset pool = no-op — existing installs are untouched.
  • Same env contract bunion (bevyl-ai/bunion#72) and earshot (Octember/earshot#3) now rotate on via @bevyl-ai/agent-tools; inlined here (~25 lines) to keep the engine dependency-free.

Tests cover ring advance + wrap, cooldown suppress/re-arm, pool-off, and foreign-config no-touch — real temp files, no mocks.

When a review dies on the plan's usage limit, advance the gateway hostname
in ~/.codex/config.toml to the next CODEX_GATEWAY_POOL entry (ordered ring
of interchangeable ChatGPT-account gateways; unset = off, current behavior).
Codex re-reads the file each sweep, so the next sweep lands on the fresh
account — no probing, no restarts, one step per CODEX_ROTATE_COOLDOWN_MIN.
Same env contract bunion and earshot rotate on via @bevyl-ai/agent-tools;
inlined (~25 lines) to keep this engine dependency-free.
@Octember Octember force-pushed the claude/codex-llm-rotate-985e3c branch from 3182dbc to 7d3a822 Compare July 11, 2026 15:06
@Octember Octember merged commit eacc625 into main Jul 11, 2026
2 checks passed
@Octember Octember deleted the claude/codex-llm-rotate-985e3c branch July 11, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant