From 9d4775dbde059b0ee565c668edb1c5401fac39ec Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Sat, 13 Jun 2026 01:00:48 -0700 Subject: [PATCH] Add task source provider availability reasons Co-authored-by: Orca --- .../host-context-implementation-checklist.md | 1 + .../task-source-context-summary.test.ts | 41 +++++++++++++++++++ .../components/task-source-context-summary.ts | 13 +++++- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/notes/host-context-implementation-checklist.md b/notes/host-context-implementation-checklist.md index 027b2519191..da7e605a334 100644 --- a/notes/host-context-implementation-checklist.md +++ b/notes/host-context-implementation-checklist.md @@ -276,3 +276,4 @@ Done means: reviewers and future agents can understand the vision, implementatio - [x] 2026-06-13: Guarded backend automation ownership for runtime-host repos: newly saved/updated runtime-owned automations now record `remote_host_service`, and main-process dispatch resolution skips runtime targets before desktop renderer dispatch until durable remote scheduling exists. Verified with persistence and automation service regressions, targeted oxlint, and full `pnpm run typecheck`. - [x] 2026-06-13: Preserved exact GitLab provider identity for item-specific Tasks flows by threading `GitLabWorkItem.projectRef` into the task source context used for detail pages and Start Workspace handoff. Verified with TaskPage source-boundary regression, targeted oxlint, and full `pnpm run typecheck`. - [x] 2026-06-13: Removed the redundant locked SSH target row from the Add Project remote-path step after the host has already been selected, while preserving a compact reconnect action for disconnected locked hosts. Fresh Electron validation connected a Docker SSH target through Orca's relay IPC, added `/home/orca/host-context-e2e-local` via Add Project, and created a remote SSH worktree at `/home/orca/goldfish`; screenshots were added to the dark-background report. Verified with focused Add Project tests, targeted oxlint, and remote filesystem checks. +- [x] 2026-06-13: Extended Tasks source availability reasons so missing provider auth, unavailable source tooling, and unsupported providers can surface as distinct source-host states instead of generic connection/version failures. The checklist row remains partial until runtime/provider preflight feeds these reasons end to end. Verified with focused source-summary tests and targeted oxlint. diff --git a/src/renderer/src/components/task-source-context-summary.test.ts b/src/renderer/src/components/task-source-context-summary.test.ts index 04204793e96..fad4245bf6c 100644 --- a/src/renderer/src/components/task-source-context-summary.test.ts +++ b/src/renderer/src/components/task-source-context-summary.test.ts @@ -278,4 +278,45 @@ describe('task source context summary', () => { })?.label ).toBe('Some GitLab source hosts unavailable: 2 source hosts') }) + + it('shows provider-specific source availability reasons', () => { + expect( + getTaskSourceContextSummary({ + provider: 'github', + providerLabel: 'GitHub', + selectedRepoCount: 1, + repoContexts: [ + { + kind: 'task-source', + provider: 'github', + projectId: 'github:stablyai/orca', + hostId: 'ssh:devbox', + repoId: 'repo-1', + providerIdentity: { provider: 'github', owner: 'stablyai', repo: 'orca' } + } + ], + hostAvailability: [{ hostId: 'ssh:devbox', reason: 'missing-provider-auth' }] + }) + ).toEqual({ + label: 'GitHub · devbox · provider auth needed · stablyai/orca', + title: + 'GitHub · Host: devbox · Availability: devbox provider auth needed · Source: stablyai/orca' + }) + + expect( + getTaskSourceAvailabilityNotice({ + providerLabel: 'GitHub', + sourceCount: 3, + hostAvailability: [ + { hostId: 'ssh:devbox', reason: 'unavailable-source-tool' }, + { hostId: 'runtime:linux', reason: 'unsupported-provider' } + ] + }) + ).toEqual({ + label: 'Some GitHub source hosts unavailable: 2 source hosts', + title: + 'Reconnect or update devbox source tool unavailable, linux provider unsupported on this host to load this source.', + blocking: false + }) + }) }) diff --git a/src/renderer/src/components/task-source-context-summary.ts b/src/renderer/src/components/task-source-context-summary.ts index f4d17e623c0..f7d9756c0b0 100644 --- a/src/renderer/src/components/task-source-context-summary.ts +++ b/src/renderer/src/components/task-source-context-summary.ts @@ -20,7 +20,12 @@ export type TaskSourceHostAvailability = { hostId: ExecutionHostScope status?: SshConnectionStatus health?: ExecutionHostHealth - reason?: 'checking-task-source-capability' | 'missing-task-source-capability' + reason?: + | 'checking-task-source-capability' + | 'missing-task-source-capability' + | 'missing-provider-auth' + | 'unavailable-source-tool' + | 'unsupported-provider' } export function getTaskSourceContextSummary(args: { @@ -211,6 +216,12 @@ function getAvailabilityStatusLabel(availability: TaskSourceHostAvailability): s return 'checking server capabilities' case 'missing-task-source-capability': return 'server update needed for task sources' + case 'missing-provider-auth': + return 'provider auth needed' + case 'unavailable-source-tool': + return 'source tool unavailable' + case 'unsupported-provider': + return 'provider unsupported on this host' } if (availability.status) { return availability.status === 'connected' ? null : getSshStatusLabel(availability.status)