Skip to content

fix(server): omit native quota for custom Codex providers - #10877

Open
kalvenschraut wants to merge 1 commit into
pingdotgg:mainfrom
RTVision:fix/codex-proxy-quota-reporting
Open

fix(server): omit native quota for custom Codex providers#10877
kalvenschraut wants to merge 1 commit into
pingdotgg:mainfrom
RTVision:fix/codex-proxy-quota-reporting

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 9, 2026

Copy link
Copy Markdown

What changed

A custom Codex provider can expose rate-limit data that does not describe the account serving requests through its proxy. T3 currently presents that data as native subscription quota.

Mark native usage limits unsupported when requiresOpenaiAuth is false, using the existing API-key exclusion path. Configured hub usage remains available. In Codex, this flag describes the selected provider's authentication requirements, as shown in its account-state implementation.

UI

Synthetic browser fixtures generated from baseline and patched provider checks. Before, an unrelated 10% native row appears beside the hub's 80% quota. After, only the hub quota remains.

Before After
Before After

Verification

  • 51 provider-registry tests passed, including null and ChatGPT account snapshots with requiresOpenaiAuth: false; both report unsupported usage with no windows.
  • Server package typecheck and changed-file lint passed.
  • The server report applies to all clients and connection modes. Other providers are unchanged. Browser evidence uses synthetic fixtures; no live proxy/OAuth or mobile end-to-end test was run.
  • Fable approved the one-line condition change and regression coverage.

Implemented with GPT-6 in Codex; reviewed with claude-fable-5-1 through Claude Code.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Codex provider status detection for accounts that do not use OpenAI authentication.
    • Proxy-based rate-limit information is no longer incorrectly interpreted as native subscription usage limits.
    • Unsupported usage-limit scenarios now report a clear unsupported status instead of displaying misleading rate-limit data.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 9, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 516b261

Macroscope's review found this PR approvable — This is a small, self-contained server bug fix that prevents proxy-provided rate limits from being displayed as native Codex subscription quota. Existing native-provider behavior is preserved, and regression tests cover the custom-provider cases.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6361ce3b-35e7-40ae-a110-656bf4e96bf9

📥 Commits

Reviewing files that changed from the base of the PR and between 08463e2 and 516b261.

📒 Files selected for processing (2)
  • apps/server/src/provider/Layers/CodexProvider.ts
  • apps/server/src/provider/Layers/ProviderRegistry.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Codex provider now reports unsupported usage limits when OpenAI authentication is not required. Tests cover null and ChatGPT accounts with proxy rate-limit data.

Changes

Codex usage-limit handling

Layer / File(s) Summary
Unsupported usage-limit fallback and validation
apps/server/src/provider/Layers/CodexProvider.ts, apps/server/src/provider/Layers/ProviderRegistry.test.ts
The fallback now checks requiresOpenaiAuth. Tests verify unsupported results and empty usage windows for unauthenticated account states.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 516b2

Custom Codex providers that do not require OpenAI authentication now omit potentially misleading native subscription quota windows while retaining configured hub usage. The intended behavior is covered by focused server tests, with no concrete merge-blocking risk identified.

Suggested reviewers: juliusmarminge, t3dotgg, maria-rcks

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: omitting native quota reporting for custom Codex providers.
Description check ✅ Passed The description explains what changed, why it changed, the UI effect, and verification results. It omits the template Checklist section and uses “UI” instead of “UI Changes,” but the required informat…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant