Repository navigation
fix(codex): recover pending borrow requests with immediate reacquisition - #284
Merged
Merged
Conversation
added 5 commits
October 11, 2026 18:47
HTExplicit
marked this pull request as ready for review
October 11, 2026 18:33
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.
Codex business requests for a borrow target currently end with 503 when qualification fails, even though no business generation has been sent. Keep the original request pending, search registered routes, and dispatch it once only after complete strict two-shot qualification. Preserve the real business STATE response header and the client body, tool history, session identity, model, effort and tier; cancellation stops request-owned recovery and never replays a dispatched generation.
Optional
wait_for_qualified_routeretains cooldown-based recovery. Optionalimmediate_reborrow_on_failureenables zero preparation cooldown and fresh source acquisition after rejection, including failures cached at the same node/gateway. Both are off by default; immediate mode requires waiting and node selection. An active same-cookie lease is not extended. Expired qualification requires fresh source acquisition and a complete new target pair, retaining the upstream lease lifecycle. Administrators retain bounded diagnostics. The UI distinguishes reacquisition, strict validation, recovered qualification and completed business.Validation: targeted synthetic recovery tests cover cached STATE replacement, consecutive failed rounds with fresh acquisition, source failure without old-candidate fallback, expired qualification without cached-only dispatch, request/header preservation and one business dispatch, cancellation, shared preparation and account deactivation. Targeted frontend tests, TypeScript and ESLint passed; normal required CI remains enabled, including the new immediate-recovery cases in the existing race check.
Rollout is restricted to account 16545 on the original US host and registered candidates 43, 36, 34, 44, 48, explicit direct 0, 33. Model-quality acceptance is tracked separately: prior experiments have not completed both models and both lease boundaries. Deployment of the recovery mechanism does not claim stable upstream qualification or improved model quality.