Skip to content

Commit b212408

Browse files
authored
fix: Remove unused task execution settings (#578)
Am I crazy? Neither of these settings are used / have any effect when they are turned on or off?
1 parent c6b094c commit b212408

8 files changed

Lines changed: 40 additions & 102 deletions

File tree

apps/twig/src/main/services/agent/schemas.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const startSessionInput = z.object({
4343
model: z.string().optional(),
4444
executionMode: z.enum(["plan", "acceptEdits", "default"]).optional(),
4545
runMode: z.enum(["local", "cloud"]).optional(),
46-
createPR: z.boolean().optional(),
4746
/** Additional directories Claude can access beyond cwd (for worktree support) */
4847
additionalDirectories: z.array(z.string()).optional(),
4948
});

apps/twig/src/renderer/features/settings/components/SettingsView.tsx

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,10 @@ export function SettingsView() {
5555
const isDarkMode = useThemeStore((state) => state.isDarkMode);
5656
const toggleDarkMode = useThemeStore((state) => state.toggleDarkMode);
5757
const {
58-
autoRunTasks,
59-
createPR,
6058
cursorGlow,
6159
desktopNotifications,
6260
autoConvertLongText,
6361
sendMessagesWith,
64-
setAutoRunTasks,
65-
setCreatePR,
6662
setCursorGlow,
6763
setDesktopNotifications,
6864
setAutoConvertLongText,
@@ -106,30 +102,6 @@ export function SettingsView() {
106102
}, [worktreeLocation]);
107103

108104
// Tracked settings handlers
109-
const handleAutoRunChange = useCallback(
110-
(checked: boolean) => {
111-
track(ANALYTICS_EVENTS.SETTING_CHANGED, {
112-
setting_name: "auto_run_tasks",
113-
new_value: checked,
114-
old_value: autoRunTasks,
115-
});
116-
setAutoRunTasks(checked);
117-
},
118-
[autoRunTasks, setAutoRunTasks],
119-
);
120-
121-
const handleCreatePRChange = useCallback(
122-
(checked: boolean) => {
123-
track(ANALYTICS_EVENTS.SETTING_CHANGED, {
124-
setting_name: "create_pr",
125-
new_value: checked,
126-
old_value: createPR,
127-
});
128-
setCreatePR(checked);
129-
},
130-
[createPR, setCreatePR],
131-
);
132-
133105
const handleDarkModeChange = useCallback(() => {
134106
track(ANALYTICS_EVENTS.SETTING_CHANGED, {
135107
setting_name: "dark_mode",
@@ -437,49 +409,6 @@ export function SettingsView() {
437409

438410
<Box className="border-gray-6 border-t" />
439411

440-
{/* Task Execution Section */}
441-
<Flex direction="column" gap="3">
442-
<Heading size="3">Task execution</Heading>
443-
<Card>
444-
<Flex direction="column" gap="4">
445-
<Flex align="center" justify="between">
446-
<Flex direction="column" gap="1">
447-
<Text size="1" weight="medium">
448-
Auto-run new tasks
449-
</Text>
450-
<Text size="1" color="gray">
451-
Automatically start tasks after creation
452-
</Text>
453-
</Flex>
454-
<Switch
455-
checked={autoRunTasks}
456-
onCheckedChange={handleAutoRunChange}
457-
size="1"
458-
/>
459-
</Flex>
460-
461-
<Flex align="center" justify="between">
462-
<Flex direction="column" gap="1">
463-
<Text size="1" weight="medium">
464-
Create PR for local runs
465-
</Text>
466-
<Text size="1" color="gray">
467-
Automatically create a pull request when local tasks
468-
complete
469-
</Text>
470-
</Flex>
471-
<Switch
472-
checked={createPR}
473-
onCheckedChange={handleCreatePRChange}
474-
size="1"
475-
/>
476-
</Flex>
477-
</Flex>
478-
</Card>
479-
</Flex>
480-
481-
<Box className="border-gray-6 border-t" />
482-
483412
{/* Workspace Storage Section */}
484413
<Flex direction="column" gap="3">
485414
<Heading size="3">Workspace storage</Heading>

apps/twig/src/renderer/features/settings/stores/settingsStore.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@ export type LocalWorkspaceMode = "worktree" | "local";
88
export type SendMessagesWith = "enter" | "cmd+enter";
99

1010
interface SettingsStore {
11-
autoRunTasks: boolean;
1211
defaultRunMode: DefaultRunMode;
1312
lastUsedRunMode: "local" | "cloud";
1413
lastUsedLocalWorkspaceMode: LocalWorkspaceMode;
1514
lastUsedWorkspaceMode: WorkspaceMode;
16-
createPR: boolean;
1715
defaultModel: string;
1816
desktopNotifications: boolean;
1917
cursorGlow: boolean;
2018
autoConvertLongText: boolean;
2119
sendMessagesWith: SendMessagesWith;
2220

23-
setAutoRunTasks: (autoRun: boolean) => void;
2421
setDefaultRunMode: (mode: DefaultRunMode) => void;
2522
setLastUsedRunMode: (mode: "local" | "cloud") => void;
2623
setLastUsedLocalWorkspaceMode: (mode: LocalWorkspaceMode) => void;
2724
setLastUsedWorkspaceMode: (mode: WorkspaceMode) => void;
28-
setCreatePR: (createPR: boolean) => void;
2925
setDefaultModel: (model: string) => void;
3026
setDesktopNotifications: (enabled: boolean) => void;
3127
setCursorGlow: (enabled: boolean) => void;
@@ -36,25 +32,21 @@ interface SettingsStore {
3632
export const useSettingsStore = create<SettingsStore>()(
3733
persist(
3834
(set) => ({
39-
autoRunTasks: true,
4035
defaultRunMode: "last_used",
4136
lastUsedRunMode: "local",
4237
lastUsedLocalWorkspaceMode: "worktree",
4338
lastUsedWorkspaceMode: "worktree",
44-
createPR: true,
4539
defaultModel: DEFAULT_MODEL,
4640
desktopNotifications: true,
4741
cursorGlow: false,
4842
autoConvertLongText: true,
4943
sendMessagesWith: "enter",
5044

51-
setAutoRunTasks: (autoRun) => set({ autoRunTasks: autoRun }),
5245
setDefaultRunMode: (mode) => set({ defaultRunMode: mode }),
5346
setLastUsedRunMode: (mode) => set({ lastUsedRunMode: mode }),
5447
setLastUsedLocalWorkspaceMode: (mode) =>
5548
set({ lastUsedLocalWorkspaceMode: mode }),
5649
setLastUsedWorkspaceMode: (mode) => set({ lastUsedWorkspaceMode: mode }),
57-
setCreatePR: (createPR) => set({ createPR }),
5850
setDefaultModel: (model) => set({ defaultModel: model }),
5951
setDesktopNotifications: (enabled) =>
6052
set({ desktopNotifications: enabled }),

apps/twig/src/renderer/features/task-detail/components/WorkspaceModeSelect.tsx

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const MODE_CONFIG: Record<
1717
> = {
1818
local: {
1919
label: "Local",
20-
description: "Runs on your machine",
21-
icon: <Laptop size={14} weight="regular" />,
20+
description: "Edits your repo directly on current branch",
21+
icon: <Laptop size={16} weight="regular" />,
2222
},
2323
worktree: {
2424
label: "Workspace",
25-
description: "Runs in a separate working copy",
26-
icon: <GitBranch size={14} weight="regular" />,
25+
description: "Edits a copy so your work stays isolated",
26+
icon: <GitBranch size={16} weight="regular" />,
2727
},
2828
};
2929

@@ -49,13 +49,39 @@ export function WorkspaceModeSelect({
4949
</DropdownMenu.Trigger>
5050

5151
<DropdownMenu.Content align="start" size="1">
52-
<DropdownMenu.Item onSelect={() => onChange("worktree")}>
53-
<GitBranch size={14} />
54-
Workspace
52+
<DropdownMenu.Item
53+
onSelect={() => onChange("worktree")}
54+
style={{ padding: "6px 8px", height: "auto" }}
55+
>
56+
<div style={{ display: "flex", gap: 6, alignItems: "flex-start" }}>
57+
<GitBranch
58+
size={12}
59+
style={{ marginTop: 2, flexShrink: 0, color: "var(--gray-11)" }}
60+
/>
61+
<div>
62+
<Text size="1">{MODE_CONFIG.worktree.label}</Text>
63+
<Text size="1" color="gray" style={{ display: "block" }}>
64+
{MODE_CONFIG.worktree.description}
65+
</Text>
66+
</div>
67+
</div>
5568
</DropdownMenu.Item>
56-
<DropdownMenu.Item onSelect={() => onChange("local")}>
57-
<Laptop size={14} />
58-
Local
69+
<DropdownMenu.Item
70+
onSelect={() => onChange("local")}
71+
style={{ padding: "6px 8px", height: "auto" }}
72+
>
73+
<div style={{ display: "flex", gap: 6, alignItems: "flex-start" }}>
74+
<Laptop
75+
size={12}
76+
style={{ marginTop: 2, flexShrink: 0, color: "var(--gray-11)" }}
77+
/>
78+
<div>
79+
<Text size="1">{MODE_CONFIG.local.label}</Text>
80+
<Text size="1" color="gray" style={{ display: "block" }}>
81+
{MODE_CONFIG.local.description}
82+
</Text>
83+
</div>
84+
</div>
5985
</DropdownMenu.Item>
6086
</DropdownMenu.Content>
6187
</DropdownMenu.Root>

apps/twig/src/renderer/features/task-detail/hooks/useTaskCreation.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useAuthStore } from "@features/auth/stores/authStore";
22
import type { MessageEditorHandle } from "@features/message-editor/components/MessageEditor";
33
import type { EditorContent } from "@features/message-editor/utils/content";
4-
import { useSettingsStore } from "@features/settings/stores/settingsStore";
54
import { useCreateTask } from "@features/tasks/hooks/useTasks";
65
import { useConnectivity } from "@hooks/useConnectivity";
76
import { get } from "@renderer/di/container";
@@ -80,7 +79,6 @@ function prepareTaskInput(
8079
githubIntegrationId?: number;
8180
workspaceMode: WorkspaceMode;
8281
branch?: string | null;
83-
autoRun: boolean;
8482
executionMode?: "plan" | "acceptEdits";
8583
},
8684
): TaskCreationInput {
@@ -92,7 +90,6 @@ function prepareTaskInput(
9290
githubIntegrationId: options.githubIntegrationId,
9391
workspaceMode: options.workspaceMode,
9492
branch: options.branch,
95-
autoRun: options.autoRun,
9693
executionMode: options.executionMode,
9794
};
9895
}
@@ -122,7 +119,6 @@ export function useTaskCreation({
122119
const [isCreatingTask, setIsCreatingTask] = useState(false);
123120
const { navigateToTask } = useNavigationStore();
124121
const { isAuthenticated } = useAuthStore();
125-
const { autoRunTasks } = useSettingsStore();
126122
const { invalidateTasks } = useCreateTask();
127123
const { isOnline } = useConnectivity();
128124

@@ -152,7 +148,6 @@ export function useTaskCreation({
152148
githubIntegrationId,
153149
workspaceMode,
154150
branch,
155-
autoRun: autoRunTasks,
156151
executionMode,
157152
});
158153

@@ -195,7 +190,6 @@ export function useTaskCreation({
195190
githubIntegrationId,
196191
workspaceMode,
197192
branch,
198-
autoRunTasks,
199193
executionMode,
200194
invalidateTasks,
201195
navigateToTask,

apps/twig/src/renderer/features/tasks/hooks/useTasks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export function useCreateTask() {
6464
description: string;
6565
repository?: string;
6666
github_integration?: number;
67-
autoRun?: boolean;
6867
createdFrom?: "cli" | "command-menu";
6968
},
7069
) =>
@@ -76,7 +75,7 @@ export function useCreateTask() {
7675
{
7776
onSuccess: (_task, variables) => {
7877
track(ANALYTICS_EVENTS.TASK_CREATED, {
79-
auto_run: variables.autoRun || false,
78+
auto_run: false,
8079
created_from: variables.createdFrom || "cli",
8180
repository_provider: variables.repository ? "github" : "none",
8281
});

apps/twig/src/renderer/sagas/task/task-creation.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface TaskCreationInput {
3030
workspaceMode?: WorkspaceMode;
3131
branch?: string | null;
3232
githubIntegrationId?: number;
33-
autoRun?: boolean;
3433
// Execution mode: "plan" starts in plan mode (read-only), "acceptEdits" auto-approves edits, undefined starts in default mode
3534
executionMode?: "plan" | "acceptEdits";
3635
}
@@ -172,11 +171,11 @@ export class TaskCreationSaga extends Saga<
172171
const shouldConnect =
173172
!!input.taskId || // Open: always connect to load chat history
174173
workspaceMode === "cloud" || // Cloud create: always connect
175-
(agentCwd && input.autoRun); // Local create: only if autoRun
174+
!!agentCwd; // Local create: always connect if we have a cwd
176175

177176
if (shouldConnect) {
178177
const initialPrompt =
179-
!input.taskId && input.autoRun && input.content
178+
!input.taskId && input.content
180179
? await this.readOnlyStep("build_prompt_blocks", () =>
181180
buildPromptBlocks(
182181
input.content!,

apps/twig/src/renderer/services/task/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class TaskService {
119119

120120
// No existing workspace - run full saga to set it up
121121
const saga = new TaskCreationSaga({ posthogClient });
122-
const result = await saga.run({ taskId, autoRun: true });
122+
const result = await saga.run({ taskId });
123123

124124
if (result.success) {
125125
this.updateStoresOnSuccess(result.data);

0 commit comments

Comments
 (0)