Interface SubagentMaterializer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Rebuilds a subagent
Agent instance from its type id. Used by HarnessGateway to
recover an exposed subagent on a node that does not hold the live instance (after a restart or
when a request is routed to a different replica).
Typically backed by
DefaultAgentManager::createAgentIfPresent. The rebuilt agent is invoked with the
sessionId carried by the SubagentRecord, so a distributed
AgentStateStore restores the prior conversation history.
-
Method Summary
Modifier and TypeMethodDescriptionOptional<io.agentscope.core.agent.Agent> materialize(String agentId, io.agentscope.core.agent.RuntimeContext parentRc) Materializes an agent of the given type.
-
Method Details
-
materialize
Optional<io.agentscope.core.agent.Agent> materialize(String agentId, io.agentscope.core.agent.RuntimeContext parentRc) Materializes an agent of the given type.- Parameters:
agentId- the subagent type identifierparentRc- a runtime context carrying at least the target session id- Returns:
- the rebuilt agent, or
Optional.empty()if the type is unknown / not spawnable
-