From 58aa2015e4c1dfb81424b79293c7d22ac14a1e5e Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 15 Nov 2026 10:36:20 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20feat:=20Let=20a=20Chat=20Contrac?= =?UTF-8?q?t=20Say=20the=20Reader=20Takes=20No=20Turns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/parts/ToolCallLimitNotice.tsx | 5 ++++- .../parts/__tests__/ToolCallLimitNotice.spec.tsx | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/chat/src/components/parts/ToolCallLimitNotice.tsx b/packages/chat/src/components/parts/ToolCallLimitNotice.tsx index b0c43800b04..ab0c543ba1d 100644 --- a/packages/chat/src/components/parts/ToolCallLimitNotice.tsx +++ b/packages/chat/src/components/parts/ToolCallLimitNotice.tsx @@ -56,7 +56,10 @@ export default function ToolCallLimitNotice({ * Same gate `useGenerationsByLatest` applies to the Continue hover button. */ const canAct = - chat?.ask != null && chat.isSubmitting !== true && chat.latestMessageId === message.messageId; + chat?.ask != null && + chat.readOnly !== true && + chat.isSubmitting !== true && + chat.latestMessageId === message.messageId; /** * Empty overrides are authoritative: a recovery prompt is not the user's next * compose, so `ask` must not attach or drain files, skills, or quotes already diff --git a/packages/chat/src/components/parts/__tests__/ToolCallLimitNotice.spec.tsx b/packages/chat/src/components/parts/__tests__/ToolCallLimitNotice.spec.tsx index 2bbe830ac60..2ece8327455 100644 --- a/packages/chat/src/components/parts/__tests__/ToolCallLimitNotice.spec.tsx +++ b/packages/chat/src/components/parts/__tests__/ToolCallLimitNotice.spec.tsx @@ -103,6 +103,22 @@ describe('ToolCallLimitNotice', () => { ); }); + it('offers no actions in a conversation the reader takes no turn in', () => { + renderNotice({ + ask: jest.fn(), + readOnly: true, + isSubmitting: false, + latestMessageId: 'response-1', + }); + + expect( + screen.queryByRole('button', { name: TRANSLATIONS.com_ui_tool_call_limit_continue }), + ).toBeNull(); + expect( + screen.queryByRole('button', { name: TRANSLATIONS.com_ui_tool_call_limit_answer }), + ).toBeNull(); + }); + it('offers no actions with no live chat behind it, as in a shared link or export', () => { renderNotice();