fix(cli): consume canonical output validation state

This commit is contained in:
morluto
2026-10-24 04:07:54 +08:00
parent 94081b0103
commit fc706570d9
2 changed files with 3 additions and 5 deletions
+1 -5
View File
@@ -116,11 +116,7 @@ export const createCliResultOutput = (
destination: Writable,
): CliResultOutput | undefined => {
let options = initialOptions;
if (
(options.parseError && options.format !== "jsonl") ||
!options.validation.ok
)
return undefined;
if (!options.validation.ok) return undefined;
let format = options.format as "json" | "jsonl" | "yaml" | "toon" | "md";
let handled = false;
let failed = false;
+2
View File
@@ -65,6 +65,8 @@ describe("SDK output completion", () => {
parseCliOutputArguments(["--format", format]),
destination,
);
if (output === undefined)
throw new Error("Expected valid output controls");
expect(output.captureSdkOutput(document)).toBe(false);
destination.write(document);
expect(complete).toBe(false);