I can now replay any AI agent stream from production. Here's how.
I can now replay any AI agent stream from production. Here's how. In my last post, I wrote about the four SSE bugs that break AI agent UIs at 2am — chunk boundary splits, missing token batching, ha...

Source: DEV Community
I can now replay any AI agent stream from production. Here's how. In my last post, I wrote about the four SSE bugs that break AI agent UIs at 2am — chunk boundary splits, missing token batching, hanging done states, and retry logic that retries the wrong things. There's a fifth problem I didn't cover, because the fix didn't exist yet. What do you do the morning after something broke? The stream is gone. The event sequence that caused the bug evaporated the moment the connection closed. You have a user complaint, maybe a generic error log, and zero ability to reproduce the issue locally because local dev doesn't have real network conditions, real token rates, or the specific sequence of tool calls that triggered the failure. Today I shipped AgentStreamRecorder to the agent-stream library to solve exactly this. The debugging gap nobody talks about When a REST API fails, you have the request and response in your logs. You can replay it with curl. You can write a regression test. The failu