SubagentRecord
public record SubagentRecord( String subagentId, String agentId, String sessionId, String userId, String parentSessionId, Instant createdAt, Instant expiresAt)
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108承载子智能体记录数据的记录类型。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 subagentId、agentId、sessionId、userId、parentSessionId、createdAt。
Durable, recovery-oriented descriptor of an exposed subagent. Unlike the in-memory
ExposedSession (which holds a live Agent reference), a SubagentRecord
stores only the recipe needed to re-materialize and route to the subagent on any node:
its type (agentId), its own conversational session (sessionId), and lifecycle
metadata.
The agentId feeds the agent factory to rebuild the instance; the sessionId is
passed at invocation time so the rebuilt agent loads the correct conversation history from a
(distributed) AgentStateStore.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 执行子智能体标识相关操作。 the user-visible handle for direct addressing |
agentId | String | 执行智能体标识相关操作。 the subagent type identifier (used to re-materialize the agent) |
sessionId | String | 执行会话标识相关操作。 the subagent's own session id (used to load its conversational state) |
userId | String | 执行用户标识相关操作。 the originating user id, or `null` when unknown |
parentSessionId | String | 执行父级会话标识相关操作。 the parent session that exposed this subagent, or `null` |
createdAt | Instant | 执行已创建 At相关操作。 when the subagent was exposed |
expiresAt | Instant | 执行过期 At相关操作。 optional expiry instant; `null` means no TTL |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean isExpired(Instant now) | 判断是否已过期。 Whether this record has a TTL that has already elapsed relative to `now`. |
public Map<String, Object> toMap() | 返回到映射。 Serializes this record to a flat string/number map for `BaseStore` persistence. |
public static SubagentRecord fromMap(Map<String, Object> m)static | 设置来自映射。 Reconstructs a record from a persisted map, tolerating missing optional fields. |
记录组件详情Record Component Detail
subagentId
String subagentId执行子智能体标识相关操作。
the user-visible handle for direct addressing
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108agentId
String agentId执行智能体标识相关操作。
the subagent type identifier (used to re-materialize the agent)
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108sessionId
String sessionId执行会话标识相关操作。
the subagent's own session id (used to load its conversational state)
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108userId
String userId执行用户标识相关操作。
the originating user id, or null when unknown
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108parentSessionId
String parentSessionId执行父级会话标识相关操作。
the parent session that exposed this subagent, or null
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108createdAt
Instant createdAt执行已创建 At相关操作。
when the subagent was exposed
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108expiresAt
Instant expiresAt执行过期 At相关操作。
optional expiry instant; null means no TTL
io/agentscope/harness/agent/gateway/SubagentRecord.java:41–108方法详情Method Detail
isExpired
public boolean isExpired(Instant now)
判断是否已过期。
Whether this record has a TTL that has already elapsed relative to now.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
now | Instant | 当前时间(类型 `Instant`)。The now. |
booleanio/agentscope/harness/agent/gateway/SubagentRecord.java:51–53toMap
public Map<String, Object> toMap()
返回到映射。
Serializes this record to a flat string/number map for BaseStore persistence.
Map<String, Object>io/agentscope/harness/agent/gateway/SubagentRecord.java:56–74fromMap
public static SubagentRecord fromMap(Map<String, Object> m)
设置来自映射。
Reconstructs a record from a persisted map, tolerating missing optional fields.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
m | Map<String, Object> | m(类型 `Map`)。The m. |
SubagentRecordio/agentscope/harness/agent/gateway/SubagentRecord.java:77–89