Protocol.
The messages a k0rtex server and its workers exchange over the worker’s SSH channel. Both sides depend on this package and on nothing of each other.
Change PROTOCOL_VERSION in rpc.py whenever a message changes in a way an older peer would
misread. A server refuses a worker that reports another version.
Version 3 added what a worker says about itself in Welcome (max_sessions,
provider_limits, draining), which the server asks for again every few seconds, and
SessionReport, which asks how a run’s agent session ended.
Version 4 lets a provider shape the ACP session beyond the process it starts: Launch and
SessionReady carry session_meta (sent as _meta of session/new) and options (further
config options to select), and SessionSpec.mcp_servers names the session’s MCP servers.
Version 5 ends the relay of the harness’s own protocol. OpenSession carries the prompt,
model, effort and MCP servers, and after its reply the channel carries stream.py messages:
the worker’s activity (activity.py), questions and result, and the server’s answers and
cancellation. ListModels replaces the bare catalog session.
provider.py is the seam a harness package implements: it says how to launch a headless
command that streams JSON (cli) or where to reach an Agent2Agent agent (a2a).
This page is backend/packages/protocol/README.md in the k0rtex repository. Suggest a change.