From 99a1c4193faf60949dd32083937919225d9a7149 Mon Sep 17 00:00:00 2001 From: Oliver Browne Date: Mon, 1 Jun 2026 10:43:30 +0300 Subject: [PATCH] fix: show logs not repo picker for inbox research tasks Inbox research/implementation tasks are fetched from the PostHog cloud API and have no local workspace record, so `useIsCloudTask` (which only read the local workspace `mode`) returned false. That made `TaskLogsPanel` fall into the `WorkspaceSetupPrompt` ("Select a repository folder") branch instead of rendering the task logs. Honor the canonical task-level cloud signal `task.latest_run?.environment === "cloud"` as a fallback in `useIsCloudTask`, matching the pattern already used in `TaskDetail` and `useTaskDiffSummaryStats`. Pass the task through from `useSessionViewState`. With `isCloud` correct, the panel renders `SessionView` and streams cloud logs via `watchCloudTask`. Generated-By: PostHog Code Task-Id: 63b6d56b-6a53-4958-9d21-16bc72fad9eb --- .../renderer/features/sessions/hooks/useSessionViewState.ts | 2 +- .../src/renderer/features/workspace/hooks/useIsCloudTask.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/code/src/renderer/features/sessions/hooks/useSessionViewState.ts b/apps/code/src/renderer/features/sessions/hooks/useSessionViewState.ts index 19bbdf26cb..9429bccb2b 100644 --- a/apps/code/src/renderer/features/sessions/hooks/useSessionViewState.ts +++ b/apps/code/src/renderer/features/sessions/hooks/useSessionViewState.ts @@ -8,7 +8,7 @@ export function useSessionViewState(taskId: string, task: Task) { const session = useSessionForTask(taskId); const repoPath = useCwd(taskId) ?? null; const workspace = useWorkspace(taskId); - const isCloud = useIsCloudTask(taskId); + const isCloud = useIsCloudTask(taskId, task); const cloudStatus = session?.cloudStatus ?? null; const isCloudRunNotTerminal = diff --git a/apps/code/src/renderer/features/workspace/hooks/useIsCloudTask.ts b/apps/code/src/renderer/features/workspace/hooks/useIsCloudTask.ts index 438bf2d45c..41fe6a4d47 100644 --- a/apps/code/src/renderer/features/workspace/hooks/useIsCloudTask.ts +++ b/apps/code/src/renderer/features/workspace/hooks/useIsCloudTask.ts @@ -1,6 +1,8 @@ +import type { Task } from "@shared/types"; import { useWorkspace } from "./useWorkspace"; -export function useIsCloudTask(taskId: string): boolean { +export function useIsCloudTask(taskId: string, task?: Task): boolean { const workspace = useWorkspace(taskId); - return workspace?.mode === "cloud"; + if (workspace?.mode === "cloud") return true; + return task?.latest_run?.environment === "cloud"; }