Capture text from step_finish message field in parse
OpenCode outputs the final response in step_finish.part.message, not just as type:text events. Added parsing of part.message to ensure the summary is captured when the agent responds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,19 @@ describe("parseOpenCodeJsonl", () => {
|
||||
expect(result.costUsd).toBeCloseTo(0.001);
|
||||
});
|
||||
|
||||
it("captures text from step_finish message field", () => {
|
||||
const stdout = [
|
||||
JSON.stringify({
|
||||
type: "step_finish",
|
||||
part: { message: "Final response text", tokens: { input: 10, output: 5 } },
|
||||
}),
|
||||
].join("\n");
|
||||
|
||||
const result = parseOpenCodeJsonl(stdout);
|
||||
|
||||
expect(result.summary).toBe("Final response text");
|
||||
});
|
||||
|
||||
it("captures errors from error type events", () => {
|
||||
const stdout = [
|
||||
JSON.stringify({ type: "error", error: { message: "Something went wrong" } }),
|
||||
|
||||
Reference in New Issue
Block a user