Python
Composer answers an open question
Rohit C Prasad8da29af0795d
diff --git a/surfaces/gui/e2e/fixtures.ts b/surfaces/gui/e2e/fixtures.tsindex e3d4fc19..e7fb1b1f 100644--- a/surfaces/gui/e2e/fixtures.ts+++ b/surfaces/gui/e2e/fixtures.ts@@ -935,6 +935,10 @@ export async function mockApi(page: import("@playwright/test").Page) {send("assistant_message", { text: `Done via ${pendingTool} [decision=${msg.decision}]` });}send("turn_done");+ } else if (msg.type === "question_response") {+ // ask_user answered (card or composer): echo it so specs can see what arrived.+ send("assistant_message", { text: `Got your answer: ${msg.answer}` });+ send("turn_done");} else if (msg.type === "items_response") {if (msg.approved) {seedBoard(); // "created on the board" — the board fetch now shows themdiff --git a/surfaces/gui/e2e/question-composer.spec.ts b/surfaces/gui/e2e/question-composer.spec.tsnew file mode 100644index 00000000..a0fb0595--- /dev/null+++ b/surfaces/gui/e2e/question-composer.spec.ts@@ -0,0 +1,23 @@+import { expect } from "@playwright/test";+import { test, sendSessionEvent } from "./fixtures";++// While an ask_user question is open, the composer answers it (owner-hit 2026-10-06):+// before, Enter did nothing, and a question with allow_text false left nowhere to type.+for (const allowText of [false, true]) {+ test(`a typed composer reply answers an open question (allow_text ${allowText})`, async ({ page }) => {+ await page.goto("/");+ await sendSessionEvent(page, { type: "turn_start", data: {} });+ await sendSessionEvent(page, {+ type: "question_requested",+ data: { question: "Which color theme?", options: ["Light", "Dark"], allow_text: allowText, multi: false },+ });+ await expect(page.getByText("Which color theme?")).toBeVisible();+ const composer = page.getByPlaceholder("Type your answer — or pick an option above");+ await expect(composer).toBeVisible();+ await composer.fill("Something warm, like sepia");+ await composer.press("Enter");+ await expect(page.getByText("Got your answer: Something warm, like sepia")).toBeVisible();+ await expect(composer).toHaveCount(0);+ await expect(page.getByPlaceholder(/Ask the coworker/)).toHaveValue("");+ });+}diff --git a/surfaces/gui/src/App.tsx b/surfaces/gui/src/App.tsxindex 2d7a87ef..4aa72a36 100644--- a/surfaces/gui/src/App.tsx+++ b/surfaces/gui/src/App.tsx@@ -1387,6 +1387,14 @@ export function App() {respondItemsReq(false, text);return;}+ // The same for an open ask_user question: what the user types in the composer is+ // the answer. Before this, Enter did nothing while a question was up, and a+ // question sent with allow_text false left no other place to type (owner-hit+ // 2026-10-06).+ if (!unattended && pendingQuestion?.kind === "question" && !attachments?.length && !skill) {+ answerQuestion(text);+ return;+ }// Force-run shows exactly what the user typed: "/name rest". Must match the server's// `display` sidecar formula so the turn_start dedupe recognizes the local echo.const shown = skill ? `/${skill}${text ? ` ${text}` : ""}` : text;@@ -2444,7 +2452,8 @@ export function App() {openSettings("models");}}running={running}- gateOpen={!unattended && (!!pendingTeam || !!pendingItemsReq)}+ gateOpen={!unattended && (!!pendingTeam || !!pendingItemsReq || !!pendingQuestion)}+ gateKind={!unattended && pendingQuestion && !pendingTeam && !pendingItemsReq ? "question" : "proposal"}// An offline machine's cached transcript is read-only: the send// path is dead by construction, so say so explicitly rather than// letting a hopeful socket state enable the button.diff --git a/surfaces/gui/src/components/Composer.tsx b/surfaces/gui/src/components/Composer.tsxindex 2fa67e42..ea7639b3 100644--- a/surfaces/gui/src/components/Composer.tsx+++ b/surfaces/gui/src/components/Composer.tsx@@ -110,6 +110,9 @@ interface Props {// so `running` is true — but typing must stay possible, because a typed reply// IS an answer (decline-with-feedback). Unblocks Send while the gate is up.gateOpen?: boolean;+ // What the open gate is, for the placeholder: a proposal to adjust, or a question+ // whose answer the composer sends.+ gateKind?: "proposal" | "question";connected: boolean;// False when the default model's provider has no key — the composer shows a "connect a model"// banner and routes sends to setup (preserving the draft) instead of dropping them.@@ -671,7 +674,7 @@ export function Composer(props: Props) {className="w-full block px-3.5 pt-3.5 pb-1.5 text-body"placeholder={props.gateOpen- ? t("composer.placeholder_gate")+ ? t(props.gateKind === "question" ? "composer.placeholder_question" : "composer.placeholder_gate"): props.placeholder || t("composer.placeholder")}value={text}diff --git a/surfaces/gui/src/locales/en.json b/surfaces/gui/src/locales/en.jsonindex 15400b85..9900afa5 100644--- a/surfaces/gui/src/locales/en.json+++ b/surfaces/gui/src/locales/en.json@@ -214,6 +214,7 @@"session_only_note": "Other sessions keep the model's own setting.","change_defaults": "Change the model's defaults…"},+ "placeholder_question": "Type your answer — or pick an option above","placeholder_gate": "Reply to adjust the proposal — or use the buttons above","attach_this_message": "This message","attach_this_session": "This session",diff --git a/surfaces/gui/src/locales/zh.json b/surfaces/gui/src/locales/zh.jsonindex 909fc665..c4902c01 100644--- a/surfaces/gui/src/locales/zh.json+++ b/surfaces/gui/src/locales/zh.json@@ -212,6 +212,7 @@"session_only_note": "其他会话保持模型自身的设置。","change_defaults": "更改模型的默认设置…"},+ "placeholder_question": "输入你的回答 —— 或选择上方的选项","placeholder_gate": "回复以调整提案 —— 或使用上方按钮","attach_this_message": "本条消息","attach_this_session": "本次会话",