Repository navigation
feat(codex): add review model quota support - #836
Merged
Merged
Conversation
|
also can you add filter layer to codex responses endpoint ( {"detail":"Unsupported parameter: max_output_tokens"} etc.) i realized codex with responses api uses less token, or reasoning.summary: "auto" by reasoning models |
hiepau1231
force-pushed
the
fix/codex-review-models-quota
branch
from
May 1, 2026 10:54
b3c5cc4 to
da4f460
Compare
Contributor
Author
|
Updated the PR for this feedback. Changes added:
Verification after the update:
|
|
Also Closes #812 |
brilliant5163
pushed a commit
to brilliant5163/9router
that referenced
this pull request
May 8, 2026
caothu159
pushed a commit
to diepxuan/9router
that referenced
this pull request
May 14, 2026
5 tasks done
diegosouzapw
pushed a commit
to diegosouzapw/OmniRoute
that referenced
this pull request
Jun 21, 2026
…e_limits fallback The Codex usage dashboard only emitted the primary `code_review_rate_limit` window as `quotas.code_review` and dropped review descriptors that arrive via the `additional_rate_limits` array (the shape some ChatGPT Codex plans report). `buildCodexUsageQuotas` now: - Emits the secondary window as `quotas.code_review_weekly` (mirrors the existing `session`/`weekly` pair for the normal rate limit). - Falls back to the matching `additional_rate_limits[]` entry when the dedicated `code_review_rate_limit` block is empty — matched on `limit_name`, `metered_feature`, `limit_id`, `id`, or `name` containing `code_review`, `codex_review`, or `review`. The dedicated block stays preferred when both are present. The existing `quotas.code_review` key is preserved (back-compat for the dashboard rendering and the `usage-service-hardening` regression test). The new `code_review_weekly → "Code Review Weekly"` label is registered in `ProviderLimits/utils.tsx` so the card renders both windows side-by-side. TDD: 4 new assertions in `tests/unit/codex-usage-quotas-review-window.test.ts` (secondary-window surfacing, `additional_rate_limits` fallback, silent-payload back-compat, dedicated-block preference) + 1 label assertion appended to `tests/unit/provider-limits-ui.test.ts`. All 46 codex-usage-related tests pass. What we did NOT port from upstream: - The virtual `<model>-review` chat-model variants — OmniRoute already exposes `codex-auto-review` as a dedicated native review model (`CODEX_NATIVE_UNPREFIXED_MODELS`), so per-model `-review` aliases would duplicate that surface. - The `idToken` removal — OmniRoute actively parses the `id_token` JWT to extract the workspace id used for `chatgpt-account-id` binding on the usage endpoint (`src/lib/oauth/providers/codex.ts::parseIdToken`); removing it would break workspace selection. - The `max_completion_tokens` / `max_output_tokens` stripping — the Codex executor already enforces an allowlist (`RESPONSES_API_ALLOWLIST`) that rejects unknown chat-completions fields before they reach upstream. Inspired-by: decolua/9router#836 (review-quota plumbing pattern) Co-authored-by: Rezky Hamid <hiepau1231@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #830
Verification
node --check open-sse/config/providerModels.js open-sse/executors/codex.js open-sse/services/usage.js src/app/api/providers/[id]/models/route.js src/lib/oauth/providers.js src/lib/oauth/services/codex.js src/lib/localDb.jsnpx eslint open-sse/config/providerModels.js open-sse/executors/codex.js open-sse/services/usage.js src/app/api/providers/[id]/models/route.js src/lib/oauth/providers.js src/lib/oauth/services/codex.js src/lib/localDb.js src/shared/constants/models.jsgpt-5.3-codex-high-reviewis exposed as a review model, maps togpt-5.3-codex-high, and uses quota familyreview.Build note
npm run buildcurrently fails on this Windows environment because the script uses POSIXNODE_ENV=productionsyntax.EPERM: operation not permitted, scandir 'C:\Users\hiep\Application Data', which appears environment/file-tracing related rather than caused by this change.