分页查询 Session 的子 Agent 列表,查看名称、状态和生命周期时间。
接口
GET /agents/sessions/{session_id}/subagents
返回 Session 的子 Agent 列表。根 Agent 不作为子 Agent 返回。成功返回 200。查询不启动或恢复子 Agent,也不创建资源。
路径参数session_idstring (必选)Session ID,例如 sess_xxx查询参数limitinteger (可选)每页数量,范围 1–100,默认 20order string (可选)排序方向,asc 或 desc,默认 descafter string (可选)上一页的 last_id;结果不包含游标项before 会被忽略,不用于反向分页。使用 order 和 after 翻页。 | 请求示例 |
响应字段列表信封:objectstring列表对象类型,固定为 listdata array<Subagent>当页子 Agent;空时为 []first_id string / null当页首项 ID。空页为 nulllast_id string / null当页末项 ID。空页为 null。后续 after 使用该值has_more boolean当前检索方向是否还有下一页Subagent 字段:active 可以空闲等待,不表示持续运行。历史查询不自行启动或恢复子 Agent。
data 项 id string稳定的子 Agent IDobject stringSubagent 对象类型,固定为 agent.session.subagentsession_id string所属 Sessionparent_agent_id string父 Agentname string / null展示名instructions array / null公开指令内容status stringSubagent 状态:active 或 closedopened_at integer打开时间,Unix 秒closed_at integer / null关闭时间,Unix 秒;未关闭时为 null | 响应示例 |
错误码
| HTTP 状态码 | 错误类型 / 错误码 | 解决方案 |
|---|---|---|
400 | invalid_request_error / invalid_request_error | 按查询参数说明修正 limit、order;使用本集合上一页返回的 last_id 作为 after |
404 | not_found_error / not_found_error | 使用当前工作空间中存在且未删除的 Session ID |
502 | server_error / agents_api_upstream_unavailable | 稍后重试;持续失败时提交工单并提供响应头中的 x-request-id |