From 0841fabe878c263542a9149238c73a6174fea7fe Mon Sep 17 00:00:00 2001 From: lotherk Date: Thu, 19 Nov 2026 06:25:37 +0000 Subject: [PATCH] protocol: record why the line-JSON framing stays It was up for replacement after a session woke with no task and a turn died with "stream ended with no answer". Both were elsewhere: a model put two tool-argument objects in one string and mcp_parse() took the first, and a gateway sent HTTP chunk framing inside an SSE body. A second, non-JSON protocol would have hidden neither, and the line format is what keeps splinterctl and proto-example.py small. Docs only; no code path changed. --- docs/PROTOCOL.md | 10 ++++++++++ 1 file changed, 10 insertions(+) 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