mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 07:51:35 +00:00
test(e2e): tag the mock Responses preamble with its wire phase
The mock streamed pre-tool assistant text on the Responses path without `phase: "commentary"`, the field the API sets and the transport reads, so the draft-proof scenario ran green while never exercising the preamble lane on that transport. Proven live on Telegram: the preamble now renders as the status headline, and as a commentary line when progress.commentary is on.
This commit is contained in:
@@ -149,6 +149,9 @@ function buildMockFunctionCall(name, args) {
|
||||
// commentary, which channels render as the draft's status headline. Streaming
|
||||
// text and then a call in one response is the only way to exercise
|
||||
// headline-plus-tool-line composition without a live model.
|
||||
// The Responses API carries that tag as `phase` on the message item, and the
|
||||
// transport reads it straight off the item, so an untagged item produces no
|
||||
// preamble at all and the scenario silently proves nothing.
|
||||
function preambleThenToolCallEvents(preamble, name, args) {
|
||||
const messageItemId = "msg_e2e_preamble";
|
||||
const call = buildMockFunctionCall(name, args);
|
||||
@@ -184,6 +187,7 @@ function preambleThenToolCallEvents(preamble, name, args) {
|
||||
id: messageItemId,
|
||||
role: "assistant",
|
||||
status: "completed",
|
||||
phase: "commentary",
|
||||
content: [{ type: "output_text", text: preamble, annotations: [] }],
|
||||
},
|
||||
},
|
||||
@@ -210,6 +214,7 @@ function preambleThenToolCallEvents(preamble, name, args) {
|
||||
id: messageItemId,
|
||||
role: "assistant",
|
||||
status: "completed",
|
||||
phase: "commentary",
|
||||
content: [{ type: "output_text", text: preamble, annotations: [] }],
|
||||
},
|
||||
call.item,
|
||||
|
||||
Reference in New Issue
Block a user