Skip to content

Commit 6ebe91d

Browse files
compoodmentsteipete
authored andcommitted
test: cover one-chunk progress final payload
1 parent 2d2c420 commit 6ebe91d

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎src/agents/pi-embedded-runner/run/payloads.test.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,38 @@ describe("buildEmbeddedRunPayloads tool-error warnings", () => {
116116
);
117117
});
118118

119+
it("uses the final assistant answer when one streamed text contains progress and final text", () => {
120+
const payloads = buildPayloads({
121+
assistantTexts: ["Need inspect.\n\nDone."],
122+
lastAssistant: {
123+
role: "assistant",
124+
stopReason: "stop",
125+
content: [
126+
{
127+
type: "text",
128+
text: "Need inspect.",
129+
textSignature: JSON.stringify({
130+
v: 1,
131+
id: "item_commentary",
132+
phase: "commentary",
133+
}),
134+
},
135+
{
136+
type: "text",
137+
text: "Done.",
138+
textSignature: JSON.stringify({
139+
v: 1,
140+
id: "item_final",
141+
phase: "final_answer",
142+
}),
143+
},
144+
],
145+
} as AssistantMessage,
146+
});
147+
148+
expectSinglePayloadText(payloads, "Done.");
149+
});
150+
119151
it("keeps a current one-chunk reply when only a stale transcript assistant is available", () => {
120152
const payloads = buildPayloads({
121153
assistantTexts: ["Current room event reply."],

0 commit comments

Comments
 (0)