mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
perf: resolve launch preference owner without building route (#41803)
This commit is contained in:
@@ -188,14 +188,21 @@ function hostStructuredAgentsInput(
|
||||
return agents ? { hostStructuredAgents: agents.map((row) => row.agent) } : {}
|
||||
}
|
||||
|
||||
export function resolveAgentLaunchHost(
|
||||
export function resolveAgentLaunchOwner(
|
||||
store: AgentLaunchRouteStore,
|
||||
workspace: ProspectiveWorkspace
|
||||
) {
|
||||
const owner = workspace.worktreeId
|
||||
? resolveStructuredAgentSessionOwner(store, workspace.worktreeId)
|
||||
: undefined
|
||||
const executionHostId = owner ?? resolveExecutionHostId(store, workspace)
|
||||
return { owner, executionHostId: owner ?? resolveExecutionHostId(store, workspace) }
|
||||
}
|
||||
|
||||
export function resolveAgentLaunchHost(
|
||||
store: AgentLaunchRouteStore,
|
||||
workspace: ProspectiveWorkspace
|
||||
) {
|
||||
const { owner, executionHostId } = resolveAgentLaunchOwner(store, workspace)
|
||||
return {
|
||||
owner,
|
||||
executionHostId,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { parseExecutionHostId } from '../../../../shared/execution-host'
|
||||
import { lastVerifiedRuntimeStatus } from '../../../../shared/remote-runtime/host-status/runtime-host-status'
|
||||
import type { AppState } from '@/store/types'
|
||||
import {
|
||||
buildAgentLaunchRouteInput,
|
||||
resolveAgentLaunchOwner,
|
||||
type ProspectiveWorkspace
|
||||
} from '@/lib/agent-session/launch/routing/agent-launch-route-input'
|
||||
import { workspaceKindForWorktreeId } from '../../../../shared/agent-launch/contracts/workspace-launch-kind'
|
||||
@@ -32,9 +32,7 @@ function preferencesForWorkspace(state: AppState, workspace: ProspectiveWorkspac
|
||||
? { agentLaunchChoices: state.settings.agentLaunchChoices }
|
||||
: {})
|
||||
}
|
||||
const host = parseExecutionHostId(
|
||||
buildAgentLaunchRouteInput(state, { agent: 'claude', workspace }).executionHostId
|
||||
)
|
||||
const host = parseExecutionHostId(resolveAgentLaunchOwner(state, workspace).executionHostId)
|
||||
const owner =
|
||||
host?.kind === 'runtime'
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user