Interface SubagentRegistry
- All Known Implementing Classes:
InMemorySubagentRegistry,StoreBackedSubagentRegistry
public interface SubagentRegistry
Durable registry of exposed subagents, keyed by
subagentId.
Decouples a subagent's user-facing handle from any single process: the in-memory
HarnessGateway keeps a live-agent cache for the fast same-node path, while this registry
persists the SubagentRecord recipe so that any node (or the same node after a restart)
can resolve the handle and re-materialize the agent.
Implementations:
InMemorySubagentRegistry— default, single-process, equivalent to the legacy behaviour.StoreBackedSubagentRegistry— backed by a distributedBaseStore(Redis / OSS / MySQL viaDistributedStore.baseStore()).
Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionResolves a subagent handle.voidregister(SubagentRecord record) Persists an exposure record.voidRemoves a single exposure record.default voidrevokeByParentSession(String parentSessionId) Removes all exposure records associated with the given parent session.
-
Method Details
-
register
Persists an exposure record. Idempotent onSubagentRecord.subagentId()— re-registering the same id overwrites the previous record.- Parameters:
record- the record to persist (must carry a non-nullsubagentId)
-
find
Resolves a subagent handle. Implementations should treat an expired record (seeSubagentRecord.isExpired(java.time.Instant)) as absent and may evict it lazily.- Parameters:
subagentId- the handle to resolve- Returns:
- the record, or
Optional.empty()if unknown or expired
-
revoke
Removes a single exposure record. No-op when the id is unknown. -
revokeByParentSession
Removes all exposure records associated with the given parent session. Used to clean up when a parent conversation ends. Implementations that cannot enumerate by parent may no-op.- Parameters:
parentSessionId- the parent session whose exposed subagents should be revoked
-