2.0 KiB
2.0 KiB
AgentRun 资源原语
新 Code Queue 工作统一使用 AgentRun 资源原语:
agentrun create|apply:创建 task 或应用 AipodSpec manifest;agentrun get|describe:有界读取列表和详情;agentrun events|logs|result:渐进披露运行证据;agentrun get attempts --task <taskId>:读取同一 task 的不可变 attempt 历史;agentrun retry task/<taskId> --idempotency-key <key> --reason <text> [--dry-run]:对终态失败 task 创建下一次 attempt;agentrun dispatch|ack|cancel:控制生命周期。
agentrun events 是高频渐进披露入口:
- 默认 human、
-o json和-o yaml最多返回 20 条同构事件摘要,并用一条 lookahead 披露hasMore与nextAfterSeq; - tool call 只展示 identity、seq/type/status、commandId、工具、命令首行、exit/duration、output bytes/hash、truncation 与
outputOmitted; - 默认不得展开 stdout、stderr、skill 正文或完整 payload,也不得通过提高全局 stdout 阈值掩盖 dump;
- 完整事件使用显式
--full、--raw,或按item.identity和afterSeq=item.seq-1 --limit 1 --full下钻; - 该 CLI 只渲染 AgentRun durable facts,不删除事件、不按正文去重,也不改变 Kafka/SSE 事件链。
retry 必须遵守以下边界:
- task identity 不变,每次执行使用新的 attempt、run、command 和 runner Job identity;
- 同一幂等键返回同一 retry 结果,不重复创建 attempt;
- 只允许 Queue 已处于
failed或blocked,其他终态与非终态 fail closed; --dry-run由服务端完成与真实 retry 相同的校验,但零写入;- retry 不主动刷新 Core 终态。若 Queue 摘要仍是非终态,先通过正式
get task或get attempts刷新权威状态,再重试; - 禁止复制或重置 task,禁止在 UniDesk 增加 scheduler、backoff、judge、projector 或直接 runner 编排。
不要在 legacy codex 下增加新的 mutation 路径。