SubagentRegistry
public interface SubagentRegistry
io/agentscope/harness/agent/gateway/SubagentRegistry.java:40–71定义子智能体注册表契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 register、find、revoke、revokeByParentSession。
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 distributedio.agentscope.harness.agent.filesystem.remote.store.BaseStore(Redis / OSS / MySQL viaio.agentscope.harness.agent.DistributedStore#baseStore()).
Implementations must be thread-safe.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void register(SubagentRecord record) | 设置注册。 Persists an exposure record. |
public Optional<SubagentRecord> find(String subagentId) | 设置查找。 Resolves a subagent handle. |
public void revoke(String subagentId) | 设置该参数。 Removes a single exposure record. |
default public void revokeByParentSession(String parentSessionId)default | 设置该参数。 Removes all exposure records associated with the given parent session. |
方法详情Method Detail
register
public void register(SubagentRecord record)
设置注册。
Persists an exposure record.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
record | SubagentRecord | 记录(类型 `SubagentRecord`)。the record to persist (must carry a non-null `subagentId`) |
io/agentscope/harness/agent/gateway/SubagentRegistry.java:48find
public Optional<SubagentRecord> find(String subagentId)
设置查找。
Resolves a subagent handle.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 子智能体标识(类型 `String`)。the handle to resolve |
Optional<SubagentRecord>io/agentscope/harness/agent/gateway/SubagentRegistry.java:57revoke
public void revoke(String subagentId)
设置该参数。
Removes a single exposure record.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 子智能体标识(类型 `String`)。The subagent id. |
io/agentscope/harness/agent/gateway/SubagentRegistry.java:60revokeByParentSession
default public void revokeByParentSession(String parentSessionId)
设置该参数。
Removes all exposure records associated with the given parent session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parentSessionId | String | 父级会话标识(类型 `String`)。the parent session whose exposed subagents should be revoked |
io/agentscope/harness/agent/gateway/SubagentRegistry.java:68–70