Skip to content

fix(cli): report inert generic pool thresholds truthfully - #3797

Merged
lidge-jun merged 2 commits into
devfrom
codex/t4-01-pool-status-81a8
Sep 6, 2026
Merged

fix(cli): report inert generic pool thresholds truthfully#3797
lidge-jun merged 2 commits into
devfrom
codex/t4-01-pool-status-81a8

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

Manual review chain (bottom-up): #3797#3798#3799#3800#3801

  • Local test suites, typecheck and builds were not run, per maintainer instruction. Source audits and git diff --check were performed.

  • Final combined Cross-platform CI (lane=all) passed all 25 jobs on d1915c470bdcc95bbb3f7c716152ed013622634f. Lower test runs are deferred per the maintainer-directed combined-evidence strategy; skipped/cancelled runs are not passing evidence.

  • Independent Astra high source/security reviews and actual Aside fixture rendering are recorded where applicable. All scoped source/security reviews passed. Repaired-source remote diagnostics passed; the final full cross-platform matrix passed all 25 jobs.

  • Maintainer integration policy: the owner explicitly authorized final-combined-CI-first validation and eventual bottom-up admin merge. Exact combined CI is green; fresh per-PR head/base/actor and maintainer-objection checks precede each admin merge. Repository auto-delete is enabled, so the next owned child is retargeted to dev immediately before its parent lands.

  • Exact-source diagnostic gates, d1915c470bdcc95bbb3f7c716152ed013622634f: lint, typecheck, 27 focused config/picker tests, 1,706 GUI tests, privacy scan, GUI build and 425-page documentation build all passed. No deployment.

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.

Summary by CodeRabbit

  • New Features

    • ocx account auto-switch now supports storing thresholds for generic OAuth pools in addition to the Codex pool.
    • Generic OAuth results report stored settings, including poolEnabled and whether the threshold is currently inactive.
    • Command output reflects server-confirmed values and distinguishes unset thresholds from configured zero thresholds.
  • Bug Fixes

    • Generic OAuth pools no longer appear to have active auto-switching when their thresholds are not applied.
    • Invalid values, API-key providers, and Anthropic providers are clearly rejected.
  • Documentation

    • Updated CLI reference documentation across supported languages with the expanded behavior and output formats.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: ba564610-db60-45da-a3e8-09a18aa7ed25

📥 Commits

Reviewing files that changed from the base of the PR and between 24c761a and c18afc9.

📒 Files selected for processing (10)
  • docs-site/src/content/docs/fr/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ja/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ko/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ru/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/tr/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/zh-cn/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/zh-tw/reference/cli/providers-accounts.md
  • src/cli/account-extended.ts
  • tests/cli/cli-account-pool-verbs.test.ts

📝 Walkthrough

Walkthrough

ocx account auto-switch now stores and reports generic OAuth pool thresholds. The CLI distinguishes stored values from active switching state, handles incomplete responses safely, and preserves existing Codex behavior. Tests and localized documentation cover the expanded output and semantics.

Changes

Generic OAuth auto-switch support

Layer / File(s) Summary
Generic OAuth command reporting
src/cli/account-extended.ts lines 370-410
The command reads settings from both status and update responses. It validates thresholds, reports poolEnabled and inert, always reports generic OAuth pools as disabled, and preserves the existing Codex output path.
CLI behavior validation
tests/cli/cli-account-pool-verbs.test.ts lines 352-428
Tests cover confirmed server values, poolEnabled states, malformed responses, null response bodies, inert thresholds, and the distinction between zero and unset thresholds.
Localized command documentation
docs-site/src/content/docs/*/reference/cli/providers-accounts.md
The documentation describes generic OAuth threshold storage, inert runtime behavior, output fields, server-confirmed values, and rejected provider types across nine locales.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/t4-01-pool-status-81a8

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 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 46 / 80

지금 dev HEAD(24c761a05, package 2.45.0)의 src/cli/account-extended.ts cmdAutoSwitch를 보면, 일반 OAuth 풀(genericPool)도 Codex 풀과 같은 JSON 모양 { provider, autoSwitchThreshold, enabled }로 나갑니다. enabledthreshold > 0이면 true라서, 서버가 아직 임계값 전환을 안 켜도 CLI는 “켜짐”처럼 말할 수 있습니다. 이 PR(DRAFT, Track4 81a8 스택 1/5, base=dev, head=codex/t4-01-pool-status-81a8)은 그 거짓말을 끊습니다. 일반 풀은 서버가 확인한 DTO만 보고, enabled는 항상 false, poolEnabled는 저장된 오버라이드(null=미지정), inert: true면 “저장은 됐지만 적용 안 됨”으로 읽습니다. 기능이 뭔지 모를 때도 enabled: true를 만들지 않습니다.

코드는 settings를 status/mutation 응답에서 받고, 일반 풀 분기에서 Codex 출력과 다른 계약을 씁니다. 사람용 문구도 auto-switch: on 대신 inactive/unavailable + stored threshold입니다. tests/cli/cli-account-pool-verbs.test.ts에 status/write/malformed/null body/0 vs unset 회귀가 붙었고, docs-site providers-accounts.md 8개 로케일도 같은 계약을 적습니다. 경로 src/cli/account-extended.ts, tests/cli/cli-account-pool-verbs.test.ts는 checkout에 있고, 이 층은 새 파일을 만들지 않습니다. 이슈 #3375의 CLI 조각이고, 계정 풀 에픽 본체·서버 임계값 활성화는 그대로 열려 있습니다. 현재 dev의 쿼ota reset 마커(#3607/#3662)나 로그 필터(#3508/#3712)와는 겹치지 않습니다.

src/cli/account-extended.ts 일반 풀 분기 - enabled를 하드코드 false로 둔다. 의도된 inert 계약이지만, 나중에 서버가 진짜 임계값 전환을 켜면 CLI도 같이 고쳐야 한다.
src/cli/account-extended.ts poolEnabled - 서버 settings.enabled를 그대로 옮긴다. 상속된 실효 상태가 아니라 저장값이라는 점을 docs와 JSON 필드 이름이 같이 말하는지 최종 확인이 필요하다.
src/cli/account-extended.ts malformed/null 응답 - {}로 떨어뜨려 inert: null, threshold null을 낸다. “모름”과 “inert”를 구분하는 건 좋지만, 운영자가 null body를 성공으로 오해하지 않게 문구가 충분한지 보면 좋다.
tests/cli/cli-account-pool-verbs.test.ts - inert: false이면서 threshold가 있어도 CLI는 여전히 enabled: false다. 이 CLI가 “현재 inert만 안다”는 주석과 맞다.
docs providers-accounts.md (en/ko 외) - openai vs generic OAuth 응답 모양이 분리됐다. API 키·Anthropic 거부는 기존과 같다.

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

너의 추천
DRAFT 유지. 스택 CI(특히 #3801에 모인 repaired-source 검증)가 초록이 되면 #3797#3798 → … 바닥부터 올려 머지. 범위는 CLI 출력 정직화로 작고, types/config 분할로 무효화될 작업이 아니다. 서버 임계값 활성화는 이 PR에 넣지 말고 #3375에 남겨 둔다.

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

@lidge-jun
lidge-jun marked this pull request as ready for review September 6, 2026 18:22
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 6, 2026 18:22
@lidge-jun
lidge-jun merged commit a92835d into dev Sep 6, 2026
32 of 50 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T18:24:24.886762Z c18afc9 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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