diff --git a/src/renderer/components/dialogs/settings-tabs/agents-preferences-tab.tsx b/src/renderer/components/dialogs/settings-tabs/agents-preferences-tab.tsx index 44a820eee..f66f386b0 100644 --- a/src/renderer/components/dialogs/settings-tabs/agents-preferences-tab.tsx +++ b/src/renderer/components/dialogs/settings-tabs/agents-preferences-tab.tsx @@ -16,9 +16,11 @@ import { } from "../../../lib/atoms" import { defaultAgentModeModelAtom, + defaultAgentModeThinkingAtom, defaultPlanModeModelAtom, + defaultPlanModeThinkingAtom, defaultReviewModeModelAtom, - lastSelectedClaudeThinkingAtom, + defaultReviewModeThinkingAtom, } from "../../../features/agents/atoms" import { CLAUDE_MODELS, @@ -179,9 +181,6 @@ function formatModelLabel(modelId: string, options: ModelOption[]): string { } export function AgentsPreferencesTab() { - const [claudeThinking, setClaudeThinking] = useAtom( - lastSelectedClaudeThinkingAtom, - ) const [soundEnabled, setSoundEnabled] = useAtom(soundNotificationsEnabledAtom) const [desktopNotificationsEnabled, setDesktopNotificationsEnabled] = useAtom(desktopNotificationsEnabledAtom) const [notifyWhenFocused, setNotifyWhenFocused] = useAtom(notifyWhenFocusedAtom) @@ -196,6 +195,15 @@ export function AgentsPreferencesTab() { const [defaultReviewModel, setDefaultReviewModel] = useAtom( defaultReviewModeModelAtom, ) + const [defaultPlanThinking, setDefaultPlanThinking] = useAtom( + defaultPlanModeThinkingAtom, + ) + const [defaultAgentThinking, setDefaultAgentThinking] = useAtom( + defaultAgentModeThinkingAtom, + ) + const [defaultReviewThinking, setDefaultReviewThinking] = useAtom( + defaultReviewModeThinkingAtom, + ) const hiddenModels = useAtomValue(hiddenModelsAtom) const modelOptions = useMemo( () => buildModelOptions(hiddenModels), @@ -244,38 +252,6 @@ export function AgentsPreferencesTab() { {/* Agent Behavior */}
-
- - Thinking Effort - - - Default effort level for Claude's reasoning. Higher levels think - longer and use more credits. - -
- -
-
Default Mode @@ -299,87 +275,158 @@ export function AgentsPreferencesTab() {
-
-
+
+
- Default Plan Mode Model + Default Plan - Model used when a chat starts or switches to Plan mode + Model and thinking effort applied when a chat starts or switches + to Plan mode
- +
+ + +
-
-
+
+
- Default Agent Mode Model + Default Agent - Model used when a chat starts or switches to Agent mode (e.g. after - approving a plan) + Model and thinking effort applied when a chat starts or switches + to Agent mode (e.g. after approving a plan)
- +
+ + +
-
-
+
+
- Default Review Mode Model + Default Review - Model used when running /review or /security-review + Model and thinking effort applied when running /review or + /security-review
- +
+ + +
diff --git a/src/renderer/features/agents/atoms/index.ts b/src/renderer/features/agents/atoms/index.ts index 00a03cbee..ff40a1f5c 100644 --- a/src/renderer/features/agents/atoms/index.ts +++ b/src/renderer/features/agents/atoms/index.ts @@ -297,6 +297,27 @@ export const lastSelectedClaudeThinkingAtom = atomWithStorage( + "preferences:default-plan-mode-thinking", + "high", + undefined, + { getOnInit: true }, +) + +export const defaultAgentModeThinkingAtom = atomWithStorage( + "preferences:default-agent-mode-thinking", + "high", + undefined, + { getOnInit: true }, +) + +export const defaultReviewModeThinkingAtom = atomWithStorage( + "preferences:default-review-mode-thinking", + "high", + undefined, + { getOnInit: true }, +) + // Storage for per-subChat Claude model selection. // Falls back to lastSelectedModelIdAtom when sub-chat has no explicit selection yet. const subChatModelIdsStorageAtom = atomWithStorage>( diff --git a/src/renderer/features/agents/lib/model-switching.ts b/src/renderer/features/agents/lib/model-switching.ts index d8c08fb26..b8f012333 100644 --- a/src/renderer/features/agents/lib/model-switching.ts +++ b/src/renderer/features/agents/lib/model-switching.ts @@ -1,10 +1,14 @@ import { appStore } from "../../../lib/jotai-store" -import type { AgentMode } from "../atoms" +import type { AgentMode, ClaudeThinkingPreference } from "../atoms" import { defaultAgentModeModelAtom, + defaultAgentModeThinkingAtom, defaultPlanModeModelAtom, + defaultPlanModeThinkingAtom, defaultReviewModeModelAtom, + defaultReviewModeThinkingAtom, lastSelectedAgentIdAtom, + subChatClaudeThinkingAtomFamily, subChatCodexModelIdAtomFamily, subChatModelIdAtomFamily, subChatProviderOverrideAtomFamily, @@ -35,6 +39,19 @@ export function getDefaultModelForMode(mode: ModeContext): string { } } +export function getDefaultThinkingForMode( + mode: ModeContext, +): ClaudeThinkingPreference { + switch (mode) { + case "plan": + return appStore.get(defaultPlanModeThinkingAtom) + case "agent": + return appStore.get(defaultAgentModeThinkingAtom) + case "review": + return appStore.get(defaultReviewModeThinkingAtom) + } +} + export function getSubChatModel(subChatId: string): string { return appStore.get(subChatModelIdAtomFamily(subChatId)) } @@ -70,5 +87,9 @@ export function applyModeDefaultModel( ): { modelId: string; provider: Provider } { const modelId = getDefaultModelForMode(mode) const provider = setSubChatModel(subChatId, modelId) + appStore.set( + subChatClaudeThinkingAtomFamily(subChatId), + getDefaultThinkingForMode(mode), + ) return { modelId, provider } } diff --git a/src/renderer/features/agents/main/active-chat.tsx b/src/renderer/features/agents/main/active-chat.tsx index d6c3994e4..c2f9a40c4 100644 --- a/src/renderer/features/agents/main/active-chat.tsx +++ b/src/renderer/features/agents/main/active-chat.tsx @@ -4663,7 +4663,7 @@ const ChatViewInner = memo(function ChatViewInner({ /> {/* Workspace subtitle: repo • branch */} {(workspaceRepoName || workspaceBranch) && ( -
+
{[workspaceRepoName, workspaceBranch].filter(Boolean).join(" • ")} @@ -4708,7 +4708,7 @@ const ChatViewInner = memo(function ChatViewInner({ >
-
+
-
+
{/* Queue indicator card - top card */} {queue.length > 0 && ( {isImporting ? ( @@ -7569,6 +7573,10 @@ Make sure to preserve all functionality from both branches when resolving confli onClick={() => setIsPreviewSidebarOpen(true)} className="h-6 w-6 p-0 hover:bg-foreground/10 transition-colors text-foreground flex-shrink-0 rounded-md ml-2" aria-label="Open preview" + style={{ + // @ts-expect-error - WebKit-specific property + WebkitAppRegion: "no-drag", + }} > @@ -7577,7 +7585,13 @@ Make sure to preserve all functionality from both branches when resolving confli ) : ( - + @@ -7625,6 +7643,10 @@ Make sure to preserve all functionality from both branches when resolving confli onClick={() => setIsTerminalSidebarOpen(true)} className="h-6 w-6 p-0 hover:bg-foreground/10 transition-colors text-foreground flex-shrink-0 rounded-md ml-2" aria-label="Open terminal" + style={{ + // @ts-expect-error - WebKit-specific property + WebkitAppRegion: "no-drag", + }} > @@ -7647,6 +7669,10 @@ Make sure to preserve all functionality from both branches when resolving confli disabled={restoreWorkspaceMutation.isPending} className="h-6 px-2 gap-1.5 hover:bg-foreground/10 transition-colors text-foreground flex-shrink-0 rounded-md ml-2 flex items-center" aria-label="Restore workspace" + style={{ + // @ts-expect-error - WebKit-specific property + WebkitAppRegion: "no-drag", + }} > Restore @@ -7846,7 +7872,7 @@ Make sure to preserve all functionality from both branches when resolving confli {/* Disabled input while loading */}
-
+
-
+
{ const modeDefaultId = getDefaultModelForMode(agentMode) const provider = getProviderForModelId(modeDefaultId) @@ -384,6 +386,7 @@ export function NewChatForm({ if (model && model.id !== selectedModel.id) { setSelectedModel(model) } + setLastSelectedClaudeThinking(getDefaultThinkingForMode(agentMode)) // Only fire on mode change — manual picks via setSelectedModel should not // be overridden by this effect re-running. // eslint-disable-next-line react-hooks/exhaustive-deps @@ -1717,7 +1720,7 @@ export function NewChatForm({
-
+
{/* Title - only show when project is selected */} {validatedProject && (
diff --git a/src/renderer/features/agents/ui/agent-plan-sidebar.tsx b/src/renderer/features/agents/ui/agent-plan-sidebar.tsx index 4d64b23e8..1025d05aa 100644 --- a/src/renderer/features/agents/ui/agent-plan-sidebar.tsx +++ b/src/renderer/features/agents/ui/agent-plan-sidebar.tsx @@ -62,7 +62,13 @@ export function AgentPlanSidebar({ return (
{/* Header */} -
+
@@ -546,6 +550,10 @@ export function TerminalSidebar({ onClick={closeSidebar} className="h-6 w-6 p-0 hover:bg-foreground/10 transition-[background-color,transform] duration-150 ease-out active:scale-[0.97] text-foreground flex-shrink-0 rounded-md" aria-label="Close terminal" + style={{ + // @ts-expect-error - WebKit-specific property + WebkitAppRegion: "no-drag", + }} >