Skip to content

Allow asynchronous model request budget checks - #60080

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/462c74b86a46a4b2276f901c69187fc7cbc3ff81
Nov 7, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/462c74b86a46a4b2276f901c69187fc7cbc3ff81

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Allow asynchronous model request budget checks

What changed

Make ModelRequestContributor::budget_exhausted return an ExtensionFuture and await budget checks before HTTP and WebSocket generation. WebSocket warmup continues to skip budget checks.

If the account changes during the post-connect budget check, rebuild the request setup and reconnect before sending the WebSocket request.

Testing

Update tests to cover a pending budget check that resolves to exhaustion, warmup connection reuse, and an account switch while the post-connect budget check is awaiting completion.

## What changed

Make `ModelRequestContributor::budget_exhausted` return an `ExtensionFuture` and await budget checks before HTTP and WebSocket generation. WebSocket warmup continues to skip budget checks.

If the account changes during the post-connect budget check, rebuild the request setup and reconnect before sending the WebSocket request.

## Testing

Update tests to cover a pending budget check that resolves to exhaustion, warmup connection reuse, and an account switch while the post-connect budget check is awaiting completion.

GitOrigin-RevId: 462c74b86a46a4b2276f901c69187fc7cbc3ff81
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/462c74b86a46a4b2276f901c69187fc7cbc3ff81 branch from 7200711 to c4f0e09 Compare November 7, 2026 07:45
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-07T07:45:47.674153Z 7200711 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.

@copyberry
copyberry Bot merged commit c4f0e09 into main Nov 7, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/462c74b86a46a4b2276f901c69187fc7cbc3ff81 branch November 7, 2026 07:45
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants