Skip to content

Conversation

timonv
Copy link
Contributor

@timonv timonv commented Aug 14, 2025

Went into the rabbit hole of streaming backoffs. Turns out eventsource has something already, of which I'm not 100% certain how well it works, but since streaming is a bit different, we want to generally retry all the time. This PR sets the event source retry policy to the (similar) values of backoff. There's one slight difference in behaviour, in that on transport errors, we only retry server errors or 429s, like with regular requests.

We can't inspect the response body at this point, so we can't differentiate between rate limits and quota errors (thanks openai).

Also, during streaming, token errors are a rough 400. I think maybe. Sometimes.

Practically, I'm trying to stream a lot of agents in parallel, hoping with this I can mitigate it somewhat.

@timonv
Copy link
Contributor Author

timonv commented Aug 14, 2025

Actually, #413 would be a nice extension to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant