Skip to content

Check extension budgets before model generation requests - #59794

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/97ce02dc7f9bd54830e4b73c4f0334a30367eebf
Nov 6, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/97ce02dc7f9bd54830e4b73c4f0334a30367eebf

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Check extension budgets before model generation requests

What changed

Add a default ModelRequestContributor::budget_exhausted hook and fail generation with SessionBudgetExceeded when any contributor reports an exhausted budget for the thread.

Check budgets before HTTP requests and before WebSocket connection setup, then check again after the connection is established. WebSocket warmup remains available when the budget is exhausted.

Testing

Add coverage for budget changes during a tool call, verifying that exhaustion prevents the next model request while an available budget allows completion. Extend WebSocket coverage to verify that exhausted generation opens no connection and warmup still permits connection reuse once the budget becomes available.

## What changed

Add a default `ModelRequestContributor::budget_exhausted` hook and fail generation with `SessionBudgetExceeded` when any contributor reports an exhausted budget for the thread.

Check budgets before HTTP requests and before WebSocket connection setup, then check again after the connection is established. WebSocket warmup remains available when the budget is exhausted.

## Testing

Add coverage for budget changes during a tool call, verifying that exhaustion prevents the next model request while an available budget allows completion. Extend WebSocket coverage to verify that exhausted generation opens no connection and warmup still permits connection reuse once the budget becomes available.

GitOrigin-RevId: 97ce02dc7f9bd54830e4b73c4f0334a30367eebf
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/97ce02dc7f9bd54830e4b73c4f0334a30367eebf branch from b4afa24 to 1031a7b Compare November 6, 2026 02:32
@copyberry
copyberry Bot merged commit 1031a7b into main Nov 6, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/97ce02dc7f9bd54830e4b73c4f0334a30367eebf branch November 6, 2026 02:32
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-06T02:32:10.180716Z b4afa24 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.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
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.

1 participant