Skip to content

fix(codex): recover pending borrow requests with immediate reacquisition - #284

Merged
HTExplicit merged 9 commits into
mainfrom
codex/borrow-state-root-cause
Oct 11, 2026
Merged

HTExplicit merged 9 commits into
mainfrom
codex/borrow-state-root-cause

Conversation

@HTExplicit

@HTExplicit HTExplicit commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

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_route retains cooldown-based recovery. Optional immediate_reborrow_on_failure enables 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.

@HTExplicit HTExplicit changed the title feat(codex): select qualified borrow nodes with scoped cooling feat(codex): recover qualified borrow routes within pending requests Oct 11, 2026
@HTExplicit HTExplicit changed the title feat(codex): recover qualified borrow routes within pending requests fix(codex): recover pending borrow requests with immediate reacquisition Oct 11, 2026
@HTExplicit
HTExplicit marked this pull request as ready for review October 11, 2026 18:33
@HTExplicit
HTExplicit enabled auto-merge (squash) October 11, 2026 19:06
@HTExplicit
HTExplicit merged commit 157836b into main Oct 11, 2026
18 checks passed
@HTExplicit
HTExplicit deleted the codex/borrow-state-root-cause branch October 11, 2026 19:08
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