Repair a customer's streaming assistant
A customer's support assistant streams replies from a model, and their team filed three complaints this week as a single ticket called "the chat is broken". Accented characters arrive as black diamonds. Long replies lose most of their text and only the end shows up. And sending a second message while the first is still writing tangles the two replies together.
They are three separate defects with three separate mechanisms, which is the first thing to establish out loud. A rewrite typically fixes two of them and quietly reintroduces the third, so the grader checks each symptom on its own.
There is a fourth defect nobody reported, because it is invisible until the day it matters: what the reader sees when the server returns 500, or when the connection dies halfway through a reply. On most implementations the answer is a blank bubble and a stack trace in a console nobody has open.
The pack ships a hostile stream server that splits characters across byte boundaries, stalls, returns errors and drops connections mid-stream, plus a grader that stands in for React so what is scored is your state model rather than your JSX. It runs on Node's standard library with nothing to install.
The tests are the smaller half. The half that decides the round is being able to answer two questions about your own fix: which message does a chunk belong to, and which run is allowed to write. A functional state update answers neither, and cancelling a request does not stop work that was already scheduled.
What is being graded
- Which message a chunk belongs to, which a functional state update does not answer
- Which run is allowed to write, given that cancelling a request does not stop work already scheduled
- Whether you reproduced each symptom before changing anything
- What the user sees when the server fails, not just what the console sees
The brief above is the whole problem, and you are welcome to build the fixtures yourself. The pack saves you that hour: schema, seed data, the broken version, a starter file, a grader, and a reference solution that explains what was being scored rather than just showing the answer.
See premium access →Background reading: streaming chat ui drops tokens three bugs
