Skip to content

[Bug]: transient-hold resolver and pool-wide recovery limiter are not wired into production dispatch #4701

Closed

Description

@Ingwannu

Summary

The 2.56.0 tree added and documented a transient half-open resolver plus a process-wide recovery ratio limiter in #4626, but the production request path does not call the new dispatch APIs.

Current exact refs checked:

Current behavior

A source search outside src/routing/probe-lease.ts finds no production caller of:

  • resolveHeldAccountDispatch
  • sharedPoolBackpressure
  • createPoolBackpressureLimiter
  • recordInitialSend
  • tryPermitRetryDispatch
  • tryPermitProbeDispatch

Only direct unit tests call the resolver and limiter. Existing production imports of this module are for the older Codex quota-probe lease functions (tryAcquireCodexQuotaProbeLease, ownsProbeLease, and related settlement helpers). Those do not connect the new transient-hold resolver or the pool-wide initial/recovery send ratio.

Consequently, the new unit tests prove the isolated primitives, but a burst of separate requests still has no shared limiter at the initial-send and retry/probe dispatch boundaries. The structure contract currently says the limiter is active, which overstates runtime behavior.

Expected behavior

Production account selection should consume resolveHeldAccountDispatch for a bound transiently held account, preserving its working detour while permitting only one half-open probe. Every physical first send should call the shared limiter's recordInitialSend; every retry and transient probe should obtain a recovery permit before dispatch.

A refusal must return a future retry time rather than busy-looping, must not consume the request-local send budget, and must not discard the remembered detour.

Required regression coverage

  1. Two concurrent requests bound to the same held account produce one probe and one detour/withheld result through the real request boundary.
  2. Many requests share one process-wide recovery ratio; separate request objects cannot each obtain a private allowance.
  3. A refused recovery dispatch performs no provider fetch and returns a bounded future retry signal.
  4. Success/failure/expiry settlement cannot overwrite a newer affinity generation.
  5. Existing quota-probe behavior remains unchanged.

Scope note

This is not a claim that every probe lease is unused. The existing quota-probe lease is wired. The gap is specifically the transient-hold resolver and pool-wide recovery limiter introduced in #4626.

@lidge-jun This was reported by the post-promotion exact-tree review on #4694 and is present in the released 2.56.0 tree. I recommend treating the runtime wiring and the inaccurate active-contract wording as a 2.57 follow-up, not patching the release branch directly.

Activity

  1. added
    bugSomething isn't working
    account-poolOAuth, credentials, Codex pool, quota, failover, plans
    on Sep 15, 2026
  2. lidge-jun commented on Sep 15, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 75 / 80

    이 이슈는 #4626이 넣은 transient half-open resolver와 process-wide recovery ratio limiter가 유닛에는 있고 생산 dispatch에는 없다는 고발이다. tip 51d577c3f에서 resolveHeldAccountDispatch·sharedPoolBackpressure·createPoolBackpressureLimiter·recordInitialSend·tryPermitRetryDispatch·tryPermitProbeDispatch의 정의는 src/routing/probe-lease.ts에 있다. 생산 트리에서 이 심볼들을 probe-lease/테스트 밖으로 호출하는 곳은 없다. 기존에 배선된 것은 Codex quota-probe lease(tryAcquireCodexQuotaProbeLease 등, src/codex/auth-context.ts/src/codex/routing)뿐이고, 그건 새 transient-hold resolver/pool-wide limiter와 다른 API다.

    결과적으로 동시 요청이 같은 held 계정에 묶여도 half-open probe 1개 + detour 보존 계약이 요청 경계에서 강제되지 않고, recovery ratio도 요청마다 사적 여유가 생긴다. structure 계약이 limiter를 active라고 쓰면 런타임을 과장한다. 리포터가 #4694 프로모션 exact-tree 리뷰에서 찾아 2.57 후속을 권한 점도 tip 스냅샷(#4546 OPEN, 2.56.0 freeze 386303a)과 맞다.

    요구 회귀(동시 두 요청 → probe 하나, 프로세스 전역 ratio, 거절 시 fetch 없음·미래 retry, affinity generation 덮어쓰기 금지, 기존 quota-probe 불변)가 바로 수락 기준이 된다.

    경로 src/routing/probe-lease.ts - 새 API는 export되어 있으나 생산 호출자 없음.
    경로 src/codex/auth-context.ts / routing - 옛 quota-probe lease만 배선.
    경로 structure 계약 - limiter active 서술이 런타임보다 앞섬.
    경로 유닛 테스트 - primitive만 증명, 요청 경계 통합 없음.

    메인테이너의 판단이 필요한 지점

    너의 추천
    받아라. #4546 하위 필수 후속으로 라벨하고, 생산 account selection에 resolveHeldAccountDispatch와 shared limiter를 붙인 뒤 이슈의 다섯 회귀를 통합 테스트로 고정하라. 그 전까지 structure의 active 문구는 낮춘다. release branch 직접 패치는 하지 말 것.

    이 댓글은 grok-bot이 작성했습니다

  3. lidge-jun commented on Sep 16, 2026

    @lidge-jun
    Owner

    Landed via #4784 at cf6e939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workinglanded-via-maintainerOriginal PR closed after landing via a maintainer merge train

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions