mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
fix(native-chat): preserve client platform routing gate
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -79,7 +79,6 @@ describe('useFullCreationExecution cancellation', () => {
|
||||
.fn<FullCreationExecutionInput['prepareFullSubmit']>()
|
||||
.mockResolvedValue(prepared),
|
||||
resolvedInitialWorkspaceStatus: undefined,
|
||||
selectedRepoAgentLaunchPlatform: 'darwin',
|
||||
selectedRepoExecutionHostId: 'local',
|
||||
selectedRepoIsGit: true,
|
||||
selectedRepoIsRemote: false,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user