From 4bd56b8ad81bc92506c8aade1d2a5e38ac4cc113 Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Thu, 30 Jul 2026 16:34:38 +0900 Subject: [PATCH] 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. --- scripts/e2e/mock-openai-server.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/e2e/mock-openai-server.mjs b/scripts/e2e/mock-openai-server.mjs index 65f0bddaf42f..6f0edd7af280 100644 --- a/scripts/e2e/mock-openai-server.mjs +++ b/scripts/e2e/mock-openai-server.mjs @@ -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,