diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index b02f41d..0df5ec2 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -30,6 +30,16 @@ same. * `"protocol": 2` in the greeting is the format version. It changes only when a field changes meaning; new fields are added without a bump. +### Why this stays one JSON object per line + +It was considered for replacement and kept. The two failures that made the +framing look guilty were not on this socket: a model sent two tool-argument +objects in one string and `mcp_parse()` silently took the first (fixed with +`mcp_parse_exact()`), and a gateway put HTTP chunk framing inside an SSE body +(fixed at the gateway). A second, non-JSON protocol would have hidden neither. +The line format is also what lets `splinterctl`, `docs/proto-example.py` and a +GUI be a client in a few dozen lines. + One client at a time. The server holds one active engine, so one conversation runs; `open` switches it, it does not run two. A second writer on the same engine would be a second history. When a client disconnects in the middle of a turn, the server