pub enum ConductorMessage {
ClientToAgent {
target_component_index: usize,
message: MessageCx,
},
AgentToClient {
source_component_index: SourceComponentIndex,
message: MessageCx,
},
McpConnectionReceived {
acp_url: String,
actor: McpBridgeConnectionActor,
connection: McpBridgeConnection,
},
McpConnectionEstablished {
response: McpConnectResponse,
actor: McpBridgeConnectionActor,
connection: McpBridgeConnection,
},
McpClientToMcpServer {
connection_id: String,
message: MessageCx,
},
McpConnectionDisconnected {
notification: McpDisconnectNotification,
},
ForwardResponse {
request_cx: JrRequestCx<Value>,
result: Result<Value, Error>,
},
}Expand description
Messages sent to the conductor’s main event loop for routing.
These messages enable the conductor to route communication between:
- The editor and the first component
- Components and their successors in the chain
- Components and their clients (editor or predecessor)
All spawned tasks send messages via this enum through a shared channel,
allowing centralized routing logic in the serve() loop.
Variants§
ClientToAgent
A message (request or notification) targeting a component from its client. This message will be forwarded “as is” to the component.
AgentToClient
A message (request or notification) sent by a component to its client. This message will be forwarded “as is” to its client.
McpConnectionReceived
A pending MCP bridge connection request request. The request must be sent back over ACP to receive the connection-id. Once the connection-id is received, the actor must be spawned.
Fields
actor: McpBridgeConnectionActorThe actor that should be spawned once the connection-id is available.
connection: McpBridgeConnectionThe connection to the bridge
McpConnectionEstablished
A pending MCP bridge connection request request. The request must be sent back over ACP to receive the connection-id. Once the connection-id is received, the actor must be spawned.
Fields
response: McpConnectResponseactor: McpBridgeConnectionActorThe actor that should be spawned once the connection-id is available.
connection: McpBridgeConnectionThe connection to the bridge
McpClientToMcpServer
MCP message (request or notification) received from a bridge that needs to be routed to the final proxy.
Sent when the bridge receives an MCP tool call from the agent and forwards it to the conductor via TCP. The conductor routes this to the appropriate proxy component.
McpConnectionDisconnected
Message sent when MCP client disconnects
Fields
notification: McpDisconnectNotificationForwardResponse
Forward a response back to a request context.
This variant avoids a subtle race condition by preserving the order of responses vis-a-vis notifications and requests. Whenever a new message from a component arrives, whether it’s a new request or a notification, we route it through the conductor’s central message queue.
The invariant we must ensure in particular is that any requests or notifications that arrive BEFORE the response will be processed first.