Interface SubagentGatewayBridge

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SubagentGatewayBridge
Bridge between AgentSpawnTool and the gateway layer. Allows spawned subagents to be exposed as user-addressable entry points without the spawn tool needing to know about channels, routers, or the gateway implementation.

When a subagent is exposed, the gateway assigns it a subagentId that the user can use to send messages directly to that subagent, bypassing normal binding-based routing.

  • Method Details

    • expose

      SubagentGatewayBridge.ExposeResult expose(String agentId, String sessionId, io.agentscope.core.agent.Agent agent, OutboundAddress replyTo)
      Exposes a spawned subagent as a user-addressable entry point in the gateway.
      Parameters:
      agentId - the subagent type identifier
      sessionId - the session id assigned to the subagent
      agent - the agent instance
      replyTo - the outbound address for delivering replies back to the user's channel; may be null if no outbound channel context is available
      Returns:
      the expose result containing the subagentId handle