Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
⏩ refactor: Clarify Steering Timing and First-Response Fallback (#16465)
lia-by-librechat[bot]33ee88e38cf1
diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsxindex b92787c0ad..17fc2c92fa 100644--- a/client/src/components/Chat/Input/ChatForm.tsx+++ b/client/src/components/Chat/Input/ChatForm.tsx@@ -203,6 +203,7 @@ const ChatForm = memo(function ChatForm({() => conversation?.conversationId ?? Constants.NEW_CONVO,[conversation?.conversationId],);+ const isNewConversation = conversationId === '' || conversationId === Constants.NEW_CONVO;/*** The quote feature merges excerpts server-side in `BaseClient.sendMessage`,* which the Assistants endpoints bypass — so hide the UI there rather than@@ -579,6 +580,7 @@ const ChatForm = memo(function ChatForm({ref={submitButtonRef}control={methods.control}steering={steering}+ isNewConversation={isNewConversation}getText={() => methods.getValues('text')}onConsumed={consumeComposer}disabled={filesLoading}@@ -899,6 +901,7 @@ const ChatForm = memo(function ChatForm({<div className="shrink-0"><InterruptSteerButtonsteering={steering}+ isNewConversation={isNewConversation}getText={() => methods.getValues('text')}onConsumed={consumeComposer}disabled={filesLoading}diff --git a/client/src/components/Chat/Input/DuringRunSendButton.tsx b/client/src/components/Chat/Input/DuringRunSendButton.tsxindex 0d0902e385..2b09f60c2d 100644--- a/client/src/components/Chat/Input/DuringRunSendButton.tsx+++ b/client/src/components/Chat/Input/DuringRunSendButton.tsx@@ -19,6 +19,7 @@ type ActionRow = SendAction;type DuringRunSendButtonProps = {control: Control<{ text: string }>;steering: SteeringControls;+ isNewConversation: boolean;getText: () => string;onConsumed: () => void;/** External hold (e.g. uploads in flight), mirroring the normal send button. */@@ -31,7 +32,8 @@ type DuringRunSendButtonProps = {* composer holds text — submitting steers or queues per the effective action.* Hovering it reveals the full action list with its shortcuts: steer, queue* (⌘/Ctrl+Enter routes to the non-default action), interrupt & steer- * (⌘/Ctrl+Shift+Enter — stops writing now but keeps what is written), and+ * (⌘/Ctrl+Shift+Enter — requests an earlier safe point when a conversation+ * exists, otherwise stops and sends a new turn), and* interrupt & send (⌥/Alt+Enter — discards the answer and starts over).* Clearing the composer restores the Stop button.*/@@ -137,10 +139,12 @@ const DuringRunSendButton = React.memo(icon: <Clock className="h-4 w-4 text-status-info" aria-hidden="true" />,onClick: () => runAction((text) => steering.queueFromComposer(text)),};- /** Keeps the half-written answer, unlike interrupt & send below it. */+ /** When steering is available, keeps visible text; a new chat instead hard-stops. */const interruptSteerRow: ActionRow = {key: 'interrupt-steer',- label: localize('com_ui_interrupt_steer'),+ label: localize(+ props.isNewConversation ? 'com_ui_steer_first_turn_stop' : 'com_ui_interrupt_steer',+ ),kbd: interruptSteerKbd,icon: <ZapOff className="h-4 w-4 text-status-warning" aria-hidden="true" />,// Matches the standalone button's gate, and deliberately NOTdiff --git a/client/src/components/Chat/Input/InterruptSteerButton.tsx b/client/src/components/Chat/Input/InterruptSteerButton.tsxindex 1d52212a7c..289f025487 100644--- a/client/src/components/Chat/Input/InterruptSteerButton.tsx+++ b/client/src/components/Chat/Input/InterruptSteerButton.tsx@@ -7,6 +7,7 @@ import { cn } from '~/utils';type InterruptSteerButtonProps = {steering: SteeringControls;+ isNewConversation: boolean;getText: () => string;onConsumed: () => void;/** External hold (e.g. uploads in flight), mirroring the send button. */@@ -14,10 +15,9 @@ type InterruptSteerButtonProps = {};/**- * Always-visible composer control with one fixed meaning: stop writing now,- * keep what is written, and steer from here. Distinct from the send button's- * hovercard, whose primary action follows the user's during-run preference —- * this one never changes what it does.+ * Always-visible composer control for earlier steering. Before a conversation+ * exists, steering cannot reach the run, so this control instead stops the+ * response and sends a new turn. Its label must reflect that fallback.** `type="button"`: the composer footer sits inside the chat form, and only* `DuringRunSendButton` may receive Enter's synthetic submit.@@ -25,7 +25,9 @@ type InterruptSteerButtonProps = {const InterruptSteerButton = React.memo((props: InterruptSteerButtonProps) => {const localize = useLocalize();const { steering } = props;- const label = localize('com_ui_interrupt_steer_button');+ const label = localize(+ props.isNewConversation ? 'com_ui_steer_first_turn_stop' : 'com_ui_interrupt_steer_button',+ );/** Pre-empts the server's 409: a paused run cannot accept a steer. */const disabled =props.disabled === true || steering.pausedOnApproval || !steering.canControlGeneration;@@ -63,7 +65,11 @@ const InterruptSteerButton = React.memo((props: InterruptSteerButtonProps) => {}/><Ariakit.Tooltip className="z-50 rounded-lg bg-surface-tertiary px-2 py-1 text-xs text-text-primary shadow-lg">- {localize('com_ui_interrupt_steer_desc')}+ {localize(+ props.isNewConversation+ ? 'com_ui_steer_first_turn_stop_info'+ : 'com_ui_interrupt_steer_desc',+ )}</Ariakit.Tooltip></Ariakit.TooltipProvider>);diff --git a/client/src/components/Chat/Input/__tests__/DuringRunSendButton.test.tsx b/client/src/components/Chat/Input/__tests__/DuringRunSendButton.test.tsxindex b7050cb87d..bf768de632 100644--- a/client/src/components/Chat/Input/__tests__/DuringRunSendButton.test.tsx+++ b/client/src/components/Chat/Input/__tests__/DuringRunSendButton.test.tsx@@ -52,12 +52,19 @@ const steeringStub = ({interruptAndSend: mockInterruptAndSend,}) as unknown as SteeringControls;-function Harness({ steering }: { steering: SteeringControls }) {+function Harness({+ steering,+ isNewConversation,+}: {+ steering: SteeringControls;+ isNewConversation: boolean;+}) {const methods = useForm<{ text: string }>({ defaultValues: { text: TEXT } });return (<DuringRunSendButtoncontrol={methods.control}steering={steering}+ isNewConversation={isNewConversation}getText={() => TEXT}onConsumed={mockOnConsumed}/>@@ -69,6 +76,7 @@ type MenuOptions = StubOptions & {enterToSend?: boolean;shortcutsEnabled?: boolean;customShortcuts?: Record<string, ShortcutOverride>;+ isNewConversation?: boolean;};function openMenu(options: MenuOptions = {}) {@@ -77,6 +85,7 @@ function openMenu(options: MenuOptions = {}) {enterToSend = true,shortcutsEnabled = true,customShortcuts = {},+ isNewConversation = false,...stub} = options;render(@@ -88,10 +97,12 @@ function openMenu(options: MenuOptions = {}) {set(store.customShortcuts, customShortcuts);}}>- <Harness steering={steeringStub(stub)} />+ <Harness steering={steeringStub(stub)} isNewConversation={isNewConversation} /></RecoilRoot>,);- expect(screen.getByText('com_ui_interrupt_steer')).toBeInTheDocument();+ expect(+ screen.getByText(isNewConversation ? 'com_ui_steer_first_turn_stop' : 'com_ui_interrupt_steer'),+ ).toBeInTheDocument();}beforeEach(() => {@@ -121,10 +132,11 @@ describe('DuringRunSendButton — Interrupt & steer availability', () => {* `interruptSteer` deliberately falls back to interrupt & send — disabling* the row there would make it dead for the whole first turn.*/- test('keeps Interrupt & steer live before a conversation exists', () => {- openMenu({ pausedOnApproval: false, canSteer: false });+ test('labels the first-response fallback as stop and send without changing its action', () => {+ openMenu({ pausedOnApproval: false, canSteer: false, isNewConversation: true });- const row = screen.getByText('com_ui_interrupt_steer').closest('button');+ expect(screen.queryByText('com_ui_interrupt_steer')).not.toBeInTheDocument();+ const row = screen.getByText('com_ui_steer_first_turn_stop').closest('button');expect(row).toHaveAttribute('aria-disabled', 'false');fireEvent.click(row as HTMLButtonElement);diff --git a/client/src/components/Chat/Input/__tests__/InterruptSteerButton.test.tsx b/client/src/components/Chat/Input/__tests__/InterruptSteerButton.test.tsxnew file mode 100644index 0000000000..b0576b143a--- /dev/null+++ b/client/src/components/Chat/Input/__tests__/InterruptSteerButton.test.tsx@@ -0,0 +1,68 @@+import React from 'react';+import { render, screen, fireEvent } from '@testing-library/react';+import type { SteeringControls } from '~/hooks/Chat/useSteering';+import InterruptSteerButton from '../InterruptSteerButton';+import en from '~/locales/en/translation.json';++jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+}));++jest.mock('@ariakit/react', () => ({+ TooltipProvider: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,+ TooltipAnchor: ({ render }: { render: React.ReactElement }) => render,+ Tooltip: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,+}));++const interruptSteer = jest.fn(() => true);+const onConsumed = jest.fn();+const steering = {+ pausedOnApproval: false,+ canControlGeneration: true,+ interruptSteer,+} as unknown as SteeringControls;++beforeEach(() => {+ jest.clearAllMocks();+});++test('the first response advertises the actual stop-and-send fallback', () => {+ render(+ <InterruptSteerButton+ steering={steering}+ isNewConversation+ getText={() => 'please change course'}+ onConsumed={onConsumed}+ />,+ );++ expect(screen.getByRole('button', { name: 'com_ui_steer_first_turn_stop' })).toBeEnabled();+ expect(screen.getByText('com_ui_steer_first_turn_stop_info')).toBeInTheDocument();+ fireEvent.click(screen.getByRole('button', { name: 'com_ui_steer_first_turn_stop' }));+ expect(interruptSteer).toHaveBeenCalledWith('please change course');+ expect(onConsumed).toHaveBeenCalledTimes(1);+});++test('an established conversation advertises earlier steering instead', () => {+ render(+ <InterruptSteerButton+ steering={steering}+ isNewConversation={false}+ getText={() => 'please change course'}+ onConsumed={onConsumed}+ />,+ );++ expect(screen.getByRole('button', { name: 'com_ui_interrupt_steer_button' })).toBeEnabled();+ expect(screen.getByText('com_ui_interrupt_steer_desc')).toBeInTheDocument();+ expect(screen.queryByText('com_ui_steer_first_turn_stop_info')).not.toBeInTheDocument();+});++test('English copy distinguishes requested steering, running tools, and reasoning restarts', () => {+ expect(en.com_ui_steer_in_flight_preempt).toBe('Steer sooner requested');+ expect(en.com_ui_steer_interrupting_info).toMatch(/may pause a text reply/);+ expect(en.com_ui_steer_interrupting_info).toMatch(/restart an attempt.*only reasoning/);+ expect(en.com_ui_steer_interrupting_info).toMatch(/Running tools finish first/);+ expect(en.com_ui_steer_first_turn_stop_info).toMatch(/new turn/);+ expect(en.com_nav_info_during_run_action).toContain(en.com_ui_steer_interrupts_default);+});diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.jsonindex 65e8393b11..b31bcbd938 100644--- a/client/src/locales/en/translation.json+++ b/client/src/locales/en/translation.json@@ -757,7 +757,7 @@"com_nav_info_collapse_user_messages": "When enabled, long user messages render collapsed to a preview with a Show more option, so pasted text or code cannot dominate the conversation. The full text stays in the page, ready to copy or search.","com_nav_info_copy_rich_text": "When enabled, copying a message also places a formatted version on the clipboard, so headings, lists, tables and code keep their styling when pasted into apps that do not support Markdown, such as Teams, Outlook or Word.","com_nav_info_default_temporary_chat": "When enabled, new chats will start with temporary chat mode activated by default. Temporary chats are not saved to your history.",- "com_nav_info_during_run_action": "Choose what pressing Enter does while the assistant is still responding. \"Steer the response\" inserts your message into the current response at its next step; \"Queue for after\" sends it as a new turn once the response finishes. You can always override this per message from the send button.",+ "com_nav_info_during_run_action": "Choose what Enter does while the assistant responds. \"Steer the response\" usually waits for the next tool step or an end-of-response opportunity. Turn on \"Steer sooner on Enter\" to request an earlier safe point. \"Queue for after\" sends a new turn once the response finishes. The send button lets you choose per message.","com_nav_info_enter_to_send": "When enabled, pressing `ENTER` will send your message. When disabled, pressing Enter will add a new line, and you'll need to press `CTRL + ENTER` / `⌘ + ENTER` to send your message.","com_nav_info_fork_change_default": "`Visible messages only` includes just the direct path to the selected message. `Include related branches` adds branches along the path. `Include all to/from here` includes all connected messages and branches.","com_nav_info_fork_split_target_setting": "When enabled, forking will commence from the target message to the latest message in the conversation, according to the behavior selected.",@@ -1077,7 +1077,7 @@"com_ui_all_projects": "All projects","com_ui_all_proper": "All","com_ui_all_turns": "All turns",- "com_ui_always_interrupt": "Always interrupt instead",+ "com_ui_always_interrupt": "Steer sooner by default","com_ui_analyzing": "Analyzing","com_ui_analyzing_finished": "Finished analyzing","com_ui_api_key": "API Key",@@ -1688,10 +1688,10 @@"com_ui_input": "Input","com_ui_instructions": "Instructions","com_ui_interrupt_send": "Interrupt & send",- "com_ui_interrupt_steer": "Interrupt & steer",- "com_ui_interrupt_steer_button": "Interrupt and steer the response",- "com_ui_interrupt_steer_desc": "Stops writing now and keeps what's written",- "com_ui_interrupt_steer_now": "Interrupt & steer now",+ "com_ui_interrupt_steer": "Steer sooner",+ "com_ui_interrupt_steer_button": "Steer this response sooner",+ "com_ui_interrupt_steer_desc": "Tries to steer at the next safe point. Running tools finish first.",+ "com_ui_interrupt_steer_now": "Steer sooner","com_ui_invalid_json": "Invalid JSON","com_ui_invocation_auto": "Auto","com_ui_invocation_auto_info": "The skill is automatically applied by the agent when relevant to the conversation",@@ -2548,8 +2548,8 @@"com_ui_steer": "Steer","com_ui_steer_already_applied": "That steering message already reached the agent, so it was left in the response","com_ui_steer_applied_info": "Applied. The agent received this message while it was responding.",- "com_ui_steer_arm_lost_race": "The interrupt could not be armed. The steering message may already have moved on or may still be waiting for the next tool step",- "com_ui_steer_arm_unconfirmed": "Couldn't confirm whether the interrupt was armed. The steering message may interrupt or may wait for the next tool step",+ "com_ui_steer_arm_lost_race": "Could not request earlier steering. Your message may already have been applied or may still be waiting for the next step",+ "com_ui_steer_arm_unconfirmed": "Couldn't confirm the earlier-steering request. Your message may be applied sooner or may wait for the next step","com_ui_steer_cancel": "Cancel steering message","com_ui_steer_recovery_held": "Recovery paused","com_ui_steer_recovery_copy_refused": "Could not copy the recovery into the composer. Your draft or active chat may have changed; the recovery remains paused.",@@ -2558,18 +2558,20 @@"com_ui_steer_dismiss_recovery": "Dismiss recovery in this tab","com_ui_steer_cancel_failed": "Could not cancel the steering message — it may still reach the agent","com_ui_steer_delivered": "Delivered",- "com_ui_steer_delivered_info": "Delivered. Your message will join the response at the next safe moment.",+ "com_ui_steer_delivered_info": "Delivered. Your message can join this response at the next tool step or, when possible, before it finishes.","com_ui_steer_delivery_unconfirmed": "Delivery unconfirmed","com_ui_steer_edit_queued": "Your composer already has a draft, so that steering message was queued for after the response instead","com_ui_steer_failed": "Steering failed",+ "com_ui_steer_first_turn_stop": "Stop & send (first response)",+ "com_ui_steer_first_turn_stop_info": "Steering isn't available yet. Stops this response and sends your message as a new turn.","com_ui_steer_in_flight": "Steering",- "com_ui_steer_in_flight_preempt": "Interrupting",- "com_ui_steer_interrupting_info": "Interrupt requested. The response will stop at the next safe point, then your message takes over. Reasoning and tool calls are not interrupted. To interrupt them, stop the response instead.",- "com_ui_steer_interrupts_default": "Steering interrupts generation",- "com_ui_steer_interrupts_default_info": "When on, Enter stops the response at the next safe point instead of waiting for the agent's next tool step. Either way the partial answer is kept and the response continues.",- "com_ui_steer_interrupts_enable_info": "Switches the during-run default to steering and stops the response at the next safe point. The partial answer is kept and the response continues.",+ "com_ui_steer_in_flight_preempt": "Steer sooner requested",+ "com_ui_steer_interrupting_info": "Earlier steering requested. The agent may pause a text reply at a safe point or restart an attempt that has produced only reasoning. Running tools finish first. If it cannot pause, your message waits for the next tool step or an end-of-response opportunity.",+ "com_ui_steer_interrupts_default": "Steer sooner on Enter",+ "com_ui_steer_interrupts_default_info": "When steering is the default, Enter requests an earlier safe point instead of waiting for the next tool step. Running tools finish first; a thinking-only attempt may restart. Text already shown is kept.",+ "com_ui_steer_interrupts_enable_info": "Makes steering the Enter default and requests an earlier safe point. Running tools finish first; a thinking-only attempt may restart. Text already shown is kept.","com_ui_steer_paused_queued": "The agent is waiting for your review — your message was queued instead",- "com_ui_steer_preempt_unsupported": "This deployment can't interrupt mid-response, so that steering message stays queued for the next tool step",+ "com_ui_steer_preempt_unsupported": "This deployment can't steer mid-response. Your message waits for the next tool step or an end-of-response opportunity","com_ui_steer_queued_info": "Sends when this response finishes","com_ui_steer_retry": "Retry steering","com_ui_steer_send": "Steer the current response",@@ -2945,7 +2947,7 @@"com_ui_wakeup_task_finished": "Background task finished","com_ui_wakeup_tasks_finished": "{{0}} background tasks finished","com_ui_wakeup_view_activity": "View activity",- "com_ui_wait_for_tool_steps": "Wait for tool steps instead",+ "com_ui_wait_for_tool_steps": "Wait for the next step instead","com_ui_web_search": "Web Search","com_ui_web_search_cohere_key": "Enter Cohere API Key","com_ui_web_search_firecrawl_url": "Firecrawl API URL (optional)",