test: cover one-chunk progress final payload · openclaw/openclaw@6ebe91d
compoodment
·
2026-05-18
·
via Recent Commits to openclaw:main
File tree
src/agents/pi-embedded-runner/run
| Original file line number | Diff line number | Diff line change |
|---|
@@ -116,6 +116,38 @@ describe("buildEmbeddedRunPayloads tool-error warnings", () => {
|
116 | 116 | ); |
117 | 117 | }); |
118 | 118 | |
| 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 | + |
119 | 151 | it("keeps a current one-chunk reply when only a stale transcript assistant is available", () => { |
120 | 152 | const payloads = buildPayloads({ |
121 | 153 | assistantTexts: ["Current room event reply."], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。