fix: 表达工作流部分保存结果并校验认证重放
Piper 的 chooses 刷新与删除检查业务码,保留空成功响应。主保存成功后刷新失败抛出携带已保存版本的 WorkflowSavePartialError;统一 JSON 错误保留可选 EkbError.details。 workflow save 在部分成功时返回非零与恢复信息,--in-place 仍同步已保存版本;新增带写确认的 refresh-chooses,仅重试元数据刷新,不重发完整快照。主保存失败不改本地版本。 认证重放保留最终鉴权响应检查(含 HTTP 200 的错误头),最多重放一次,其他 HTTP 错误维持 Ky 语义。补充 SDK、CLI、恢复与重放回归,并更新文档。 验证:bun test 922 通过、0 失败;bun run check、git diff --check 通过。所有业务请求均为离线假接口。
This commit is contained in:
1 parent
51fb54dfe8
commit
55d31e27e6
19 files changed
+298
-23
No files matched your search
+2
-1
@@ -6,6 +6,7 @@ import { classifyCliError } from "./errors.js";
|
||||
import { initCorpRuntime } from "./helpers.js";
|
||||
import { findCommandByArea, isStandingCommand } from "./registry.js";
|
||||
import type { CliParsedArgs, CliResult, CliRunOptions } from "./types.js";
|
||||
import { EkbError } from "../core/errors.js";
|
||||
|
||||
let runQueue = Promise.resolve<any>(undefined);
|
||||
|
||||
@@ -109,7 +110,7 @@ export function cliErrorResult(error: unknown, jsonMode: boolean): CliResult {
|
||||
const message = redactSensitiveText(error instanceof Error ? error.message : String(error));
|
||||
const classification = classifyCliError(error);
|
||||
return {
|
||||
stdout: jsonMode ? JSON.stringify({ error: true, message, exitCode: classification.exitCode, ...(classification.nextAction ? { nextAction: classification.nextAction } : {}) }, null, 2) : "",
|
||||
stdout: jsonMode ? redactSensitiveText(JSON.stringify({ error: true, message, exitCode: classification.exitCode, ...(classification.nextAction ? { nextAction: classification.nextAction } : {}), ...(error instanceof EkbError && error.details ? { details: error.details } : {}) }, null, 2)) : "",
|
||||
stderr: jsonMode ? "" : `[ERROR] ${message}${classification.nextAction ? `\n下一步: ${classification.nextAction}` : ""}\n`,
|
||||
exitCode: classification.exitCode,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user