diff --git a/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts b/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts index 18b727c935d..bb597d10e6e 100644 --- a/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts +++ b/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts @@ -3,7 +3,6 @@ import { gateWorktreeAgentActivation, type WorktreeAgentActivationOutcome } from './worktree-agent-activation-gate' -import type { WorktreeActivationSurfaceSelection } from './worktree-activation-surface-selection' import { reseedGatedEmptyWorkspace } from './worktree-initial-terminal-seeding' type GatedEmptyWorkspaceReseedIntent = { @@ -18,12 +17,13 @@ const latestReseedIntentByGate = new WeakMap< export function gateAndReseedEmptyWorkspace( workspaceKey: string, - selection?: WorktreeActivationSurfaceSelection & { executionHostId?: ExecutionHostId } + callerProvidesSurface: boolean, + executionHostId?: ExecutionHostId ): void { const gate = gateWorktreeAgentActivation(workspaceKey) const intent: GatedEmptyWorkspaceReseedIntent = { - callerProvidesSurface: selection?.providesInitialSurface === true, - ...(selection?.executionHostId ? { executionHostId: selection.executionHostId } : {}) + callerProvidesSurface, + ...(executionHostId ? { executionHostId } : {}) } latestReseedIntentByGate.set(gate, intent) void gate.then((outcome) => { diff --git a/src/renderer/src/lib/worktree-activation.ts b/src/renderer/src/lib/worktree-activation.ts index 40fc272b42f..bf4bbce1123 100644 --- a/src/renderer/src/lib/worktree-activation.ts +++ b/src/renderer/src/lib/worktree-activation.ts @@ -143,7 +143,11 @@ export function activateAndRevealFolderWorkspace( resumeSleepingAgentSessionsForWorktree(workspaceKey) } if (shouldGateAgentActivation) { - gateAndReseedEmptyWorkspace(workspaceKey, opts) + gateAndReseedEmptyWorkspace( + workspaceKey, + opts?.providesInitialSurface === true, + opts?.executionHostId + ) } const primaryTabId = shouldGateAgentActivation ? null @@ -238,7 +242,11 @@ export function activateAndRevealWorktree( resumeSleepingAgentSessionsForWorktree(worktreeId) } if (shouldGateAgentActivation) { - gateAndReseedEmptyWorkspace(worktreeId, opts) + gateAndReseedEmptyWorkspace( + worktreeId, + opts?.providesInitialSurface === true, + opts?.executionHostId + ) } // 4. Ensure a focusable surface exists for externally-created worktrees