Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(desktop): open report artifacts in Inbox (#95269)

Shy Alter7b21f425cc3e
diff --git a/products/desktop/docs/CLOUD-TASK-ARTIFACTS.md b/products/desktop/docs/CLOUD-TASK-ARTIFACTS.md
index 39acb832ad7c..f45b9228913c 100644
--- a/products/desktop/docs/CLOUD-TASK-ARTIFACTS.md
+++ b/products/desktop/docs/CLOUD-TASK-ARTIFACTS.md
@@ -16,7 +16,7 @@ Reference artifacts do not upload a file and do not have a storage path, size, o
Registration failure does not block the completed turn or replace the current artifact list. Desktop retries when it hydrates the completed turn again, so the client and backend can deploy in either order.
-The Artifacts pane shows file and reference artifacts in one list. The Timeline announces a new reference as an added artifact. Both surfaces open the same artifact tab, which resolves the current object data from the active PostHog project.
+The Artifacts pane shows file and reference artifacts in one list. The Timeline announces a new reference as an added artifact. Inbox report references open in the native Inbox report view. Other references open an artifact tab that resolves current object data from the active PostHog project.
The desktop app runs scripts embedded in HTML artifacts inside an isolated preview process. The preview cannot access Node.js, Electron, PostHog credentials, remote resources, downloads, or device permissions. Use **Stop preview** if a script becomes unresponsive, then use **Restart preview** to load it in a fresh process.
diff --git a/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.test.tsx
index b5abbf027c27..e14206e6fe3f 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.test.tsx
@@ -13,6 +13,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
const mocks = vi.hoisted(() => ({
runs: [] as TaskRun[],
openArtifactTab: vi.fn(),
+ openInboxReport: vi.fn(),
openExternalUrl: vi.fn(),
getCloudAttachmentPreviewUrl: vi.fn(),
commentsError: false,
@@ -54,6 +55,9 @@ vi.mock("@posthog/ui/features/sessions/sessionStore", () => ({
vi.mock("@posthog/ui/features/panels/panelLayoutStore", () => ({
usePanelLayoutStore: () => mocks.openArtifactTab,
}));
+vi.mock("@posthog/ui/features/inbox/hooks/useOpenInboxReport", () => ({
+ useOpenInboxReport: () => mocks.openInboxReport,
+}));
vi.mock("@posthog/ui/features/git-interaction/usePrArtifact", () => ({
usePrArtifact: (url: string) => ({
safeUrl: url,
@@ -141,6 +145,7 @@ describe("TaskArtifactsList", () => {
mocks.taskRunsRefreshKeys = [];
mocks.runs = [run("run-1", { prNumber: 1 }), run("run-2", { prNumber: 2 })];
mocks.openArtifactTab.mockReset();
+ mocks.openInboxReport.mockReset();
mocks.openExternalUrl.mockReset();
mocks.getCloudAttachmentPreviewUrl.mockReset();
useReviewNavigationStore.setState({
@@ -282,6 +287,35 @@ describe("TaskArtifactsList", () => {
).toBeNull();
});
+ it("opens an Inbox report reference in the native report view", () => {
+ mocks.runs = [
+ run("run-1", {
+ artifacts: [
+ {
+ id: "phref-report-1",
+ name: "Checkout errors increased",
+ type: "reference",
+ source: "posthog_object",
+ uploaded_at: "2026-08-19T00:00:00Z",
+ metadata: {
+ reference_type: "posthog_object",
+ object_kind: "report",
+ object_id: "report-1",
+ source_message_ids: ["turn-1"],
+ occurrence_count: 1,
+ },
+ },
+ ],
+ }),
+ ];
+
+ render(<TaskArtifactsList task={task} timeline={[]} />);
+
+ fireEvent.click(screen.getByText("Checkout errors increased"));
+ expect(mocks.openInboxReport).toHaveBeenCalledWith("report-1");
+ expect(mocks.openArtifactTab).not.toHaveBeenCalled();
+ });
+
it("keeps artifacts visible when comment counts fail", () => {
mocks.commentsError = true;
mocks.runs = [
diff --git a/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.tsx b/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.tsx
index 49298ac57008..a09b794beec9 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/TaskArtifactsList.tsx
@@ -42,6 +42,7 @@ import { useTaskRuns } from "@posthog/ui/features/canvas/hooks/useTaskRuns";
import { canvasArtifactOpenHandler } from "@posthog/ui/features/canvas/utils/canvasArtifactNavigation";
import { openPrInReview } from "@posthog/ui/features/code-review/openPrInReview";
import { usePrArtifact } from "@posthog/ui/features/git-interaction/usePrArtifact";
+import { useOpenInboxReport } from "@posthog/ui/features/inbox/hooks/useOpenInboxReport";
import { usePanelLayoutStore } from "@posthog/ui/features/panels/panelLayoutStore";
import { usePrComments } from "@posthog/ui/features/pr-review/usePrComments";
import { usePrReviewThreads } from "@posthog/ui/features/pr-review/usePrReviewThreads";
@@ -346,6 +347,7 @@ function PostHogObjectRow({
runId,
name,
objectKind,
+ objectId,
occurrenceCount,
uploadedAt,
commentCount,
@@ -355,11 +357,13 @@ function PostHogObjectRow({
runId: string;
name: string;
objectKind: string;
+ objectId: string;
occurrenceCount: number;
uploadedAt: string | undefined;
commentCount: number;
}) {
const openArtifactTab = usePanelLayoutStore((state) => state.openArtifactTab);
+ const openInboxReport = useOpenInboxReport();
const object = getObjectKind(objectKind);
const ObjectIcon = object.icon;
const meta = [
@@ -375,9 +379,13 @@ function PostHogObjectRow({
icon={<ObjectIcon size={16} color={POSTHOG_OBJECT_ICON_COLOR} />}
title={name}
meta={meta}
- onOpen={() =>
- openArtifactTab(taskId, { runId, artifactId, name, objectKind })
- }
+ onOpen={() => {
+ if (objectKind === "report") {
+ void openInboxReport(objectId);
+ return;
+ }
+ openArtifactTab(taskId, { runId, artifactId, name, objectKind });
+ }}
actions={<CommentCountBadge count={commentCount} />}
/>
);
@@ -484,6 +492,7 @@ export function TaskArtifactsList({
runId={row.runId}
name={row.name}
objectKind={row.metadata.object_kind}
+ objectId={row.metadata.object_id}
occurrenceCount={row.metadata.occurrence_count}
uploadedAt={row.uploadedAt}
commentCount={openCountByItem.get(row.artifactId) ?? 0}