[app-server] send account/rateLimits/updated notifications (#5477)

Codex will now send an `account/rateLimits/updated` notification
whenever the user's rate limits are updated.

This is implemented by just transforming the existing TokenCount event.
This commit is contained in:
Owen Lin
2025-10-22 13:12:40 -07:00
committed by GitHub
parent 273819aaae
commit 8ae3949072
3 changed files with 47 additions and 0 deletions

View File

@@ -1436,6 +1436,15 @@ async fn apply_bespoke_event_handling(
on_exec_approval_response(event_id, rx, conversation).await;
});
}
EventMsg::TokenCount(token_count_event) => {
if let Some(rate_limits) = token_count_event.rate_limits {
outgoing
.send_server_notification(ServerNotification::AccountRateLimitsUpdated(
rate_limits,
))
.await;
}
}
// If this is a TurnAborted, reply to any pending interrupt requests.
EventMsg::TurnAborted(turn_aborted_event) => {
let pending = {