From aa5a0b3b1ebd5a755f26bf0559cd7dce7d530e1b Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Wed, 10 Jun 2026 19:53:00 -0700 Subject: [PATCH] Report pending setup state in workspace target resolution Co-authored-by: Orca --- ...oject-first-host-model-change-inventory.md | 2 ++ .../project-first-host-model-conversation.md | 2 ++ notes/project-first-host-model-handoff.md | 2 ++ notes/project-first-host-model.md | 3 +++ .../lib/project-host-workspace-target.test.ts | 26 +++++++++++++++++++ .../src/lib/project-host-workspace-target.ts | 6 +++++ 6 files changed, 41 insertions(+) diff --git a/notes/project-first-host-model-change-inventory.md b/notes/project-first-host-model-change-inventory.md index cb78423b00e..5b30853ff74 100644 --- a/notes/project-first-host-model-change-inventory.md +++ b/notes/project-first-host-model-change-inventory.md @@ -508,6 +508,8 @@ Already partially landed: known host before a checkout path exists - workspace creation host options distinguish pending/error/unsupported setup metadata from hosts that have no setup +- workspace creation target resolution reports `setup-not-ready` when a + selected host has non-ready setup metadata Not complete yet: diff --git a/notes/project-first-host-model-conversation.md b/notes/project-first-host-model-conversation.md index fce74ed7189..9b9df69f841 100644 --- a/notes/project-first-host-model-conversation.md +++ b/notes/project-first-host-model-conversation.md @@ -512,6 +512,8 @@ Already partially landed: known host before a checkout path exists - workspace creation host options distinguish pending/error/unsupported setup metadata from hosts that have no setup +- workspace creation target resolution reports `setup-not-ready` when a + selected host has non-ready setup metadata Not complete yet: diff --git a/notes/project-first-host-model-handoff.md b/notes/project-first-host-model-handoff.md index 711278b850e..12e4a3c0d98 100644 --- a/notes/project-first-host-model-handoff.md +++ b/notes/project-first-host-model-handoff.md @@ -430,6 +430,8 @@ Already partially landed: known host before a checkout path exists - workspace creation host options distinguish pending/error/unsupported setup metadata from hosts that have no setup +- workspace creation target resolution reports `setup-not-ready` when a + selected host has non-ready setup metadata Still needed: diff --git a/notes/project-first-host-model.md b/notes/project-first-host-model.md index a9c5099afc1..01a3385461c 100644 --- a/notes/project-first-host-model.md +++ b/notes/project-first-host-model.md @@ -791,6 +791,9 @@ Landed so far: - Updated workspace creation host options so non-ready setup metadata appears with its real pending/error/unsupported state instead of being collapsed into a generic "project not set up" row. +- Updated workspace creation target resolution so selecting a host with + non-ready setup metadata reports `setup-not-ready` instead of + `project-not-set-up-on-host`. - Added tests for local repos, SSH repos, same-provider multi-host grouping, no-identity same-name non-grouping, selector cache behavior, persistence backfill, repo mutation synchronization, renderer hydration, runtime RPC diff --git a/src/renderer/src/lib/project-host-workspace-target.test.ts b/src/renderer/src/lib/project-host-workspace-target.test.ts index e00b6fdd211..a6fd417de25 100644 --- a/src/renderer/src/lib/project-host-workspace-target.test.ts +++ b/src/renderer/src/lib/project-host-workspace-target.test.ts @@ -155,6 +155,32 @@ describe('project-host workspace target resolution', () => { }) }) + it('reports setup-not-ready when the selected host has pending setup metadata', () => { + const repo = makeRepo('orca') + const projects = [makeProject('github:stablyai/orca', ['orca'])] + const projectHostSetups = [ + makeSetup('orca', 'github:stablyai/orca', 'local', 'orca'), + makeSetup('gpu-pending', 'github:stablyai/orca', 'runtime:gpu', '', { + path: '', + setupState: 'setting-up', + setupMethod: 'provisioned' + }) + ] + + expect( + resolveWorkspaceCreationTarget({ + eligibleRepos: [repo], + projects, + projectHostSetups, + projectId: 'github:stablyai/orca', + hostId: 'runtime:gpu' + }) + ).toEqual({ + status: 'unavailable', + reason: 'setup-not-ready' + }) + }) + it('reports unavailable when an explicit setup is not ready', () => { const repo = makeRepo('orca') const projects = [makeProject('github:stablyai/orca', ['orca'])] diff --git a/src/renderer/src/lib/project-host-workspace-target.ts b/src/renderer/src/lib/project-host-workspace-target.ts index dc9bd5419a4..13e9271bac0 100644 --- a/src/renderer/src/lib/project-host-workspace-target.ts +++ b/src/renderer/src/lib/project-host-workspace-target.ts @@ -142,6 +142,12 @@ export function resolveWorkspaceCreationTarget( } if (projectId && hostId) { + const hostSetup = setups.find( + (setup) => setup.projectId === projectId && setup.hostId === hostId + ) + if (hostSetup && !isReadySetup(hostSetup)) { + return { status: 'unavailable', reason: 'setup-not-ready' } + } const target = findReadySetupTarget( setups, repoById,