Skip to content

Honor workspace spend controls in rate-limit handling - #33187

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/18b09d493d5a620a7c079fb721ec50b38dd5b04c
Jul 14, 2026
Merged

Honor workspace spend controls in rate-limit handling#33187
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/18b09d493d5a620a7c079fb721ec50b38dd5b04c

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 14, 2026

Copy link
Copy Markdown

Honor workspace spend controls in rate-limit handling

Why

Sparse and out-of-order rate-limit updates can omit account metadata or let an
older full read overwrite a newer workspace hard stop. Credit availability also
does not always include a displayable balance.

What changed

  • Propagate the backend's spendControlReached state through rate-limit
    snapshots and the app-server protocol, preserving it across sparse updates.
  • Keep workspace hard-stop classifications for error routing and ignore stale
    full-read results after a newer hard-stop notification.
  • Base TUI warnings and model-switch prompts on credit availability and hard-stop
    state, and show Credits: Available when a finite balance is hidden.

Testing

Added coverage for spend-control mapping, snapshot merging, out-of-order reads,
workspace error routing, warning and prompt behavior, and credit status display.

## Why

Sparse and out-of-order rate-limit updates can omit account metadata or let an
older full read overwrite a newer workspace hard stop. Credit availability also
does not always include a displayable balance.

## What changed

- Propagate the backend's `spendControlReached` state through rate-limit
  snapshots and the app-server protocol, preserving it across sparse updates.
- Keep workspace hard-stop classifications for error routing and ignore stale
  full-read results after a newer hard-stop notification.
- Base TUI warnings and model-switch prompts on credit availability and hard-stop
  state, and show `Credits: Available` when a finite balance is hidden.

## Testing

Added coverage for spend-control mapping, snapshot merging, out-of-order reads,
workspace error routing, warning and prompt behavior, and credit status display.

GitOrigin-RevId: 18b09d493d5a620a7c079fb721ec50b38dd5b04c
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/18b09d493d5a620a7c079fb721ec50b38dd5b04c branch from be6c064 to 4df8027 Compare July 14, 2026 22:44
@copyberry
copyberry Bot merged commit 4df8027 into main Jul 14, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/18b09d493d5a620a7c079fb721ec50b38dd5b04c branch July 14, 2026 22:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 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.