mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Reject overflowing rollout budget charges before posting (#62559)
## Why An overflowing hook total could send a partial charge to the host, and an overflow in native accounting could leave the posted balance infinite. ## What changed Reject overflowing hook totals before reporting usage. Check both the combined provider and hook charge and the cumulative rollout balance before posting, preserving the previous balance on overflow. Native budgets with limit enforcement enabled still stop new work on overflow. ## Testing Update the hook overflow integration case to verify that the response's tool is blocked and the host receives no usage report. GitOrigin-RevId: 2ac80a6aa1d857924a8807df7bb70c6b7c107cd2
This commit is contained in:
@@ -1985,7 +1985,7 @@ async fn spawn_internal_session_preserves_parent_lineage_without_forking_history
|
||||
output_tokens: 25,
|
||||
..Default::default()
|
||||
}),
|
||||
codex_hooks::HookCharge::default(),
|
||||
/*hook_units*/ 0.0,
|
||||
)
|
||||
.await
|
||||
.expect("record reviewer usage");
|
||||
|
||||
Reference in New Issue
Block a user