Common Message-List Bugs

Debugging

Part of: Chat Roles & Messages

Most "the model is dumb today" bug reports are not the model's fault, they're a malformed message list. A missing system message, two user turns in a row, a reply that never got appended. The model faithfully continues whatever transcript you hand it, so a broken list produces a broken conversation. This lesson is the field guide to the four bugs you'll actually hit. What it is A message-list bug is a structural mistake in the array you send, not in the content of any one message, but in how they're ordered, labeled, or combined. The model can't warn you about most of these; it just produces confusing output. The four most common: - Wrong order : turns appended out of sequence, so the conversation reads scrambled. - Missing system message : no setup, so behavior is generic and drifts. - Role violations : duplicated or non-alternating roles (two user messages in a row, no assistant between). - Content typos : a misspelled role string ("assitant") or wrong key ("text" instead of "content"), which many APIs reject outright. How it works Most providers expect a tidy shape: an optional system message first, then user and assistant turns that alternate . A quick validator catches the com

Challenge: Message-List Linter