Skip to content

fix(codex): require status context for numeric rate-limit errors - #3176

Merged
vybe merged 2 commits into
Abilityai:devfrom
alex-furman:codex/3175-codex-rate-status-context
Oct 2, 2026
Merged

vybe merged 2 commits into
Abilityai:devfrom
alex-furman:codex/3175-codex-rate-status-context

Conversation

@alex-furman

Copy link
Copy Markdown
Contributor

Fixes #3175

A failed Codex turn containing .429Z in a timestamp or localhost:4299 currently becomes HTTP 429 because the classifier searches for bare 429. Require recognizable HTTP/status context for numeric 429; keep existing named rate/quota markers and authentication behavior.

The two-file change adds real-function regression cases for incidental timestamps, process IDs, ports and 4290, with preservation cases for HTTP/status 429, named errors and authentication. Against official dev 12cb5f9, the focused suite produced 9 failures and 26 passes before the fix; all 35 pass afterward. A separate independent parser-to-classifier harness produced 3 incidental-digit failures and 10 preservation passes on stock, then 13 passes after the fix.

Validation used Python 3.12 and the real runtime module in an isolated unit harness; no provider calls or production services. Full unit suite, base-image build and live CLI integration were not run. Independent adversarial review found no blocking issue within this numeric-matching scope. Competing terminal/stderr precedence and broader structured-error handling are unchanged.

thefurman and others added 2 commits October 1, 2026 13:28
`\s*[:=]?\s*` lets the two adjacent `\s*` split a run of whitespace every
way, so classification was quadratic in stderr length (~47s on 200k
spaces, inline on the agent server's event loop). `\s*(?:[:=]\s*)?`
matches the same strings in linear time.

merge-train: mechanical, per the merge-train note on the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vybe

vybe commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

merge-train: pushed c4d0920a6 to this branch, a mechanical fix with no change in intent.

_RATE_STATUS_PATTERN used \s*[:=]?\s*. The two adjacent \s* can split a run of whitespace every possible way, so classification was quadratic in stderr length: about 47s on "status" + 200k spaces, running inline on the agent server's event loop. The rewrite \s*(?:[:=]\s*)? matches the same strings in linear time. Every existing positive and negative case behaves the same, and tests/unit/test_codex_runtime.py passes 167/167 locally. I added test_classify_rate_status_pattern_is_linear_on_long_whitespace, which fails on the old regex (45.9s) and passes on the new one.

The validation also raised two non-blocking points, for you to consider:

  • Some real numeric phrasings no longer read as rate limits unless a named marker is also present: JSON "status": 429, statusCode: 429, Error code: 429.
  • src/scheduler/service.py:1745 still does a bare "429" in error_lower. That is a candidate for a follow-up issue.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train: batch validated on train PR #3179 (all checks green).

@vybe
vybe merged commit 45d9d22 into Abilityai:dev Oct 2, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants