Use provider-reported rollout budget units (#36715)

## What changed

- Charge `codex_rollout_budget_units` against the shared rollout budget when the provider includes it in response usage.
- Fall back to weighted input and output token accounting when provider units are absent.
- Reject non-finite or negative provider units as a fatal response error.

## Testing

- Cover provider units in reminder thresholds and local and remote compaction budget exhaustion.
- Verify invalid units fail without retrying the response.

GitOrigin-RevId: b452403e365985854d16f298d1ba46383e9892c4
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-03 09:46:38 +00:00
1 parent bb5054fe47
commit 8b8fa7276f
3 files changed
+104 -15

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ impl Session {
.services
.agent_control
.rollout_budget()
.record_usage(usage)
.record_usage(usage)?
{
return Err(CodexErr::SessionBudgetExceeded);
}