diff --git a/src/renderer/src/hooks/composer-state/composer-submit-orchestration.ts b/src/renderer/src/hooks/composer-state/composer-submit-orchestration.ts index 09f9e8f8b94..023a7263b86 100644 --- a/src/renderer/src/hooks/composer-state/composer-submit-orchestration.ts +++ b/src/renderer/src/hooks/composer-state/composer-submit-orchestration.ts @@ -77,7 +77,6 @@ export function useComposerSubmitOrchestration( repoId: target.initialTargetState.repoId, resolvedSetupDecision: target.derivedComposerState.resolvedSetupDecision, selectedRepo: target.runtimeTargetSelection.selectedRepo, - selectedRepoAgentLaunchPlatform: target.runtimeTargetSelection.selectedRepoAgentLaunchPlatform, selectedRepoExecutionHostId: target.runtimeTargetSelection.selectedRepoExecutionHostId, selectedRepoIsGit: target.runtimeTargetSelection.selectedRepoIsGit, selectedRepoIsRemote: target.runtimeTargetSelection.selectedRepoIsRemote, diff --git a/src/renderer/src/hooks/composer-state/full-creation-execution.test.ts b/src/renderer/src/hooks/composer-state/full-creation-execution.test.ts index 71a81019e03..0ec9cf9baef 100644 --- a/src/renderer/src/hooks/composer-state/full-creation-execution.test.ts +++ b/src/renderer/src/hooks/composer-state/full-creation-execution.test.ts @@ -79,7 +79,6 @@ describe('useFullCreationExecution cancellation', () => { .fn() .mockResolvedValue(prepared), resolvedInitialWorkspaceStatus: undefined, - selectedRepoAgentLaunchPlatform: 'darwin', selectedRepoExecutionHostId: 'local', selectedRepoIsGit: true, selectedRepoIsRemote: false, diff --git a/src/renderer/src/hooks/composer-state/full-creation-execution.ts b/src/renderer/src/hooks/composer-state/full-creation-execution.ts index 3787b18b31c..80844c86331 100644 --- a/src/renderer/src/hooks/composer-state/full-creation-execution.ts +++ b/src/renderer/src/hooks/composer-state/full-creation-execution.ts @@ -17,7 +17,6 @@ export type FullCreationExecutionInput = Pick< | 'persistSetupAgentStartupPolicy' | 'prepareFullSubmit' | 'resolvedInitialWorkspaceStatus' - | 'selectedRepoAgentLaunchPlatform' | 'selectedRepoExecutionHostId' | 'selectedRepoIsGit' | 'selectedRepoIsRemote' @@ -34,7 +33,7 @@ import type { PendingSmartGitHubSubmitResolution } from './source-selection-deci import { translate } from '@/i18n/i18n' import { settleComposerSubmit } from '@/lib/composer-submit-cancellation' import { toFolderWorkspaceLinkedTask } from '@/components/sidebar/folder-workspace-composer-helpers' -import { ensureAgentStartupInTerminal } from '@/lib/new-workspace' +import { CLIENT_PLATFORM, ensureAgentStartupInTerminal } from '@/lib/new-workspace' import { createBrowserUuid } from '@/lib/browser-uuid' import { activateAndRevealWorktree } from '@/lib/worktree-activation' import { seedNativeChatAppliedSessionOptions } from '@/components/native-chat/native-chat-session-option-cache' @@ -66,7 +65,6 @@ export function useFullCreationExecution(input: FullCreationExecutionInput) { persistSetupAgentStartupPolicy, prepareFullSubmit, resolvedInitialWorkspaceStatus, - selectedRepoAgentLaunchPlatform, selectedRepoExecutionHostId, selectedRepoIsGit, selectedRepoIsRemote, @@ -142,7 +140,7 @@ export function useFullCreationExecution(input: FullCreationExecutionInput) { agent: tuiAgent, settings, executionHostId: selectedRepoExecutionHostId ?? 'local', - platform: selectedRepoAgentLaunchPlatform, + platform: CLIENT_PLATFORM, hostCapabilities: readLocalRuntimeCapabilities(), workspaceKind: selectedRepoIsGit ? 'git-worktree' : 'folder', promptDelivery: startupPlan?.draftPrompt ? 'draft' : 'auto-submit', @@ -301,7 +299,6 @@ export function useFullCreationExecution(input: FullCreationExecutionInput) { persistSetupAgentStartupPolicy, prepareFullSubmit, resolvedInitialWorkspaceStatus, - selectedRepoAgentLaunchPlatform, selectedRepoExecutionHostId, selectedRepoIsGit, selectedRepoIsRemote, diff --git a/src/renderer/src/hooks/composer-state/quick-creation-execution.ts b/src/renderer/src/hooks/composer-state/quick-creation-execution.ts index 7ecc0915562..7160cb48b4c 100644 --- a/src/renderer/src/hooks/composer-state/quick-creation-execution.ts +++ b/src/renderer/src/hooks/composer-state/quick-creation-execution.ts @@ -51,6 +51,7 @@ import { resolveAgentLaunchRoute } from '@/lib/agent-launch-routing' import { readLocalRuntimeCapabilities } from '@/runtime/local-runtime-capabilities' +import { CLIENT_PLATFORM } from '@/lib/new-workspace' export function useQuickCreationExecution(input: QuickCreationExecutionInput) { const { @@ -205,7 +206,7 @@ export function useQuickCreationExecution(input: QuickCreationExecutionInput) { executionHostId: ephemeralVmRecipe ? 'runtime:pending-ephemeral-vm' : (workspaceRunContext?.hostId ?? selectedRepoExecutionHostId ?? 'local'), - platform: selectedRepoAgentLaunchPlatform, + platform: CLIENT_PLATFORM, hostCapabilities: readLocalRuntimeCapabilities(), workspaceKind: selectedRepoIsGit ? 'git-worktree' : 'folder', promptDelivery: quickDraftPrompt ? 'draft' : 'auto-submit', diff --git a/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts b/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts index 24704283f64..764a033275f 100644 --- a/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts +++ b/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts @@ -660,14 +660,22 @@ describe('useComposerState host-context boundaries', () => { 'getAgentLaunchPlatformForRepo(selectedRepo, projectRuntime)' ) - const fullSubmit = COMPOSER_SOURCE.fullSubmitPreparation + COMPOSER_SOURCE.fullCreation - expect(fullSubmit).toContain('platform: selectedRepoAgentLaunchPlatform') - expect(fullSubmit).toContain('startupDraft: startupPlan.draftPrompt') - expect(fullSubmit).not.toContain('platform: CLIENT_PLATFORM') + const fullStartupPlan = sourceBetween( + COMPOSER_SOURCE.fullSubmitPreparation, + 'const startupPlan = buildAgentStartupPlan({', + 'const shouldSeedInitialAgentStatus =' + ) + expect(fullStartupPlan).toContain('platform: selectedRepoAgentLaunchPlatform') + expect(fullStartupPlan).not.toContain('platform: CLIENT_PLATFORM') + expect(COMPOSER_SOURCE.fullCreation).toContain('startupDraft: startupPlan.draftPrompt') - const quickSubmit = COMPOSER_SOURCE.quickCreation - expect(quickSubmit).toContain('platform: selectedRepoAgentLaunchPlatform') - expect(quickSubmit).not.toContain('platform: CLIENT_PLATFORM') + const quickStartupPlan = sourceBetween( + COMPOSER_SOURCE.quickCreation, + 'buildQuickComposerStartup({', + 'const startupPolicySettlement =' + ) + expect(quickStartupPlan).toContain('platform: selectedRepoAgentLaunchPlatform') + expect(quickStartupPlan).not.toContain('platform: CLIENT_PLATFORM') }) // Why: activation no longer rebuilds a startup from `createdWithAgent`, so this