48-Hour Field Notes: My Stream Ended Without [DONE] and the Client Called It Success
Why does a truncated model answer look exactly like a finished one when the only thing you check is the HTTP status code? That question cost me most of a weekend. I had wired a small summarizer to a streaming endpoint, watched it print a paragraph, and shipped it. Two days of field notes later, I had learned that "HTTP 200" tells you nothing about whether the answer actually completed, and that…
The issue at hand revealed a common mistake: assuming that a 200 HTTP status code guarantees a finished streaming response. In reality, the status code alone offers no insight into whether the response completed properly. The reporter had built a small summarizer to a streaming endpoint and found that the parser was reporting success even when the stream never sent a terminator.
This led to outputs abruptly stopping mid-sentence, causing readers to interpret the model as being terse rather than the transport ending. To tackle the problem, the reporter developed a probe harness to check protocol facts instead of just vibes. This probe records four key pieces of information for each request: time to first byte, the presence of a finish_reason in JSON payloads, whether the [DONE] sentinel arrived, and the state of the socket at the end.
By focusing on these objective measures, the reporter could more accurately determine whether a streaming endpoint truly completed its task.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.