Class InMemorySubagentRegistry
java.lang.Object
io.agentscope.harness.agent.gateway.InMemorySubagentRegistry
- All Implemented Interfaces:
SubagentRegistry
Default single-process
SubagentRegistry. Records live only for the JVM's lifetime; this
preserves the legacy in-memory exposure behaviour when no distributed store is configured.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResolves a subagent handle.voidregister(SubagentRecord record) Persists an exposure record.voidRemoves a single exposure record.voidrevokeByParentSession(String parentSessionId) Removes all exposure records associated with the given parent session.
-
Constructor Details
-
InMemorySubagentRegistry
public InMemorySubagentRegistry()
-
-
Method Details
-
register
Description copied from interface:SubagentRegistryPersists an exposure record. Idempotent onSubagentRecord.subagentId()— re-registering the same id overwrites the previous record.- Specified by:
registerin interfaceSubagentRegistry- Parameters:
record- the record to persist (must carry a non-nullsubagentId)
-
find
Description copied from interface:SubagentRegistryResolves a subagent handle. Implementations should treat an expired record (seeSubagentRecord.isExpired(java.time.Instant)) as absent and may evict it lazily.- Specified by:
findin interfaceSubagentRegistry- Parameters:
subagentId- the handle to resolve- Returns:
- the record, or
Optional.empty()if unknown or expired
-
revoke
Description copied from interface:SubagentRegistryRemoves a single exposure record. No-op when the id is unknown.- Specified by:
revokein interfaceSubagentRegistry
-
revokeByParentSession
Description copied from interface:SubagentRegistryRemoves 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.- Specified by:
revokeByParentSessionin interfaceSubagentRegistry- Parameters:
parentSessionId- the parent session whose exposed subagents should be revoked
-