Repository navigation
Fresh requests can reject a cooled-down Pool before using their valid main credential #3996
Description
Client or integration
Codex CLI / Codex desktop through native Pool routing
Area
Authentication and account pool
Summary
A fresh request can be rejected locally because the selected stored Pool account is cooling down even when that request carries an eligible native main credential. The same credential can already be selected by the existing post-upstream-failure path, so one request can recover through main while its next request fails before any upstream send.
The missing branch is in resolveCodexAuthContext: when selection retains the stored account and no recovery probe lease is available, it throws CodexAccountCooldownError without trying the existing caller-owned-main resolver.
Reproduction
Reproduced with fixtures on Windows; no live credit or account mutation is needed.
- Configure Pool mode with one selected stored account, no exact account binding, and
autoSwitchThreshold: 0. - Give that account a shared
reset-derived429 cooldown. Issue the next request before a recovery probe is eligible. - Supply a valid caller main bearer through the existing
requestScopedMainCredentialadmission path. - Resolving with the stored account excluded succeeds as main, matching the existing retry behavior. Resolving the next fresh request without that exclusion throws the local cooldown error.
Expected: use the already validated caller main context when no eligible stored alternative or probe is available. Preserve model entitlement checks, the main 99% policy, exact account bindings, Pool selection and the existing cooldown. This is distinct from #3973, which reconciles cooldown after a confirmed manual credit reset; this request does not clear cooldowns or consume credits. The broader strict-quota policy proposal #3738 is also separate.
Version
Reproduced on dev 9e1468d4b7a41b498ed2aca98507ada2c741afea. The relevant auth-context.ts blob is identical on dev abb46a1599ec0d0bbfbe03905114178df92e67f5.
Operating system
Windows 11 Pro, version 10.0.26200.
Provider and model
Native Codex Pool routing; ordinary Codex quota scope. The fixture uses gpt-5.6-terra.
Logs or error output
Mock baseline: CodexAccountCooldownError: Selected Codex account is cooling down, source reset-derived, scope shared, thrown by resolveCodexAuthContext before an upstream send. The regression fails on the original source and passes after reusing the existing caller-main resolver at this branch.
Screenshots and supporting files
No account captures or credentials are attached. The focused regression checks the fresh-request path and preserved routing state; additional cases cover the main policy boundary at 98.99% and 99%.
Redacted configuration
Pool mode, one selected stored account, no pin or exact account binding, autoSwitchThreshold: 0. The inbound main credential is a fixture passed through existing request-scoped validation, not copied into Pool configuration.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
lidge-jun commentedon Sep 8, 2026
리뷰 · 우선순위 70 / 80
이 이슈는 Pool 모드에서 신선한 요청이, 선택된 저장 계정의
reset-derived쿨다운 때문에 로컬에서CodexAccountCooldownError로 거절되는 버그를 적습니다. 같은 요청이 들고 있는 검증된 caller main credential은, 상류 실패 뒤excludeAccountId재시도 경로에서는 이미 main으로 쓰일 수 있습니다. 그래서 “직전 요청은 main으로 복구됐는데, 바로 다음 새 요청은 전송 전에 쿨다운으로 죽는” 현상이 납니다. 재현은 Windows fixture로 가능하고, live credit을 쓰지 않습니다. Pool + 선택 계정 하나 +autoSwitchThreshold: 0+ shared reset-derived 쿨다운 +requestScopedMainCredential조합입니다.지금
devHEAD(402be7c1f)의src/codex/auth-context.ts를 보면, 쿨다운 계정에 probe lease가 없을 때 throw만 하고resolveCallerOwnedMainContext로 넘어가는 분기가 없습니다. 이슈가 가리킨 blob과 tip의 해당 구간은 같은 모양입니다. 기대 동작은 “저장 대안·probe가 없으면 이미 검증된 caller main을 쓰고, 쿨다운·핀·Pool 선택은 그대로 둔다”입니다. #3973(수동 reset 후 쿨다운 잔존)이나 #3738(strict-quota 대기 정책)과는 별개라고 본문에 분명히 적혀 있고, 그 구분이 맞습니다.이미 수정 PR #3997(draft)이
Closes #3996으로 열려 있습니다. 7줄 프로덕션 변경 + 회귀 테스트 + en/ko 가이드입니다. 다만 #3997은intake: hygiene-blocked(unsponsored_surfaceonauth-context.ts)라서 스폰서 없이는 못 들어갑니다. 이슈 자체는 재현·기대·비범위가 초등학생도 따라갈 수 있게 잘 쓰여 있습니다.경로 src/codex/auth-context.ts
resolveCodexAuthContext- 선택 Pool 계정 쿨다운 + probe 없음이면 즉시 CodexAccountCooldownError. caller main fallback 없음경로 requestScopedMainCredential / resolveCallerOwnedMainContext - 상류 거절 후 경로에는 이미 있음. 신선 요청에만 구멍
경로 #3997 - 이 이슈의 정답 PR. draft + unsponsored_surface
경로 #3973 / #3995 - 수동 reset-credit 후 쿨다운 정리. 이 이슈와 원인·처방이 다르다
경로 #3738 - strict-quota 정책 제안. 범위 밖
메인테이너의 판단이 필요한 지점
auth-context.ts스폰서십을 줄지, carry로 같은 패치를 올릴지너의 추천
이슈는 유효한 버그로 두고, #3997을 스폰서십 후 머지한 뒤 자동/수동으로 닫으세요. 중복 이슈를 새로 열 필요는 없습니다. #3994(구버전 incomplete 회계)와 섞지 마세요. 그건 #3795/#3791로 이미 닫힌 계열입니다.
이 댓글은 grok-bot이 작성했습니다
lidge-jun commentedon Sep 9, 2026
Fixed on
devvia #4088 at 4a08c75.