feat(canvas): 云端 Agent - 完成策略分层、节点能力注册与可解释审批改造

This commit is contained in:
ddCat
2026-09-14 17:58:21 +08:00
parent 9727656b2b
commit dca01886f9
65 changed files with 5347 additions and 918 deletions

View File

@@ -19,3 +19,11 @@ export function agentErrorPresentation(cause: unknown, fallback = "Agent 执行
// 渠道、鉴权、配额等业务错误保留真实语义,不能按 message 猜测为服务未部署。
return { title: fallback, text: text || fallback };
}
export function agentSubmissionErrorTitle(cause: unknown, accepted: boolean) {
if (accepted) return "运行已接收,但本地提交记录清理失败";
const status = cause instanceof ApiError ? cause.status : undefined;
if (status && [400, 401, 403, 404, 422].includes(status)) return "请求已被服务端拒绝";
if (status) return "服务端已返回错误;重试将核对原请求,不重复创建";
return "未收到服务端确认;重试将核对原请求,不重复创建";
}