-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(codex): apply a quota refusal's avoidance window to the main login #4396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+191
−6
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
devlog/_plan/260912_release_regression_train/025_sweep_results.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # wp3 — sweep results | ||
|
|
||
| Eight read-only lanes covered every non-merge commit in `e432cf565a..c27a4831a9`. Six | ||
| returned CLEAN, one returned MINOR, and one returned BLOCKING. Every finding below was | ||
| re-derived against source by a second reviewer before it was accepted. | ||
|
|
||
| | Lane | Scope | Verdict | | ||
| |---|---|---| | ||
| | 1 | codex routing, combo resolve, provider quota | BLOCKING | | ||
| | 2 | responses/chat/claude-messages/bridge/vision/search | CLEAN | | ||
| | 3 | Claude inbound cache prefix | CLEAN | | ||
| | 4 | Codex inject, restore, history | CLEAN | | ||
| | 5 | OAuth, adapters, Devin CLI credentials | CLEAN | | ||
| | 6 | remote-control, update job | CLEAN | | ||
| | 7 | integrations, client export, CLI | MINOR | | ||
| | 8 | GUI catalog, Combo, Cline dialog | CLEAN | | ||
|
|
||
| ## Release-blocking: the quota-avoid window skips the main account | ||
|
|
||
| #4368 (`d42a1363dc`) split a quota refusal into two durations. The cooldown still caps at | ||
| fifteen minutes, and a new `quotaAvoidUntil` records the window the refusal actually | ||
| announced, bounded at six hours. Pool candidates honour it at | ||
| `src/codex/routing.ts:1409`. The main account does not. | ||
|
|
||
| `isSelectableCodexPoolAccount` rejects `__main__`, so the main login reaches the | ||
| candidate list only through the re-insertion block at `src/codex/routing.ts:1414`, and | ||
| that block checks `isCodexAccountSoftAvoided` but never `isCodexQuotaAvoided`. | ||
| `getCodexQuotaHealthSnapshot` reads `cooldownUntil` alone, so once the fifteen-minute | ||
| cooldown lapses the main account is a first-class candidate again while its announced | ||
| window still has hours left. | ||
|
|
||
| A user with the main login plus a pool sees exactly the failure #4368 was written to | ||
| stop: pool accounts stay avoided for up to six hours, the main account returns after | ||
| fifteen minutes, and the quota strategy ranks it coolest because it ranks on a weekly bar | ||
| a burst limit never touches. A bound thread drops its affinity and is re-pinned to the | ||
| same exhausted account. With no pool the symptom is unchanged, because the last-resort | ||
| branch would hand back the only account anyway. | ||
|
|
||
| ## Same commit, same omission, two more paths | ||
|
|
||
| The commit states that "an operator clearing the cooldown or naming the account overrules | ||
| it". Neither does. | ||
|
|
||
| `resetCodexRoutingForManualSelection` (`src/codex/routing.ts:988`) drops | ||
| `quotaAvoidUntil` from `upstreamHealth` and returns early when that map has no entry. A | ||
| reset-derived 429 writes to `quotaScopedHealth` instead and returns at | ||
| `src/codex/routing.ts:2763`, so naming the account clears nothing in the case the commit | ||
| actually introduced. | ||
|
|
||
| `clearCodexAccountCooldown` (`src/codex/routing.ts:1066`) destructures the cooldown and | ||
| probe-lease fields and carries `quotaAvoidUntil` through in `...rest`. Probe recovery at | ||
| `src/codex/routing.ts:863` deliberately drops it, with a comment saying that leaving it | ||
| would make the escape hatch stop escaping. The operator's escape hatch has the defect the | ||
| automatic one avoids. | ||
|
|
||
| An exhaustive scan found `quotaAvoidUntil` and `isCodexQuotaAvoided` used only in | ||
| `src/codex/routing.ts`, and no fourth omission. | ||
|
|
||
| ## Non-blocking | ||
|
|
||
| Lane 7 found only the top-level help text advertising `(14 clients)` against a registry | ||
| of fifteen, which #4390 already corrected. The count never reaches dispatch; | ||
| `ocx export --client cline` and the dashboard switch both read the registry. | ||
|
|
||
| Lane 6 noted that `RemoteControlHost` defaults to the full capability set when a caller | ||
| omits `allowedCapabilities`. No runtime file imports `src/remote-control`, so nothing | ||
| reaches it; the documented `OCX_REMOTE_WORKSPACE_ENABLED` flag does not exist in `src/` | ||
| yet. That is a default to settle when the activation layer lands, not a regression here. | ||
|
|
||
| ## What the lanes did not do | ||
|
|
||
| No lane executed the product. Every verdict is a source and diff reading, cross-checked | ||
| against the tests each commit shipped. Local product tests, builds, typecheck and install | ||
| were NOT RUN. |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes shared Codex selection and manual cooldown-recovery semantics, but the commit updates none of the architecture documents mapped to
src/codex/instructure/INDEX.md:103. Consequently, the maintainer SSOT does not describe that main-account selection now honors quota avoidance or that manual selection and cooldown clearing remove it; update the mapped structural documentation alongside this routing change.AGENTS.md reference: src/AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the commit above.
structure/providers/openai-tiers.mdnow states the two-duration contract, that the window binds the__main__alias on the same terms as an added account because the main login enters candidacy through its own re-insertion path, and that both operator escapes clear it from the scoped entries a reset-derived refusal is the only thing that writes.