Files
archived-orca/src/main/runtime/workspaces/workspace-create-activation.ts
T
Brennan Benson 635d3853f1 fix(agent.launch): avoid blank shells when launching new workspaces (#28451)
* fix: avoid blank shells beside new workspace chats

* Carry promised agent chat through worktree creation

* Use live agent launch inventory for new workspace surfaces

* Type live agent launch owner from runtime contract

* Assert one recovery shell after failed agent launch

* Keep worktree activation adapters out of creation flow

* Restore ordinary workspace setup handoff after launch correction

* Cover the phone's agent.launch workspace create in the first-surface flow test
2026-10-15 01:21:24 -07:00

45 lines
1.6 KiB
TypeScript

import type { RuntimeNavigationTarget } from '../../../shared/runtime-navigation'
import type { CreateWorktreeResult } from '../../../shared/worktree/create-types'
import type { WorktreeStartupLaunch } from '../../../shared/worktree/launch-types'
import type { createRuntimeFolderWorktree } from '../runtime-folder-worktree-create'
import type { startRuntimeLocalWorktreeTerminals } from '../runtime-local-worktree-terminal-startup'
type FolderActivation = Parameters<typeof createRuntimeFolderWorktree>[0]['deps']['activate']
type LocalActivation = Parameters<typeof startRuntimeLocalWorktreeTerminals>[0]['ports']['activate']
type NotifyActivation = (
repoId: string,
worktreeId: string,
setup?: CreateWorktreeResult['setup'],
startup?: WorktreeStartupLaunch,
defaultTabs?: CreateWorktreeResult['defaultTabs'],
navigation?: RuntimeNavigationTarget,
providesInitialSurface?: boolean
) => void
export function createdWorkspaceActivationCallbacks(
notify: NotifyActivation,
navigation?: RuntimeNavigationTarget
): { folder: FolderActivation; local: LocalActivation } {
const folder: FolderActivation = (repoId, worktreeId, setup, startup, providesInitialSurface) =>
notify(repoId, worktreeId, setup, startup, undefined, navigation, providesInitialSurface)
const local: LocalActivation = (
repoId,
worktreeId,
startup,
failedSetup,
failedDefaultTabs,
providesInitialSurface
) =>
notify(
repoId,
worktreeId,
failedSetup,
startup,
failedDefaultTabs,
navigation,
providesInitialSurface
)
return { folder, local }
}