Add a codex.rate_limits event for websockets (#10324)

When communicating over websockets, we can't rely on headers to deliver
rate limit information. This PR adds a `codex.rate_limits` event that
the server can pass to the client to inform them about rate limit usage.
The client parses this data the same way we parse rate limit headers in
HTTP mode.

This PR also wires up the etag and reasoning headers for websockets
This commit is contained in:
Rasmus Rygaard
2026-02-04 06:01:47 -08:00
committed by GitHub
parent aab60a55f1
commit df000da917
4 changed files with 183 additions and 4 deletions

View File

@@ -165,6 +165,12 @@ pub struct ResponsesStreamEvent {
content_index: Option<i64>,
}
impl ResponsesStreamEvent {
pub fn kind(&self) -> &str {
&self.kind
}
}
#[derive(Debug)]
pub enum ResponsesEventError {
Api(ApiError),