Operator Ingress And Reply Routes

Summary

AgentInbox should be the transport/control-plane bridge between external operator channels and Holon agents.

For the first implementation, AgentInbox uses the current Holon contract:

Feishu is the first provider integration because AgentInbox already has Feishu source and delivery support.

Problem

External IM systems can deliver human operator messages to an agent, but the agent runtime may not reply synchronously. A single incoming Feishu message can start a long agent turn, tool calls, waits, or later completion briefs.

Therefore AgentInbox should not model this as one provider webhook request that expects an immediate response.

It also should not embed Holon runtime semantics into its core data model. AgentInbox owns provider identity, routing, persistence, and outbound delivery; Holon owns agent execution.

Current Holon Contract

Holon currently exposes two relevant control endpoints:

The reply callback capability is binding-level. Each ingress can select a specific route using reply_route_id.

This RFC intentionally does not require a richer ingress-level reply_target object yet.

Goals

Non-Goals

Data Model

OperatorTransportBinding

An OperatorTransportBinding connects one AgentInbox-managed transport to one Holon agent.

It stores:

When requested, AgentInbox syncs the binding to Holon through operator-bindings.

OperatorReplyRoute

An OperatorReplyRoute maps a Holon reply_route_id back to an AgentInbox DeliveryHandle.

It stores:

Holon only needs to preserve the route id. AgentInbox uses that id to recover the provider target and call the correct delivery adapter.

Request Flow

1. Register binding

An operator or integration creates a binding for an agent:

AgentInbox -> Holon /control/agents/{agent_id}/operator-bindings

AgentInbox includes the callback URL template that Holon can call when output is ready.

2. Forward inbound Feishu message

When a Feishu message should act as an operator prompt, AgentInbox:

  1. normalizes the operator actor id
  2. creates or updates an OperatorReplyRoute
  3. forwards the text to Holon operator-ingress
  4. includes reply_route_id, provider_message_ref, and metadata

Holon accepts the prompt asynchronously and later emits output.

3. Deliver Holon reply

Holon calls AgentInbox:

POST /delivery-routes/{route_id}/messages

AgentInbox resolves the route to a DeliveryHandle and sends the text through the provider delivery adapter. For Feishu, this currently maps to the canonical chat message or message reply delivery operation.

Feishu First Implementation

The first implementation targets Feishu because AgentInbox already supports:

The operator route layer should only store provider routing data in the DeliveryHandle; it should not introduce Feishu-specific core tables.

Open Questions