Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: luvs01/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
The scoped-quota re-export grew src/server/responses/core.ts past its committed 210-line cap (213). Collapse the two-name re-export back to one line; the file's export list already carries longer single-line statements. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…main - record the normalized 429/402 outcome before returning no-alternate on a suppressed same-workspace move, so a 5xx-wrapped quota refusal still cools the refused account instead of reading as transient - bind a request-owned `main` alternate by the caller credential's own workspace id (chatgpt-account-id header, else the bearer token's account claim) via callerCodexWorkspaceAccountId - apply the same scoped-quota workspace gate to the single bounded alternate send in the native /responses/compact path - cover all three in tests and update the transport doc Co-Authored-By: Epinephrine <luvs01@hanmail.net>
|
Fixed in 5267593. The suppression branch now runs Covered by a new regression test: a 502 carrying |
|
Fixed in 5267593. Covered by |
|
Fixed in 5267593. Coverage in |
…the size cap server-auth.test.ts grew to 4684 against a 4589 baseline cap, so the file-size ratchet failed shard 3/4. The three scoped-quota suppression cases move byte-for-byte into server-auth-scoped-quota.test.ts, and the pool-retry harness they share is extracted to tests/helpers/pool-retry-harness.ts (per-run OPENCODEX_HOME dir, so each importing file keeps its own module state under bun test --isolate). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The workspace classification in shouldRetryCodexScopedQuotaOnAlternate reads the first response body asynchronously, so a client disconnect can land after the earlier abort check but before the branch records the first account, cancels its body, and sends the alternate. Re-check the abort signal immediately after the await in both paths: compact returns the 499 client_cancelled response after releasing the alternate lease, and the regular path releases its permit and lease and returns no-alternate while still recording the first account's real outcome. Co-Authored-By: Epinephrine <luvs01@hanmail.net>
|
Fixed in c52b64b. Both paths now re-check the abort signal immediately after |
The 499 exits around the scoped-quota classification return a fresh response while the first rejection's body is still open; cancel it so the abandoned upstream connection and tee resources are released. Co-Authored-By: Epinephrine <luvs01@hanmail.net>
|
Fixed in 813efcc — |
upstream.body.cancel() can wait on a custom or stalled source; awaiting it at the abort checkpoints would park the 499 reply on cleanup. Fire it with the request's abort reason and swallow rejection, the same best-effort shape bufferCompactResponse already uses. Co-Authored-By: Epinephrine <luvs01@hanmail.net>
|
Fixed in 2d1ee69 — both checkpoints now fire |
…sses.test.ts) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Motivation
Description
shouldRetryCodexPoolAccountQuotareturntrueinitially for those statuses and deferring suppression to post-resolution logic in the retry path.shouldRetryCodexScopedQuotaOnAlternate(response, firstWorkspaceAccountId, alternateWorkspaceAccountId)to check scoped exhaustion evidence only after the alternate'schatgptAccountIdis known and to withhold rotation only when the alternate is proven to share the same workspace (organization-level cases), while keeping project-scoped exhaustion retryable.src/codex/quota-rejection.tssoscoped-quota-exhaustionremainsalternateRetryEligible: trueat pre-stream classification and let the rotation path perform the binding check once an alternate is resolved.tests/codex-integration/codex-quota-rejection.test.tsand update structure docs (structure/providers/openai-tiers.md,structure/transports/responses.md) to reflect the post-resolution scope check.Testing
./node_modules/.bin/bun test tests/codex-integration/codex-quota-rejection.test.tswhich passed (89 tests)../node_modules/.bin/bun run typecheck,./node_modules/.bin/bun run structure:check, and./node_modules/.bin/bun run privacy:scan, all of which completed successfully for the change set../node_modules/.bin/bun run test:changedwas not usable in this checkout (no resolvabledevcomparison ref), and a full./node_modules/.bin/bun run testwas stopped due to unrelated container/full-suite timeouts in other subsystems, while the focused tests validating this change remained green.Codex Task