fix(codex): honor scoped cooldowns in subagent fallback - #2418
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds side-effect-free scoped quota probe eligibility, entitlement-aware pool account previews, model-specific fallback routing, and recovery-path reuse of those constraints. Tests cover cooldown recovery, fixed and pool accounts, entitlement filtering, and encrypted task recovery. ChangesEntitlement-aware subagent fallback
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change scopes fallback cooldown handling to the appropriate quota scope while preserving existing pacing and selector behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fa04e07ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1fa04e0 to
25fbdd1
Compare
리뷰 · 우선순위 56 / 80설명: 이 PR 은 자식 에이전트가 다른 모델로 넘어갈 때, 그 모델의 할당량 칸에 맞는 계정만 고르게 한다. 지금 CURRENT src/codex/subagent-model-fallback.ts 라인 176 - 지금 HEAD 는 박힌 계정이 없으면 미리보기 계정 하나를 모든 후보에 쓴다 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
The candidate-scoped preview direction is correct, but the current handleResponses gate leaves one account-qualified primary path outside the entitlement boundary.
subagentFallbackNeedsModelEntitlements(parsed, config) correctly scans the fallback chain, but core.ts resolves the entitlement snapshot only when the initial route has route.codexAccountId === undefined. If a thread starts on an account-qualified primary (for example team/gpt-5.6-sol) and that fixed candidate is skipped by cooldown/health, a later pooled or fixed gpt-daybreak-blue-latest fallback is evaluated without modelEligibleAccountIdsForModel. The unit helper can enforce entitlements when a callback is passed, but the production call never creates that callback for this route shape. It can therefore skip a healthy entitled pool account because an unentitled preview account is cooled, or admit an unentitled fixed fallback and fail only during final auth.
Please remove the initial-route account-id condition from entitlement snapshot setup; the need should be derived from the actual fallback chain, not the primary route ownership. Add handleResponses regressions for an account-qualified primary that falls through to (1) a pooled account-gated model where only another pool account is entitled and (2) an unentitled fixed account-gated selector that must be skipped. Keep preview side-effect-free and final authentication authoritative.
After the fix, rebase onto current dev, rerun the two focused fallback suites, typecheck, and exact-head CI. No broader routing refactor is needed.
Summary
Verification
bun run typecheck— passed.bun run privacy:scan— passed.git diff --check— passed.25fbdd10dfb0f4f237ab6a5da4405dc0ce4e0ffe, based directly ondevat4f41a8e936141af7ee828e335da314b9dc1ef761.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.