Skip to content

fix(codex): stop rotating accounts inside an organization-scoped quota refusal (#4546) - #4764

Merged
lidge-jun merged 6 commits into
devfrom
codex/cx1-upstream-spend-limit-classification
Sep 16, 2026
Merged

lidge-jun merged 6 commits into
devfrom
codex/cx1-upstream-spend-limit-classification

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

A pre-stream HTTP 429 or 402 from the ChatGPT backend moved the request to another pool account on status alone. shouldRetryCodexPoolAccountQuota returned true for every 429 and 402 without reading the body, so the rotation could not tell apart a limit the account owns from a limit it merely belongs to.

That distinction is the whole bug. usage_limit_exceeded describes the account that was asked, and another pool account carries its own plan allowance, so moving is a real move. But credit_balance_exhausted, organization_spend_limit_exceeded, project_spend_limit_exceeded and organization_usage_limit_exceeded each name a balance or cap held by the organization or project the credential belongs to. Two credentials inside that organization are refused by the same counter. The move bought nothing and paid a second cold prompt prefix for it, which is exactly the amplification #4546 is about.

Before: upstream answers 429 {"error":{"code":"organization_spend_limit_exceeded"}}. The proxy selects a second account, rebuilds the full credential/transport/replay identity, replays the entire prompt, and is refused by the same organization counter.

After: the same response is classified scoped-quota-exhaustion and no second send is made. The original 429 is returned to the caller.

Two pieces:

  • src/codex/quota-rejection.ts gains the organization-scoped code set. classifyCodexPreStreamRejection reports a new scoped-quota-exhaustion kind with alternateRetryEligible: false and scopedExhaustionCode set. The new codexScopedExhaustionCode exposes just that answer for the rotation gate.
  • src/server/responses/core-codex-account.ts consults it at the one line that authorized the move (line 224).

Withholding the move does not withhold the accounting. This was the failure mode worth being careful about: skipping the retry path must not leave the exhausted account looking healthy. It does not. src/server/responses/passthrough-delivery.ts applies the response's quota headers to the serving account and records the 429 outcome on the ordinary delivery path, independently of whether the alternate retry ran, so the account still earns its cooldown and leaves the selection pool. Only the futile second send is gone.

These codes are deliberately not added to the reset-eligible set. A reset credit reconciles a ChatGPT plan window; it cannot pay an organization's bill, so resetCreditEligible stays false and no reset-credit path is reachable from them.

The classification fails closed. An empty, truncated, unparseable, duplicate-keyed or aborted body keeps the existing broad behaviour from #584, and a code/type pair that disagrees or a case or whitespace near-miss yields no code at all. Only positive evidence can withhold a rotation. rate_limit_exceeded, slow_down and plan-level exhaustion rotate exactly as before.

Why these four codes

openai/codex reached the same classification from the client side. openai/codex#44492 maps exactly these HTTP 429 codes to a terminal QuotaExceeded rather than a retry-limit failure, and openai/codex#45602 extends it to the SSE path while deliberately keeping rate_limit_exceeded and slow_down retryable. The OpenAI platform rate-limit documentation states the rule for the whole class:

It does not mean that quota, billing, or other errors that require user action can be resolved by retrying.

The organization and project scoping is documented in the same place:

Rate limits are defined at the organization level and at the project level, not user level.

This is the concrete case src/routing/identity-domains.ts was written to describe -- a quota refusal inside one domain must not be answered by rotating within it -- reached through the upstream error code rather than through the classifier, which no routing boundary calls yet.

Part of #4546.

Verification

Local verification was NOT run, by explicit instruction from the repository owner. No bun run test, no individual test file, no bun run typecheck, no bun install, no build. This push used --no-verify. The only evidence for this change is hosted CI at the exact head SHA of this branch, and a green run against any earlier commit is not evidence for the head that merges.

What was done instead:

  • Static source reading of the full call path, to confirm the change reaches the real decision point. The rotation is gated by shouldRetryCodexPoolAccountQuota at src/server/responses/passthrough-dispatch.ts:1250, not by classifyCodexPreStreamRejection, which production calls only for a 403 denial. Both are updated so the classification and the gate agree.
  • Static confirmation that the cooldown survives, by reading src/server/responses/passthrough-delivery.ts:218-260: applyAccountQuotaFromUpstreamHeaders and recordCodexUpstreamOutcome both run on the delivery path for the serving account regardless of the retry decision.
  • Structure gate read by hand: structure/providers/openai-tiers.md is 580 lines and structure/transports/responses.md is graced in manifest.json, so neither trips the 600-line budget rule in scripts/structure-ssot.ts; both backtick-quoted repository paths added exist in the index.

New coverage in tests/codex-integration/codex-quota-rejection.test.ts, an existing file, so no test-layout registration changes. It pins both directions, because the suppression is worth nothing if the ordinary rate limit stops failing over: each of the four codes classifies terminal and withholds the send; rate_limit_exceeded, slow_down, usage_limit_exceeded and insufficient_quota still rotate; and six fail-closed shapes (empty, unparseable, duplicate-keyed, disagreeing code/type, uppercase and padded near-misses) plus an aborted read all still rotate.

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

    • Added clearer handling for organization- and project-level quota exhaustion, preventing unsuitable alternate-account retries.
    • Requests containing uploaded files now receive guidance to re-upload them or start a new conversation when account changes would affect access.
  • Bug Fixes

    • Preserved original upstream quota responses when uploaded files prevent safe cross-account retrying.
    • Improved fail-closed behavior for ambiguous quota responses.
  • Documentation

    • Clarified OpenAI cache-domain and quota-handling guidance.

…a refusal (#4546) [skip ci]

A pre-stream HTTP 429 or 402 moved the request to another pool account on status
alone. That is right for a limit the account owns and wrong for one it merely
belongs to. "credit_balance_exhausted", "organization_spend_limit_exceeded",
"project_spend_limit_exceeded" and "organization_usage_limit_exceeded" all name a
balance or cap held by the organization or project, so the second credential meets
the same counter. The move bought nothing and paid a second cold prompt prefix for
it, which is the send amplification this unit exists to stop.

classifyCodexPreStreamRejection now reports a "scoped-quota-exhaustion" kind with
alternateRetryEligible false and scopedExhaustionCode set, and
shouldRetryCodexPoolAccountQuota consults that evidence before authorizing the move.
Withholding the move does not withhold the accounting: passthrough-delivery.ts
applies the response's quota headers to the serving account and records the 429 on
the ordinary delivery path, so the account still earns its cooldown and leaves the
selection pool. Only the futile second send is gone.

These codes are deliberately absent from the reset-eligible set. A reset credit
reconciles a ChatGPT plan window; it cannot pay an organization's bill.

The classification fails closed. An empty, truncated, unparseable, duplicate-keyed
or aborted body keeps the existing broad behaviour from #584, and a code/type pair
that disagrees or a case or whitespace near-miss yields no code at all, so only
positive evidence can ever withhold a rotation. "rate_limit_exceeded", "slow_down"
and plan-level exhaustion still rotate exactly as before, and the regression test
pins both directions.

openai/codex reached the same classification from the client side: #44492 maps
exactly these HTTP 429 codes to a terminal QuotaExceeded rather than a retry-limit
failure, and #45602 extends it to the SSE path while keeping "rate_limit_exceeded"
and "slow_down" retryable. The OpenAI platform rate-limit documentation states the
rule for the whole class: "It does not mean that quota, billing, or other errors
that require user action can be resolved by retrying."

The two exhaustion classifications now share one parser rather than keeping a second
hand-written copy of the strictness that makes a near-miss safe.
The cache rule's conclusion is right and its source was not. The comment claimed
OpenAI "documents that changing keys inside one organization does not guarantee a
hit", and the prompt-caching guide contains no such sentence: the phrase "API key"
appears on that page zero times, so it never addresses two keys in one organization
in either direction.

What the page does say is the separating half, verbatim: "Caches are not shared
across organizations and cannot be reused across regional processing boundaries."
The nearest statement about keys is "Keys influence routing; they do not pin
requests to a machine or guarantee a cache hit."

The classification is unchanged. A different org or region still relates distinct, an
identical one still relates unknown, and evidence stays "separates". Only the reason
moves: same org and region is unknown because the provider never promised the hit,
not because the provider denied it. A reader who went looking for the denial this
comment described would not have found it, and would have had to guess whether the
code or the comment was wrong.

The OpenAI quota rule gains its verbatim source in the same pass -- "Rate limits are
defined at the organization level and at the project level, not user level" -- which
is what "separates-and-shares" rests on. structure/catalog.md carried the same
mis-citation and is corrected to match.

Sources read from the signed-in platform documentation on 2026-09-16.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 16, 2026 02:28
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4cfcc609-1c2e-4a3b-86f6-dbe2d36f346b

📥 Commits

Reviewing files that changed from the base of the PR and between 3070d64 and 8b504f9.

📒 Files selected for processing (11)
  • src/codex/quota-rejection.ts
  • src/routing/identity-domains.ts
  • src/server/responses/account-change-state.ts
  • src/server/responses/compact.ts
  • src/server/responses/core-codex-account.ts
  • src/server/responses/request-prepare.ts
  • structure/catalog.md
  • structure/providers/openai-tiers.md
  • structure/transports/responses.md
  • tests/codex-integration/codex-quota-rejection.test.ts
  • tests/responses/responses-account-change-scrub.test.ts

📝 Walkthrough

Walkthrough

The pull request adds scoped Codex quota classification, fail-closed quota rotation checks, and uploaded-file account-change refusals. It also updates OpenAI identity-domain documentation and adds tests for quota parsing, account routing, and file-reference handling.

Changes

Codex quota classification

Layer / File(s) Summary
Quota contract and shared parser
src/codex/quota-rejection.ts
Adds scoped exhaustion codes, rejection metadata, shared strict parsing, and the exported codexScopedExhaustionCode helper.
Quota classification and pool rotation
src/codex/quota-rejection.ts, src/server/responses/core-codex-account.ts, tests/codex-integration/codex-quota-rejection.test.ts, structure/providers/openai-tiers.md, structure/transports/responses.md
Classifies organization- and project-scoped exhaustion as scoped-quota-exhaustion and prevents account rotation for positively identified scoped responses. Ambiguous responses retain broad rotation behavior. Tests cover retryable codes and fail-closed parsing.

Uploaded-file account safety

Layer / File(s) Summary
Uploaded-file detection and refusal
src/server/responses/account-change-state.ts, src/server/responses/request-prepare.ts, tests/responses/responses-account-change-scrub.test.ts
Detects uploaded-file references and returns an HTTP 400 refusal before account-change scrubbing when the serving account changes.
Uploaded-file retry routing
src/server/responses/compact.ts, src/server/responses/core-codex-account.ts, tests/responses/responses-account-change-scrub.test.ts, structure/transports/responses.md
Preserves the original rejection instead of resolving an alternate account when uploaded files are present. Same-account retries remain unchanged.

Identity-domain documentation

Layer / File(s) Summary
Identity-domain contract wording
src/routing/identity-domains.ts, structure/catalog.md
Revises OpenAI cache-sharing and routing documentation without changing runtime behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

Scoped quota handling

sequenceDiagram
  participant Upstream
  participant QuotaClassifier
  participant RotationGate
  participant CodexPool
  Upstream->>QuotaClassifier: Return HTTP 429 or 402 response
  QuotaClassifier->>QuotaClassifier: Parse scoped exhaustion code
  QuotaClassifier-->>Upstream: Return terminal scoped-quota-exhaustion
  Upstream->>RotationGate: Evaluate pool account rotation
  RotationGate-->>CodexPool: Suppress rotation for scoped exhaustion
Loading

Uploaded-file account changes

sequenceDiagram
  participant Request
  participant RequestPreparation
  participant FileReferenceCheck
  participant AlternateAccount
  Request->>RequestPreparation: Submit request with uploaded-file references
  RequestPreparation->>FileReferenceCheck: Check account change and file references
  FileReferenceCheck-->>RequestPreparation: Return HTTP 400 refusal when accounts differ
  RequestPreparation-->>Request: Stop before dispatch
  Request->>AlternateAccount: Avoid alternate-account retry when files are present
Loading

Suggested reviewers: luvs01

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cx1-upstream-spend-limit-classification

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 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-16T02:31:54.588927Z 02b9391 PR opened
ℹ️ 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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 76 / 80

이 PR은 이슈 #4546의 한 조각을 고칩니다. 여러 Codex 계정이 풀에 있을 때, 업스트림이 조직(또는 프로젝트) 한도에 걸려 429/402를 주면, 지금 dev는 그 답을 상태 코드만 보고 다른 계정으로 다시 보냅니다. 현재 체크아웃 HEAD는 3070d64d8822c6d8c62989665f82ab665e4d164c (패키지 2.57.0)이고, src/server/responses/core-codex-account.ts의 shouldRetryCodexPoolAccountQuota 224행은 response.status === 402 || response.status === 429이면 무조건 true입니다. 계정 소유의 한도(usage_limit_exceeded, insufficient_quota)라면 다른 계정으로 옮기는 게 맞습니다. 그러나 credit_balance_exhausted, organization_spend_limit_exceeded, project_spend_limit_exceeded, organization_usage_limit_exceeded는 자격 증명이 속한 조직/프로젝트 카운터입니다. 같은 조직 안의 두 번째 계정도 같은 거절을 만나고, 프록시만 두 번째 콜드 프롬프트 비용을 냅니다. 그게 #4546이 말하는 전송 증폭입니다.

고치는 축은 두 곳입니다. (1) src/codex/quota-rejection.ts에 조직 범위 코드 집합 SCOPED_EXHAUSTION_CODE_VALUES를 두고, classifyCodexPreStreamRejection이 새 kind scoped-quota-exhaustion을 보고합니다. 이때 alternateRetryEligible: false, scopedExhaustionCode 설정, resetCreditEligible는 거짓입니다. 리셋 크레딧은 ChatGPT 플랜 창을 맞추는 도구이지 조직 청구서를 못 내기 때문입니다. 리셋 가능 코드와 조직 범위 코드는 서로소이고, 파서는 하나로 합쳐 code/type 불일치·중복 키·대소문자/공백 근사치는 코드를 읽지 않습니다. 게이트용으로 codexScopedExhaustionCode도 노출합니다. (2) shouldRetryCodexPoolAccountQuota는 429/402에서 그 헬퍼를 보고, 조직 범위 증거가 있을 때만 로테이션을 막습니다. 실패 닫힘(fail closed)이라 빈 본문·깨진 JSON·중단된 읽기는 예전 #584 넓게 회전 동작을 유지하고, rate_limit_exceeded / slow_down / 플랜 소진은 그대로 돕니다.

로테이션을 막아도 회계는 남깁니다. 실제 회전 호출은 src/server/responses/passthrough-dispatch.ts 약 1250행 근처의 shouldRetryCodexPoolAccountQuota이고, 배달 경로 passthrough-delivery.ts는 재시도 여부와 별개로 applyAccountQuotaFromUpstreamHeaders와 recordCodexUpstreamOutcome를 서빙 계정에 적용합니다. 그래서 거절당한 계정은 쿨다운을 받고 선택 풀에서 빠지며, 없어진 것은 헛된 두 번째 전송뿐입니다. 문서도 structure/providers/openai-tiers.md와 structure/transports/responses.md에 같은 경계를 적었습니다. openai/codex #44492·#45602와 플랫폼 문서(“quota/billing은 재시도로 안 풀린다”)와도 맞춰 둔 분류입니다. 테스트는 tests/codex-integration/codex-quota-rejection.test.ts에 양방향(네 코드는 막고, rate_limit/slow_down/플랜 코드는 돌리고, 여섯 fail-closed 형태+abort는 돌림)을 고정합니다.

현재 dev 대비 방향은 맞고, types.ts/config.ts 스플릿에 무효화되는 편집도 아닙니다. 베이스는 dev 직접이라 부모 스택 리타겟이 필요 없습니다. 다만 tip 커밋 메시지에 [skip ci]가 있고, 로컬 테스트/타입체크는 레인 규칙상 안 돌렸다고 본문에 적혀 있습니다. mergeable은 MERGEABLE이지만 mergeStateStatus는 BLOCKED이며, 이 시각(KST) hygiene / resolve-pr / label은 아직 QUEUED이고 CodeRabbit만 SUCCESS입니다. 자식 #4765(codex/cx2-identity-domain-doc-source)가 이 브랜치 위에 스택되어 있으니, 이 PR을 먼저 안착시키는 게 문서 후속과 맞습니다. #4546 에픽 자체는 여전히 OPEN이라 이 PR만으로 에픽이 닫히지는 않습니다.

라인 ~224 (core-codex-account.ts shouldRetryCodexPoolAccountQuota) - 지금 dev는 402/429면 무조건 true입니다. PR은 조직 범위 코드일 때만 false로 바꿉니다. 본문 증거가 없으면 예전처럼 true라 #584 회귀를 막습니다.
경로 codexScopedExhaustionCode / exhaustionCodeFromResponse - 리셋 가능·조직 범위 분류가 한 파서를 공유하고, 응답은 clone으로 읽어 본문 소모를 피합니다. 근사치·중복 키는 코드를 안 읽어 fail closed입니다.
경로 tip [skip ci] - 헤드 SHA에 대한 호스티드 CI 증거가 약해질 수 있습니다. 머지 전에는 hygiene/테스트 롤업이 이 tip(또는 skip 없는 follow-up)에서 그린인지 확인이 필요합니다.
경로 스택 #4765 - 이 PR(codex/cx1-upstream-spend-limit-classification) 위에 docs 후속이 올라와 있습니다. 이 수정이 먼저 dev에 가야 자식이 따라옵니다.
경로 #4546 - 에픽은 열려 있고 send-budget/workflow-budget/quota/rotation 작업이 이어집니다. 이 PR은 조직 범위 거절에서 헛회전만 끊는 단위이며, 에픽 closes가 아닙니다.

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

너의 추천
열어 두고 베이스 dev에서 hygiene/관련 CI가 이 tip(또는 skip 없는 후속)에서 그린인지 확인한 뒤 머지하세요. 조직 범위 코드를 리셋 가능 집합에 넣거나, fail-closed를 풀어 애매한 본문에서 회전을 막게 만들지 마세요. 자식 #4765는 이 PR 안착 후 이어서 처리하면 됩니다. types/config 스플릿 close-dont-rebase 대상 아닙니다. Part of #4546 (에픽 closes 아님).

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02b939127b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +232 to +233
const { codexScopedExhaustionCode } = await import("../../codex/quota-rejection");
return await codexScopedExhaustionCode(response, { signal }) === undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep retries across distinct quota domains

When a pool contains credentials from different organizations or projects, this code only proves that the current credential's quota domain is exhausted, yet it returns false before resolveCodexAuthContext can select an alternate. The retry resolver currently excludes only the failed account (core-codex-account.ts:523-536), so a healthy credential belonging to a different organization is now stranded and the caller receives the original 429/402. This also contradicts the distinct/unknown quota-domain handling documented in src/routing/identity-domains.ts:99-104; suppress the retry only when the candidate is proven to share the exhausted domain, or make alternate selection domain-aware.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the bug Something isn't working label Sep 16, 2026
…4710) [skip ci]

The classifier has always called an uploaded file_id account-bound, and the
scrubber has always removed only previous_response_id and conversation. A body
whose only account-bound state was a file reference therefore reported nothing
scrubbed and was replayed unchanged against the new account, which is exactly
the case the advertised safety fix was supposed to cover.

Deleting the references is not the fix. A file reference is content the caller
attached, not continuation state the turn can do without, and dropping it
silently answers a different question than the one that was asked with no way
for the caller to tell. Pinning the request to the issuing account is not
available either: every call site resolves and materialises its credential
before reaching here, and the retry sites are reached precisely because the
issuing account just refused the request.

So the move is refused before dispatch, with HTTP 400 and an instruction to
re-upload. Not a retryable status, which would invite the same request back
unchanged.

The check reads the carriers directly rather than the portability verdict. That
verdict reports the FIRST reason it finds, so a body carrying both a previous
response id and a file reference reports only the response id, and the file
would slip through the scrub that follows.

Wired at the initial Codex selection and at the native compact dispatch, both of
which can answer with a Response. The two alternate-account retry sites still
only scrub: refusing there needs a new outcome variant on their result types and
on their callers, which is a larger change than this one. The detection now
lives in one exported place, so neither site can drift further from it.

Closes #4710
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

…t paths too (#4710)

The carried change refuses an uploaded-file move at the two sites that can answer
with a status, and leaves the two alternate-account retry sites scrubbing only. This
closes those two, and it does not need the new result variant the deferral assumed.

A retry site does not have to raise a status, because an earlier response already
exists and is what the caller returns. It only has to decline the move. And the
question it declines on does not depend on which alternate would be chosen -- an
uploaded file is readable only by the account that received it -- so it can be asked
from the body alone, before an alternate is resolved. conversationCarriesUploadedFiles
is that predicate. Asking there reserves no send, cancels no response, and leaves the
first account's rejection intact for the caller, which is the guarantee the comment
above the compact resolution already depended on.

Refusal still beats a previous_response_id at both sites, for the same reason the
carried change reads the carriers directly instead of the portability verdict: the
verdict reports only the first denial it finds.

Two corrections to the carried code. collectConversationStateCarriers(body).fileIds is
optional on the carrier type and was dereferenced directly, which does not survive a
strict typecheck; the emptiness test now lives in one exported place so no caller can
get it wrong again. And the refusal message named the cause but not the consequence.
The reference stays in the conversation's history, so once rotation has moved a
conversation carrying an attachment, every later turn is refused the same way. A caller
told only that the reference is invalid resends unchanged and watches the conversation
die. The message now says what happened, that it will keep happening, and the two
things that end it: re-upload under the serving account, or start a new conversation.

A same-account replay is unaffected, and a single-account install never reaches any of
this, because serving and issuing accounts cannot differ without pool rotation.

Pinning a file-carrying conversation to its issuing account is the real answer and is
routing-affinity work; filed as #4778.

Co-authored-by: JUN <[email protected]>
…-scope

fix(responses): refuse an account change that would orphan an uploaded file (#4710)
…-source

docs(routing): cite what the prompt-caching guide actually says (#4546)
@lidge-jun

Copy link
Copy Markdown
Owner Author

Landing the lane into dev. This is the bottom layer of a chained-child stack, so #4777 and #4765 cascaded downward into this branch and it now carries all three layers.

CI evidence transfers by tree identity. The verified head 3ae8ca7 has tree 20d3e2ad8acd9e893dd2eb08c512d30e92b3fa6b; this branch head 8b504f9 has the same tree. At that tree the heavy jobs actually executed rather than being path-filtered: test 1-4/4 and macos 1-2/2 all completed with conclusion success, confirmed through the check-runs API rather than the check rollup, alongside gates, hygiene, api usage, storage policy, docker smoke, keyring on three platforms, npm-global and react-doctor. The windows shards are workflow_dispatch-only and always skipped on pull_request; this lane carries no Windows-specific change.

Maintainer integration decision under MAINTAINERS.md / AGENTS.md: a maintainer with maintain or admin access may integrate into dev without a second maintainer approval, recording the decision and exact-head CI evidence.

What lands: upstream 429 organization and project spend-limit codes are reclassified as terminal quota exhaustion so the pool stops rotating between accounts that share the same limit; the identity-domain comment now quotes the sentence its cited page actually contains; and an account change that would carry an uploaded file reference to an account which cannot read it is refused before dispatch, without ever deleting the reference.

@lidge-jun
lidge-jun merged commit 9fc7e9b into dev Sep 16, 2026
4 of 6 checks passed
@lidge-jun
lidge-jun deleted the codex/cx1-upstream-spend-limit-classification branch September 16, 2026 03:24
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…pend-limit-classification

fix(codex): stop rotating accounts inside an organization-scoped quota refusal (lidge-jun#4546)
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