Skip to content

fix(codex): explain and enforce automatic plan exclusions - #4361

Draft
lidge-jun wants to merge 3 commits into
devfrom
codex/260912-60plus-accounts-eligibility
Draft

fix(codex): explain and enforce automatic plan exclusions#4361
lidge-jun wants to merge 3 commits into
devfrom
codex/260912-60plus-accounts-eligibility

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

  • Complete the codexPool.excludedPlans follow-up to feat(codex): let an operator keep a downgraded account out of pool rotation (#4211) #4238 / [Feature]: keep Free-tier ChatGPT accounts out of Codex pool selection #4211: automatic resolution and preview return no account when every eligible pool account is excluded. Explicit account-qualified routes retain access and keep their pause, authentication and entitlement checks; native main remains exempt.
  • Account API, CLI and GUI show the exclusion reason and routing-policy plan separately from credential health. Excluded cards no longer offer an ineffective automatic Set-as-next action. Unknown/absent policy remains unchanged, and renewal clears the derived reason.
  • Updates every affected guide translation and source ownership document. This is an independent PR against dev; no callback dependency or native stack.

Verification

  • Local product tests of every size, GUI tests, build, typecheck and install: NOT RUN, per explicit maintainer instruction. Regression sources are added for hosted CI.
  • git diff --check and staged whitespace check passed; these are source-text checks only.
  • Independent design reflection and A audit: PASS. Implementation source review and final-head hosted CI are pending.
  • GUI screenshot: pending the hosted dashboard-preview artifact; this PR remains draft until the rendered evidence is attached.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Sep 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 68 / 80

이 PR은 codexPool.excludedPlans 후속(#4238 / #4211)을 마무리합니다. 예전에 "마지막 남은 제외 계정이라도 자동으로 받아준다"던 동작을 바꾸고, 자동 선택·preview는 적격 계정이 모두 제외되면 null을 반환합니다. 명시적 account-qualified 라우트는 제외 정책을 우회하되 pause·reauth·entitlement 검사는 그대로 둡니다. native main은 면제입니다.

코드 변경은 작지만 의미가 큽니다. src/codex/routing.ts에서 isCodexAccountPlanExcluded를 export하고, previewCodexAccountForRequest·resolveCodexAccountForThreadDetailed의 active-fallback 경로에 제외 검사를 넣었습니다. API DTO·CLI·GUI는 selectionExcludedReason: "plan_excluded"와 정책에 쓰인 plan 값을 보여 주고, Next/Switch 배지는 제외 계정에 붙지 않게 했습니다. 테스트가 "automatic routing refuses the last excluded account"로 기대값을 뒤집습니다.

현재 dev의 routing과 accounts 트랙(#4369 reset-first, 이미 들어간 쿼타 콤보)과 같은 파일을 건드립니다. mergeable은 조회 시점 UNKNOWN이었습니다. 설정 스키마 자체보다 선택 정책·표시 레이어 중심이라 types/config 분리에 바로 무효화되진 않을 가능성이 큽니다.

라인 / 심볼 - previewCodexAccountForRequest / resolveCodexAccountForThreadDetailed - active가 plan_excluded면 null. 예전 "stranded 방지" UX가 사라지므로 릴리스 노트에 행동 변경을 적어야 함
경로/심볼 - 명시 라우트 우회 테스트(codex-auth-context) - pause/reauth는 유지. entitlement 다른 갈래도 같은지 스모크
경로/심볼 - GUI selectionExcludedPlan - 계정에 표시된 plan과 정책에 매칭된 plan이 다를 수 있음(테스트가 free 정책 plan을 보존). 라벨 문구가 운영자에게 충분한지
경로/심볼 - CLI not-auto-selected(plan=...) - 머신 JSON은 unrecognized reason을 버림. 앞으로 reason이 늘면 화이트리스트 확장 필요
경로/심볼 - structure/docs 다국어 +2 노이즈 - 기능과 무관하면 줄이면 충돌 감소

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

  • fail-closed(자동 선택 거절)로 제품 기본을 확정할지, 아니면 last-account soft serve를 옵션으로 남길지
  • #4369보다 먼저 랜딩해 accounts 정책 기반을 고정할지
  • 제외된 계정만 있을 때 GUI/CLI 에러 카피가 충분히 친절한지

너의 추천
정책 완료 PR로 보이므로 tip CI 확인 후 dev 랜딩을 추천한다. #4369와 동시에 손대면 routing 충돌이 나기 쉬우니 exclusion을 먼저 넣고 reset-first를 rebase한다. 동일 테마 중복이면 이 PR을 남기고 나머지는 close.

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

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • UI screenshot required.

What to do

  • Add a screenshot of the UI change to the PR description.

This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant