: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(signals): show the run summary on inbox report runs rows (#104534)
posthog[bot]61ebc5a079c5
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 2f6ba4cbe717..4f8d7cfaf48d 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -8744,6 +8744,14 @@ snapshots:hash: v1.k794b7964.7c9c84d49f542f37fb20a337d4e097ceac512f7916476f8313f52403a0c8272e.Qbic0TtjJ_u8tITXga4NzK-pjvZVxEv_eDiiDbAZ6Toscenes-app-inbox-detail-follow-up-checks--running--light:hash: v1.k794b7964.a5e08bb11b3723765e5cc33b4afb36d6ad9217d9a8975497677cf4b2fc513071.Kvc9DMV6mta5XCyUg5mxeDQrjWC5zatz04E4OgsVWpc+ scenes-app-inbox-detail-runs--narrow-rail--dark:+ hash: v1.k794b7964.b063aeeabbdbee852bc6a55c5e1e32b8075273ed3e211d8d0d490582a63d632f.ZNR24H-doELGCmC8Wwc5dFzukDi9dWeEuzsM7A5Fjfg+ scenes-app-inbox-detail-runs--narrow-rail--light:+ hash: v1.k794b7964.56d0c3f4638f5e01e72f763045c11f64bbca05edf479b7a2f3c689b63ec069a3.oEpd2xCqTFbWAJlu7cjI00r-nsxYMYwqKC4QkFFw1Mc+ scenes-app-inbox-detail-runs--with-and-without-summaries--dark:+ hash: v1.k794b7964.a329cc0289b531b68148a1df8e4c64e901d06331756d29946a78f76c67ed67f1.K55lAqP9mrBF2IyKPSEE9U0aVxshDyhn4VNlhEG0q9Y+ scenes-app-inbox-detail-runs--with-and-without-summaries--light:+ hash: v1.k794b7964.6c3e85a31ef2b95a1c7a9ba55f0bf5166772df5441610b3e491ea712e141af42.rDcRBjts6xukOiG1_LTLeE8oQofZ_GhqBrAjbfYNFD0scenes-app-inbox-detail-suggested-reviewers-mockup--code-history--dark:hash: v1.k794b7964.768551ac98a31184ef4842b330460c7a8e11a1c4e8fae5cbb516c2a522d6a7cb.UCrBAIkxkdJAEMQDjLXpUfchtKUXZTIOUh9SFRe103Mscenes-app-inbox-detail-suggested-reviewers-mockup--code-history--light:diff --git a/products/signals/frontend/inbox/components/detail/ReportTaskRow.stories.tsx b/products/signals/frontend/inbox/components/detail/ReportTaskRow.stories.tsxnew file mode 100644index 000000000000..da4f791eb6e8--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportTaskRow.stories.tsx@@ -0,0 +1,89 @@+import type { Meta, StoryObj } from '@storybook/react'++import { IconTerminal } from '@posthog/icons'++import { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'++import { mockTask } from '../../__mocks__/inboxMocks'+import type { ReportTaskEntry } from '../../logics/inboxReportDetailLogic'+import { DetailSection } from './DetailSection'+import { ReportTaskRow } from './ReportTaskRow'++// What an agent writes about itself: goal, outcome, where the work landed, how far it verified.+const implementationSummary = `Made the invite endpoint reject a blank recipient before it reaches the mailer.++The 500 came from the mailer raising on an empty address, so the serializer now validates it and the+view answers 400 instead.++Branch: inbox/fix-invites — PR #12001. Ran the invites API tests locally; they pass.`++function entry(+ taskId: string,+ purposeLabel: string,+ summary: string | null,+ runStatus?: TaskRunStatus+): ReportTaskEntry {+ const task = mockTask(taskId, runStatus)+ return {+ task: { ...task, latest_run: { ...task.latest_run, task_summary: summary } },+ purpose: purposeLabel === 'Implementation' ? 'implementation' : 'research',+ purposeLabel,+ startedAt: '2026-09-20T09:00:00Z',+ }+}++function RunsSection({ entries }: { entries: ReportTaskEntry[] }): JSX.Element {+ return (+ <DetailSection icon={<IconTerminal />} title="Runs" collapsible>+ <div className="flex flex-col gap-0.5">+ {entries.map((taskEntry) => (+ <ReportTaskRow+ key={taskEntry.task.id}+ entry={taskEntry}+ expanded={false}+ onToggle={() => undefined}+ />+ ))}+ </div>+ </DetailSection>+ )+}++const meta: Meta<typeof RunsSection> = {+ title: 'Scenes-App/Inbox/Detail/Runs',+ component: RunsSection,+ parameters: { layout: 'centered', viewMode: 'story' },+ decorators: [+ (Story, context) => (+ // The rail is 26rem wide, and about 20rem of it survives next to an open side panel.+ <div+ className={`${context.parameters.railWidth === 'narrow' ? 'w-[20rem]' : 'w-[26rem]'} max-w-[calc(100vw-2rem)] rounded border bg-primary p-4`}+ >+ <Story />+ </div>+ ),+ ],+}++export default meta++type Story = StoryObj<typeof RunsSection>++export const WithAndWithoutSummaries: Story = {+ args: {+ entries: [+ entry('impl-task', 'Implementation', implementationSummary, TaskRunStatus.COMPLETED),+ entry('research-task', 'Research', null),+ ],+ },+}++export const NarrowRail: Story = {+ parameters: { railWidth: 'narrow' },+ args: {+ entries: [+ entry('impl-task', 'Implementation', implementationSummary, TaskRunStatus.COMPLETED),+ entry('research-task', 'Research', null),+ ],+ },+}diff --git a/products/signals/frontend/inbox/components/detail/ReportTaskRow.test.tsx b/products/signals/frontend/inbox/components/detail/ReportTaskRow.test.tsxnew file mode 100644index 000000000000..6efa77d4d685--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportTaskRow.test.tsx@@ -0,0 +1,83 @@+import '@testing-library/jest-dom'++import { cleanup, render, screen } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import posthog from 'posthog-js'++import { initKeaTests } from '~/test/init'++import { mockTask } from '../../__mocks__/inboxMocks'+import { INBOX_EVENTS } from '../../inboxAnalytics'+import type { ReportTaskEntry } from '../../logics/inboxReportDetailLogic'+import { ReportTaskRow } from './ReportTaskRow'++jest.mock('posthog-js')++const summary = 'Rejected the blank recipient in the serializer.\nBranch: inbox/fix-invites — PR #12001.'++function entry(taskSummary: string | null): ReportTaskEntry {+ const task = mockTask('impl-task', 'completed')+ return {+ task: { ...task, latest_run: { ...task.latest_run, task_summary: taskSummary } },+ purpose: 'implementation',+ purposeLabel: 'Implementation',+ startedAt: '2026-09-20T09:00:00Z',+ }+}++function summaryCaptures(): Record<string, unknown>[] {+ return (posthog.capture as jest.Mock).mock.calls+ .filter(([event]) => event === INBOX_EVENTS.RUN_SUMMARY_VIEWED)+ .map(([, properties]) => properties)+}++describe('ReportTaskRow', () => {+ beforeEach(() => {+ initKeaTests()+ ;(posthog.capture as jest.Mock).mockClear()+ })++ afterEach(() => {+ cleanup()+ })++ test.each([+ ['a hover', async (row: HTMLElement) => await userEvent.hover(row)],+ [+ 'keyboard focus',+ async (row: HTMLElement) => {+ await userEvent.tab()+ expect(row).toHaveFocus()+ },+ ],+ ])('reveals the run summary on %s, and records the read', async (_case, reveal) => {+ render(<ReportTaskRow entry={entry(summary)} expanded={false} onToggle={() => undefined} />)++ expect(screen.queryByText(/Rejected the blank recipient/)).not.toBeInTheDocument()++ await reveal(screen.getByRole('button'))++ expect(screen.getByTestId('report-run-summary')).toHaveTextContent('Implementation')+ expect(await screen.findByText(/Rejected the blank recipient/)).toHaveTextContent('PR #12001')+ expect(summaryCaptures()).toEqual([+ expect.objectContaining({+ inbox_client: 'cloud',+ run_purpose: 'implementation',+ run_status: 'completed',+ summary_length: summary.length,+ }),+ ])+ })++ // A run that wrote no summary must not offer the hint or send a read — an empty tooltip reads as+ // a broken row, and a read with nothing behind it makes the event useless as a measure.+ it('leaves a run with no summary alone', async () => {+ render(<ReportTaskRow entry={entry(null)} expanded={false} onToggle={() => undefined} />)++ await userEvent.hover(screen.getByRole('button'))++ expect(screen.getByText('Implementation')).toBeInTheDocument()+ expect(screen.queryByTestId('report-run-summary')).not.toBeInTheDocument()+ expect(summaryCaptures()).toEqual([])+ })+})diff --git a/products/signals/frontend/inbox/components/detail/ReportTaskRow.tsx b/products/signals/frontend/inbox/components/detail/ReportTaskRow.tsxnew file mode 100644index 000000000000..d37a7d5e7837--- /dev/null+++ b/products/signals/frontend/inbox/components/detail/ReportTaskRow.tsx@@ -0,0 +1,139 @@+import { combineUrl } from 'kea-router'+import { useCallback } from 'react'++import { IconChevronDown, IconChevronRight, IconExternal } from '@posthog/icons'+import { Link, Tooltip } from '@posthog/lemon-ui'++import { cn } from 'lib/utils/css-classes'+import { urls } from 'scenes/urls'++import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'+import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'+import { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'++import { captureInboxRunSummaryViewed } from '../../inboxAnalytics'+import type { ReportTaskEntry } from '../../logics/inboxReportDetailLogic'+import { resolveRunVariant, RunStatusIndicator } from '../cards/runStatusVariant'+import { RunLogContainer } from './RunLogContainer'++/**+ * One row of a report's Runs list: the run's status, its purpose label, and — on hover or keyboard+ * focus — the summary the agent wrote for itself. The row expands in place to the run transcript via+ * the shared `ReadonlyRunSurface` (live while the run works, static replay once terminal), and links+ * out to the run's page in Tasks for the full surface.+ *+ * The summary sits in a tooltip rather than in the row because it runs to paragraphs, which no row+ * of this width can hold. A run that wrote none keeps a plain label, so the dotted underline reads+ * as "there is more here".+ */+export function ReportTaskRow({+ entry,+ expanded,+ onToggle,+}: {+ entry: ReportTaskEntry+ expanded: boolean+ onToggle: () => void+}): JSX.Element {+ const { task, purpose, purposeLabel } = entry++ const status = task.latest_run?.status ?? TaskRunStatus.NOT_STARTED+ const runId = task.latest_run?.id ?? null+ const replayOnly = isTerminalRunStatus(task.latest_run?.status)+ const summary = task.latest_run?.task_summary?.trim() || null++ const captureSummaryViewed = useCallback(+ () => captureInboxRunSummaryViewed({ purpose, status, summaryLength: summary?.length ?? 0 }),+ [purpose, status, summary]+ )++ // Deep link to the run's own page in Tasks — the inline transcript is a preview, this is the+ // full surface (run history, composer). Falls back to the task when no run has started yet.+ const taskUrl = runId ? combineUrl(urls.taskDetail(task.id), { runId }).url : urls.taskDetail(task.id)++ const expandButton = (+ <button+ type="button"+ onClick={onToggle}+ aria-expanded={expanded}+ className="flex min-w-0 flex-1 items-center gap-2 text-left"+ >+ {expanded ? (+ <IconChevronDown className="shrink-0 text-tertiary" />+ ) : (+ <IconChevronRight className="shrink-0 text-tertiary" />+ )}+ <RunStatusIndicator variant={resolveRunVariant(status)} showLabel={false} />+ <span+ // pinned: data-attr value — autocapture and Playwright read it+ data-attr={summary ? 'report-run-summary' : undefined}+ className={cn('truncate text-secondary', summary && 'border-b border-dotted')}+ >+ {purposeLabel}+ </span>+ </button>+ )++ return (+ <div>+ <div className="group flex w-full items-center gap-2 rounded px-1.5 py-1 text-xs transition-colors hover:bg-fill-highlight-50">+ {summary ? (+ <Tooltip+ title={<span className="whitespace-pre-line">{summary}</span>}+ placement="bottom-start"+ onOpen={captureSummaryViewed}+ >+ {expandButton}+ </Tooltip>+ ) : (+ expandButton+ )}+ <Link+ to={taskUrl}+ aria-label={`Open ${purposeLabel} run in Tasks`}+ title="Open run in Tasks"+ // A 24px box keeps the tap target clear of the expand button on touch; the negative+ // margin absorbs it back into the row so rows keep their height.+ className="-my-1 flex size-6 shrink-0 items-center justify-center rounded text-tertiary opacity-60 transition-opacity hover:text-primary group-hover:opacity-100"+ >+ <IconExternal className="size-3.5" />+ </Link>+ </div>++ {expanded ? <RunTranscript taskId={task.id} runId={runId} replayOnly={replayOnly} /> : null}+ </div>+ )+}++function RunTranscript({+ taskId,+ runId,+ replayOnly,+}: {+ taskId: string+ runId: string | null+ replayOnly: boolean+}): JSX.Element {+ return (+ <div className="mt-1.5 mb-1 ml-1.5">+ {runId ? (+ // The viewer's virtualized thread owns scroll, so this box only bounds the height and+ // clips — an `overflow-y-auto` here would nest a second scrollbar. Content is kept off+ // the border via `threadRowClassName`/`threadListClassName`, not padding on this box.+ <RunLogContainer>+ <ReadonlyRunSurface+ taskId={taskId}+ runId={runId}+ interaction={replayOnly ? 'read-only' : 'live'}+ threadRowClassName="px-3"+ threadListClassName="py-3"+ />+ </RunLogContainer>+ ) : (+ <div className="rounded border border-primary bg-surface-primary px-3 py-2.5 text-xs text-secondary leading-snug">+ This run hasn't started yet. Its agent log will appear here once it does.+ </div>+ )}+ </div>+ )+}diff --git a/products/signals/frontend/inbox/components/detail/ReportTasksSection.tsx b/products/signals/frontend/inbox/components/detail/ReportTasksSection.tsxindex 7740914e9d22..245873b34ce5 100644--- a/products/signals/frontend/inbox/components/detail/ReportTasksSection.tsx+++ b/products/signals/frontend/inbox/components/detail/ReportTasksSection.tsx@@ -1,30 +1,24 @@import { useActions, useValues } from 'kea'-import { combineUrl } from 'kea-router'-import { IconChevronDown, IconChevronRight, IconExternal, IconTerminal } from '@posthog/icons'-import { LemonSkeleton, Link } from '@posthog/lemon-ui'--import { urls } from 'scenes/urls'--import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'-import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'-import { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'+import { IconTerminal } from '@posthog/icons'+import { LemonSkeleton } from '@posthog/lemon-ui'import { inboxReportDetailLogic, ReportTaskEntry } from '../../logics/inboxReportDetailLogic'import { SignalReport } from '../../types'-import { resolveRunVariant, RunStatusIndicator } from '../cards/runStatusVariant'import { DetailSection } from './DetailSection'-import { RunLogContainer } from './RunLogContainer'+import { ReportTaskRow } from './ReportTaskRow'/**- * Renders the report's linked tasks inline (latest status + purpose). Each row expands in place to- * the task's run transcript via the shared `ReadonlyRunSurface` — live for an in-progress run, static- * replay once terminal — mirroring the Code experience instead of navigating away to a separate run- * page. Each row also links out to the run's page in Tasks for the full surface. The purpose label is- * derived from each task's `task_run` artefact; `repo_selection` runs are filtered out.+ * Renders the report's linked tasks inline (latest status + purpose), each row expanding in place to+ * the task's run transcript — mirroring the Code experience instead of navigating away to a separate+ * run page. The purpose label is derived from each task's `task_run` artefact; `repo_selection` runs+ * are filtered out.*/export function ReportTasksSection({ report }: { report: SignalReport }): JSX.Element | null {- const { reportTasks, reportTasksLoading } = useValues(inboxReportDetailLogic({ reportId: report.id, report }))+ const { reportTasks, reportTasksLoading, expandedTaskIds } = useValues(+ inboxReportDetailLogic({ reportId: report.id, report })+ )+ const { toggleExpandedTask } = useActions(inboxReportDetailLogic({ reportId: report.id, report }))if (reportTasksLoading && !reportTasks) {return (@@ -45,85 +39,14 @@ export function ReportTasksSection({ report }: { report: SignalReport }): JSX.El<DetailSection icon={<IconTerminal />} title="Runs" collapsible><div className="flex flex-col gap-0.5">{reportTasks.map((entry: ReportTaskEntry) => (- <TaskRow key={entry.task.id} entry={entry} reportId={report.id} report={report} />+ <ReportTaskRow+ key={entry.task.id}+ entry={entry}+ expanded={expandedTaskIds.includes(entry.task.id)}+ onToggle={() => toggleExpandedTask(entry.task.id)}+ />))}</div></DetailSection>)}--function TaskRow({- entry,- reportId,- report,-}: {- entry: ReportTaskEntry- reportId: string- report: SignalReport-}): JSX.Element {- const { task, purposeLabel } = entry- const { expandedTaskIds } = useValues(inboxReportDetailLogic({ reportId, report }))- const { toggleExpandedTask } = useActions(inboxReportDetailLogic({ reportId, report }))-- const status = task.latest_run?.status ?? TaskRunStatus.NOT_STARTED- const runId = task.latest_run?.id ?? null- const replayOnly = isTerminalRunStatus(task.latest_run?.status)- const expanded = expandedTaskIds.includes(task.id)-- // Deep link to the run's own page in Tasks — the inline transcript is a preview, this is the- // full surface (run history, composer). Falls back to the task when no run has started yet.- const taskUrl = runId ? combineUrl(urls.taskDetail(task.id), { runId }).url : urls.taskDetail(task.id)-- return (- <div>- <div className="group flex w-full items-center gap-2 rounded px-1.5 py-1 text-xs transition-colors hover:bg-fill-highlight-50">- <button- type="button"- onClick={() => toggleExpandedTask(task.id)}- className="flex min-w-0 flex-1 items-center gap-2 text-left"- >- {expanded ? (- <IconChevronDown className="shrink-0 text-tertiary" />- ) : (- <IconChevronRight className="shrink-0 text-tertiary" />- )}- <RunStatusIndicator variant={resolveRunVariant(status)} showLabel={false} />- <span className="truncate text-secondary">{purposeLabel}</span>- </button>- <Link- to={taskUrl}- aria-label={`Open ${purposeLabel} run in Tasks`}- title="Open run in Tasks"- // A 24px box keeps the tap target clear of the expand button on touch; the negative- // margin absorbs it back into the row so rows keep their height.- className="-my-1 flex size-6 shrink-0 items-center justify-center rounded text-tertiary opacity-60 transition-opacity hover:text-primary group-hover:opacity-100"- >- <IconExternal className="size-3.5" />- </Link>- </div>-- {expanded ? (- <div className="mt-1.5 mb-1 ml-1.5">- {runId ? (- // The viewer's virtualized thread owns scroll, so this box only bounds the height and- // clips — an `overflow-y-auto` here would nest a second scrollbar. Content is kept off- // the border via `threadRowClassName`/`threadListClassName`, not padding on this box.- <RunLogContainer>- <ReadonlyRunSurface- taskId={task.id}- runId={runId}- interaction={replayOnly ? 'read-only' : 'live'}- threadRowClassName="px-3"- threadListClassName="py-3"- />- </RunLogContainer>- ) : (- <div className="rounded border border-primary bg-surface-primary px-3 py-2.5 text-xs text-secondary leading-snug">- This run hasn't started yet. Its agent log will appear here once it does.- </div>- )}- </div>- ) : null}- </div>- )-}diff --git a/products/signals/frontend/inbox/inboxAnalytics.ts b/products/signals/frontend/inbox/inboxAnalytics.tsindex 43976802dbc7..5fe0dff2f513 100644--- a/products/signals/frontend/inbox/inboxAnalytics.ts+++ b/products/signals/frontend/inbox/inboxAnalytics.ts@@ -3,6 +3,9 @@ import type { CaptureOptions } from 'posthog-js'import { dayjs } from 'lib/dayjs'+import type { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'++import type { ReportTaskPurpose } from './components/detail/artefactTypes'import {InboxReportSectionKey,SignalReport,@@ -61,6 +64,7 @@ export const INBOX_EVENTS = {SCOUT_SUGGESTIONS_REFRESHED: 'Scout suggestions refreshed',SCOUT_SUGGESTIONS_CHAT_OPENED: 'Scout suggestions chat opened',RUN_OPENED: 'Inbox run opened',+ RUN_SUMMARY_VIEWED: 'Inbox run summary viewed',ONBOARDING_DECIDED: 'Inbox onboarding decided',} as const@@ -825,6 +829,25 @@ export function captureInboxRunOpened(params: {})}+/**+ * A run's own summary was read on a Runs row. The summary is the cheapest account of what a run did,+ * and it is only reachable on hover, so this is the one signal for whether readers find it.+ *+ * The summary text stays out of the event, like the report title: an agent writes it about a+ * customer's own code and data. `summary_length` is the readable stand-in.+ */+export function captureInboxRunSummaryViewed(params: {+ purpose: ReportTaskPurpose+ status: TaskRunStatus | null+ summaryLength: number+}): void {+ captureInboxEvent(INBOX_EVENTS.RUN_SUMMARY_VIEWED, {+ run_purpose: params.purpose,+ run_status: params.status,+ summary_length: params.summaryLength,+ })+}+/*** What the inbox decided to do about self-driving onboarding, and when it decided nothing, why.*