Keep Codex threads alive with shared 429 backoff - #507
Closed
alicon wants to merge 6 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Concurrent
ug codexprocesses share a Databricks model rate limit while Codex itself has a finite retry budget. This keeps the selected model and reasoning effort intact while making those sessions wait and resume instead of terminating on a 429.The change:
Retry-After, otherwise uses capped exponential backoff with jitter;managed_config.tomlbaseline because that higher-precedence direct provider silently bypasses the loopback proxy;No prompt, response body, header value, or credential is persisted.
Validation
2309 passed, 9 skipped, 1 deselectedwith a short macOS temp path; the deselected Codex wire-level test passed separately after the live managed-config migration.ruff check .,ruff format --check src/ tests/, andty check src/passed.429 -> shared wait -> internal retry -> 200over loopback and fake-gateway sockets.gpt-5.6-sol/xhighturn completed through the loopback provider, and~/.ucode/codex-rate-limit-state.jsonadvanced in the Sol bucket.Technical record
33119e58eae92adcdc1aa0483daa1eff27c8991fucode 0.1.0+90.g33119e5with/etc/codex/managed_config.tomlabsent.