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:

Implementations must be thread-safe.

  • Method Details

    • register

      void register(SubagentRecord record)
      Persists an exposure record. Idempotent on SubagentRecord.subagentId() — re-registering the same id overwrites the previous record.
      Parameters:
      record - the record to persist (must carry a non-null subagentId)
    • find

      Optional<SubagentRecord> find(String subagentId)
      Resolves a subagent handle. Implementations should treat an expired record (see SubagentRecord.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

      void revoke(String subagentId)
      Removes a single exposure record. No-op when the id is unknown.
    • revokeByParentSession

      default void revokeByParentSession(String parentSessionId)
      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