diff --git a/apps/desktop/src/renderer/routes/_authenticated/components/AgentHooks/hooks/useCommandWatcher/tools/start-claude-session.ts b/apps/desktop/src/renderer/routes/_authenticated/components/AgentHooks/hooks/useCommandWatcher/tools/start-claude-session.ts index 4cf9c3844e9..50ca43bf59e 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/components/AgentHooks/hooks/useCommandWatcher/tools/start-claude-session.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/components/AgentHooks/hooks/useCommandWatcher/tools/start-claude-session.ts @@ -33,7 +33,8 @@ async function execute( workspaceId: workspace.id, projectId: pending?.projectId ?? workspace.projectId, initialCommands: [...(pending?.initialCommands ?? []), params.command], - defaultPreset: pending?.defaultPreset ?? null, + // Preserve undefined (signals "fetch from backend") vs null (no preset needed) + defaultPreset: pending ? pending.defaultPreset : null, }); return { diff --git a/apps/desktop/src/renderer/screens/main/components/WorkspaceInitEffects.tsx b/apps/desktop/src/renderer/screens/main/components/WorkspaceInitEffects.tsx index 402ce0c37d2..ff37c84f56d 100644 --- a/apps/desktop/src/renderer/screens/main/components/WorkspaceInitEffects.tsx +++ b/apps/desktop/src/renderer/screens/main/components/WorkspaceInitEffects.tsx @@ -201,6 +201,16 @@ export function WorkspaceInitEffects() { continue; } + // No initProgress means workspace is already initialized — process immediately + if (!progress) { + processingRef.current.add(workspaceId); + handleTerminalSetup(setup, () => { + removePendingTerminalSetup(workspaceId); + processingRef.current.delete(workspaceId); + }); + continue; + } + if (progress?.step === "ready") { processingRef.current.add(workspaceId);