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.
This commit is contained in:
1 parent
c11a6c7989
commit
0841fabe87
1 file changed
+10
@@ -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
|
||||
|
||||
Reference in new issue
Block a user