fix: throw on non-JSON Claude Code output instead of fallback
This commit is contained in:
@@ -8,11 +8,7 @@ import {
|
|||||||
createAgent,
|
createAgent,
|
||||||
} from "@uncaged/workflow-agent-kit";
|
} from "@uncaged/workflow-agent-kit";
|
||||||
|
|
||||||
import {
|
import { parseClaudeCodeJsonOutput, storeClaudeCodeDetail } from "./session-detail.js";
|
||||||
parseClaudeCodeJsonOutput,
|
|
||||||
storeClaudeCodeDetail,
|
|
||||||
storeClaudeCodeRawOutput,
|
|
||||||
} from "./session-detail.js";
|
|
||||||
|
|
||||||
const CLAUDE_COMMAND = "claude";
|
const CLAUDE_COMMAND = "claude";
|
||||||
const CLAUDE_MAX_TURNS = 90;
|
const CLAUDE_MAX_TURNS = 90;
|
||||||
@@ -122,9 +118,9 @@ async function processClaudeOutput(stdout: string, store: Store): Promise<AgentR
|
|||||||
return { output, detailHash, sessionId };
|
return { output, detailHash, sessionId };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Non-JSON fallback
|
throw new Error(
|
||||||
const detailHash = await storeClaudeCodeRawOutput(store, stdout);
|
`Claude Code returned non-JSON output (first 200 chars): ${stdout.slice(0, 200)}`,
|
||||||
return { output: stdout, detailHash, sessionId: undefined };
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function runClaudeCode(ctx: AgentContext): Promise<AgentRunResult> {
|
async function runClaudeCode(ctx: AgentContext): Promise<AgentRunResult> {
|
||||||
|
|||||||
Reference in New Issue
Block a user