From 931cd192f94a83987703f8c191ff1d41a44023e7 Mon Sep 17 00:00:00 2001 From: Serhii Vecherenko Date: Mon, 10 Aug 2026 23:40:43 -0700 Subject: [PATCH] fix(thread): include explicit fast=false in draft launch config - Always emit fast when the selected agent supports usable fast mode - Add coverage for Fast-off selection in ThreadDraftView submit path --- .../thread/ThreadDraftView.test.tsx | 42 +++++++++++++++++++ .../components/thread/ThreadDraftView.tsx | 6 ++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/thread/ThreadDraftView.test.tsx b/src/renderer/components/thread/ThreadDraftView.test.tsx index ef3ef9bf9..91d28580c 100644 --- a/src/renderer/components/thread/ThreadDraftView.test.tsx +++ b/src/renderer/components/thread/ThreadDraftView.test.tsx @@ -960,6 +960,48 @@ describe("ThreadDraftView", () => { }); }); + it("submits an explicit Fast-off selection in the launch config", async () => { + const onStart = vi.fn<(input: unknown) => void>(); + + render( + , + ); + + await waitFor(() => { + const props = composerSpy.mock.lastCall?.[0] as { + controls: Array<{ kind?: string; currentModel?: string }>; + }; + expect( + props.controls.some( + (control) => control.kind === "provider-model" && control.currentModel === "composer-2", + ), + ).toBe(true); + }); + + fireEvent.click(screen.getByText("set-prompt")); + fireEvent.click(screen.getByText("submit")); + + expect(onStart).toHaveBeenCalledWith( + expect.objectContaining({ + config: expect.objectContaining({ fast: false }), + }), + ); + }); + it("keeps a globally disabled built-in out of the composer and launch config", async () => { const onStart = vi.fn<(input: unknown) => void>(); useSharedSettings.setState({ diff --git a/src/renderer/components/thread/ThreadDraftView.tsx b/src/renderer/components/thread/ThreadDraftView.tsx index bf25715dd..db5dfbc3f 100644 --- a/src/renderer/components/thread/ThreadDraftView.tsx +++ b/src/renderer/components/thread/ThreadDraftView.tsx @@ -43,6 +43,7 @@ import { resolvePreferredAgentKind, resolveProviderDraftConfig, resolveSavedProviderDraftConfig, + supportsUsableFastMode, resolveThinkingValue, } from "./threadDraftViewHelpers"; import { friendlyError } from "@/shared/messages"; @@ -1075,7 +1076,10 @@ export function ThreadDraftView(props: { model, ...(effort ? { effort } : {}), ...(contextSize ? { contextSize } : {}), - ...(fast ? { fast } : {}), + ...(selectedAgentForConfig && + supportsUsableFastMode(selectedAgentForConfig.capabilities, model) + ? { fast } + : {}), ...(thinking ? { thinking } : {}), ...(mode ? { mode } : {}), ...(approvalPolicy ? { approvalPolicy } : {}),