Skip to content

fix: show logs not repo picker for inbox research tasks#2448

Merged
oliverb123 merged 1 commit into
mainfrom
posthog-code/fix-inbox-research-repo-picker
Jun 1, 2026
Merged

fix: show logs not repo picker for inbox research tasks#2448
oliverb123 merged 1 commit into
mainfrom
posthog-code/fix-inbox-research-repo-picker

Conversation

@oliverb123
Copy link
Copy Markdown
Contributor

Problem

On a report detail page in the inbox, expanding the Research (or Implementation) bar in the research task popover showed a "Select a repository folder" picker instead of the task's logs.

Root cause

The report's tasks come from useReportTasks, which fetches them from the PostHog cloud API (client.getTask). These are server-created cloud tasks with no local SQLite workspace record.

TaskLogsPanel renders WorkspaceSetupPrompt when !repoPath && !isCloud && .... But isCloud (useIsCloudTask) and repoPath (useCwd) were both derived only from the absent local workspace record, so isCloud was wrongly false and the folder-picker branch won.

Fix

Make useIsCloudTask also honor the canonical task-level signal task.latest_run?.environment === "cloud" — the same workspace?.mode === "cloud" || task.latest_run?.environment === "cloud" combination already used in TaskDetail.tsx and useTaskDiffSummaryStats.ts. Thread task through from useSessionViewState.

With isCloud correct for these remote tasks:

  • The WorkspaceSetupPrompt gate no longer matches → renders SessionView (logs).
  • useSessionConnection routes through watchCloudTask (live cloud log stream) instead of the static loadLogsOnly fallback.

The optional task arg keeps the other useIsCloudTask call sites (FileTreePanel, ChangesPanel) unchanged.

Verification

  • pnpm --filter code typecheck passes.
  • Manual (not run headlessly): inbox report → expand Research bar shows logs, not the picker; a local task with no workspace still shows the setup prompt (regression check).

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
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 1, 2026

Reviews (1): Last reviewed commit: "fix: show logs not repo picker for inbox..." | Re-trigger Greptile

@oliverb123 oliverb123 enabled auto-merge (squash) June 1, 2026 07:49
@oliverb123 oliverb123 merged commit 99f0622 into main Jun 1, 2026
15 checks passed
@oliverb123 oliverb123 deleted the posthog-code/fix-inbox-research-repo-picker branch June 1, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants