Skip to content

fix: recognize Codex Team plans in pool capacity - #1443

Merged
Wibias merged 2 commits into
lidge-jun:devfrom
terrytan95:agent/fix-team-capacity-weight
Aug 11, 2026
Merged

fix: recognize Codex Team plans in pool capacity#1443
Wibias merged 2 commits into
lidge-jun:devfrom
terrytan95:agent/fix-team-capacity-weight

Conversation

@terrytan95

@terrytan95 terrytan95 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat the upstream team plan identifier as the Business-tier configured capacity weight.
  • Keep unrecognized future plan identifiers excluded from pool estimates.
  • Add a focused regression covering mixed Team and Business capacity aggregation.

Closes #1442

Verification

  • bun test tests/provider-capacity.test.ts — 14 passed, 0 failed.
  • PATH=/Users/terrytan/.nvm/versions/node/v24.3.0/bin:$PATH bun run typecheck — passed.
  • bun run privacy:scan — passed.
  • PATH=/Users/terrytan/.nvm/versions/node/v24.3.0/bin:$PATH bun run test — 10,813 passed, 7 skipped, 0 failed.
  • git diff --check — passed.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. Existing unknown-plan documentation remains accurate; no documentation change is needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

  • 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.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for Team plan accounts in capacity weighting.
    • Team and Business plans now use the same configured capacity weighting.
  • Bug Fixes

    • Improved handling of unsupported or future plan types during capacity aggregation.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 85dd6b3c-c156-4f1a-afa1-4f955a67c33c

📥 Commits

Reviewing files that changed from the base of the PR and between 21b40ee and b088583.

📒 Files selected for processing (1)
  • tests/provider-capacity.test.ts

📝 Walkthrough

Walkthrough

The Codex capacity estimator now assigns configured weight 1 to team accounts. Tests verify Team and Business aggregation, all-Team coverage, and continued exclusion of unknown future-plan accounts.

Changes

Codex capacity aggregation

Layer / File(s) Summary
Add team capacity weight
src/providers/codex-capacity.ts
CODEX_CONFIGURED_CAPACITY_WEIGHTS now includes team: 1 at line 5.
Update capacity regression coverage
tests/provider-capacity.test.ts
Tests verify Team and Business weighting, all-Team aggregation, unknown-plan exclusion, quota fallback, and complete coverage assertions. Unknown-plan fixtures now use future-plan at lines 97, 140, and 240.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: recognizing Codex Team plans in pool capacity estimation.
Linked Issues check ✅ Passed The changes add team capacity weighting and regression coverage while preserving exclusion of unknown future plans, matching issue #1442.
Out of Scope Changes check ✅ Passed The source and test changes remain limited to display-only Codex pool capacity estimation and related regression coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ 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.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently. If no CodeRabbit review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

@terrytan95
terrytan95 marked this pull request as ready for review August 11, 2026 01:50
@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 01:51
@terrytan95 terrytan95 changed the title fix: recognize Team plans in pool capacity fix: recognize Codex Team plans in pool capacity Aug 11, 2026
@terrytan95
terrytan95 marked this pull request as ready for review August 11, 2026 01:51
@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 01:51
@Wibias
Wibias marked this pull request as ready for review August 11, 2026 04:11
@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 04:12
terrytan95 and others added 2 commits August 11, 2026 06:17
Treat upstream plan 'team' as the Business-tier configured weight so valid Codex pools are not excluded from dashboard capacity estimates.
@Wibias
Wibias force-pushed the agent/fix-team-capacity-weight branch from 21b40ee to b088583 Compare August 11, 2026 04:44
@Wibias
Wibias marked this pull request as ready for review August 11, 2026 04:45
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@github-actions[bot] have exceeded the limit for the number of chat messages per hour. Please wait 14 minutes and 16 seconds before sending another message.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@github-actions[bot] have exceeded the limit for the number of chat messages per hour. Please wait 13 minutes and 15 seconds before sending another message.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@github-actions[bot] have exceeded the limit for the number of chat messages per hour. Please wait 12 minutes and 31 seconds before sending another message.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@github-actions[bot] have exceeded the limit for the number of chat messages per hour. Please wait 12 minutes and 17 seconds before sending another message.

@Wibias

Wibias commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Thanks @terrytan95 — this was useful because Codex still reports some accounts as plan team, and without mapping that to the Business-tier weight those pools were silently dropped from capacity estimates. The focused regression (including mixed Team/Business aggregation) locks the behavior so future plan-identifier churn does not reintroduce the undercount.

Merging now.

@Wibias
Wibias merged commit 593d8c2 into lidge-jun:dev Aug 11, 2026
35 of 38 checks passed
@terrytan95
terrytan95 deleted the agent/fix-team-capacity-weight branch August 12, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants