perf: resolve launch preference owner without building route (#41803)

This commit is contained in:
Neil
2026-11-12 23:14:54 -08:00
committed by GitHub
parent a0fc70d291
commit 7582371078
2 changed files with 11 additions and 6 deletions
@@ -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'
? {