diff --git a/docs/CONTRACT-mcp.md b/docs/CONTRACT-mcp.md index d258e5d..690bfc3 100644 --- a/docs/CONTRACT-mcp.md +++ b/docs/CONTRACT-mcp.md @@ -136,6 +136,13 @@ fails the test if it is reached. makes binding every interface the one case where the hostnames must be named. * **No TLS.** The token crosses the wire in clear text. Loopback is the default; anything else wants a reverse proxy and says so in a module warning. +* **Tool calls are serialised across every caller**, not per session. The + `Runner` holds a process-wide lock because the CLI it calls prints to a + stdout this process shares — invisible while each client had a process of its + own, visible now that one process serves many. Two agents on two tokens queue + behind each other, and a slow call delays everyone's next one rather than + only its own caller's. Latency, never a hang: the event loop answers a `ping` + throughout. See `docs/TODO/mcp-in-process-has-no-call-deadline.md`. ## 2. Configuration diff --git a/docs/TODO/mcp-in-process-has-no-call-deadline.md b/docs/TODO/mcp-in-process-has-no-call-deadline.md index 244ab1a..7f17e12 100644 --- a/docs/TODO/mcp-in-process-has-no-call-deadline.md +++ b/docs/TODO/mcp-in-process-has-no-call-deadline.md @@ -65,3 +65,13 @@ and not high. (1) is latent. It becomes real the first time a compositor stops answering while an agent is driving it: the agent's next tool call waits behind the stuck one with no way to give up, where a CLI user would have pressed ctrl-C. + +**The HTTP transport widens (1) without changing it.** The serialisation was +always there — `Runner` holds a process-wide lock because the CLI prints to a +shared stdout — but over stdio each client had a process of its own, so a call +only ever queued behind that same client's previous call. `mcp.http.enable` +puts every caller in one process, so a stuck call now delays *other people's* +agents too, and the one of them who can see something is wrong is not +necessarily the one who caused it. That makes idea 1 (a reachable +frame-socket timeout) worth more than it was, and idea 2 (a forked child per +call) less unreasonable than it was.