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.

feat(inbox): Show Runs as a direct list of tasks (#67200)

Michael Matlokad43fb242522e
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 5ed89476b9a2..e70e16c2b4f0 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5652,18 +5652,18 @@ snapshots:
hash: v1.k794b7964.2c0cfa02b7c9abf92fc69e984158c85d95d60dfd8f28a1bf848cafd939454eea.cuvfv9WFi6TvUSaq3b0yVD8_9nM1M8AE7WdVc5zgGIg
scenes-app-inbox-tabs--reports-empty--light:
hash: v1.k794b7964.d550598f1d02e5892b8f9ebf9e0d90eac6440ab1ccd5670db561ba31dbd4ccce.eeGeADdZ1xItGIG3A4hNiK2qsFy3xvNWT0Y2K4P42Wo
+ scenes-app-inbox-tabs--runs--dark:
+ hash: v1.k794b7964.197b12415f95f177d205da1a73d22d0e9a6798dd259b4672e5c5f20b14303b8a.XjQMtNNS3hSyBAHR4Mu1cpuuhqt5FEusJaW0z9uVW44
+ scenes-app-inbox-tabs--runs--light:
+ hash: v1.k794b7964.156c6c7d214933162ca2005131619b264d75b02e6b9adbfe8886a4d0f646d543.AqdwZQ-2fwS4KVfZNpRx0Zmz2Q7A3mdXULAyJR1Qf4k
scenes-app-inbox-tabs--runs-empty--dark:
- hash: v1.k794b7964.4d9d8f081534a1d495b60435f0074dc19527f811d235b9627c605e91db1b5beb.8eFwrG5Hl906n9bTGTp56vy2OiMGtSXrmKGy1OpcfkQ
+ hash: v1.k794b7964.518daac5f707800ff5992d10ba4a0dcc4537d8a75da9ef2aa5fd4b4990004eb8.OQK-NEvjEAYQowvlsEC5lLIANnbgDliAuz02JGQ7vQY
scenes-app-inbox-tabs--runs-empty--light:
- hash: v1.k794b7964.b5ad42de26512ee604d2f82d267a8b7e16a5c78895e1342ae4e3f622bc941e4f.-A5S3-acRXG7neE_qqLlT5rMA6x-sLGUCDkGJlZGHhw
- scenes-app-inbox-tabs--runs-few-agents--dark:
- hash: v1.k794b7964.27c143c92ee236a0307c8a7876c3ea8cd95d40a162f0a64b3423a5325272c03d.yh6WyVyXIwPCAefIFXTn6an_m-T1oO8rplU9Ab0WNpQ
- scenes-app-inbox-tabs--runs-few-agents--light:
- hash: v1.k794b7964.f177cf82929d595046edcfa81a193e6cc13ec70ac0df1156b7aba75fd384a390.dtXjjAcR5IyCU2PvaSjz6_1fsEtTN02jxLuXmGbEjJM
- scenes-app-inbox-tabs--runs-many-agents--dark:
- hash: v1.k794b7964.dd76b59536653a95f1d064c9bc2ad8aea9da9cb6595b487ce86bace171887a46.jvndkfnDbc-t_ydLYTUnT2psRi3WoFtNmFlZGaVUER0
- scenes-app-inbox-tabs--runs-many-agents--light:
- hash: v1.k794b7964.90b19fdceb30d6d27868420db1123615fe3ae01b3a8b1ec4b6d016bd4885d12d.sk9bQDwr1fH7njWhbM40oMj7px6aZ9NmA2Fz1V78VT0
+ hash: v1.k794b7964.fc11ca550f5f8f6776624816fef4c1ea404f02fa5d10f51d6d43c99bd1dc8c1b.j0aZ1w0ksh8VwU5ZviIBJFaWsyS2n7H1xs4M7WQMTXs
+ scenes-app-inbox-tabs--runs-loading--dark:
+ hash: v1.k794b7964.d38ecc24b68e0882dc1512cc6ef4bb769a00c7ff490bbf13332a6f5533413e5a.61RNA6mSoWWNHlewEQJtLjIId6TIRnnU1SLg5dkV8gQ
+ scenes-app-inbox-tabs--runs-loading--light:
+ hash: v1.k794b7964.f7e97180a938a28370ca6e9b8064cf0210294ef5bd6ecb99abd260edb65d4493.XPKVPTM20JaVDK3FBdbpqfBxLk6_sLpz2qXv7FGQ0Cw
scenes-app-inbox-usagewidget--approaching-limit--dark:
hash: v1.k794b7964.d1c4e73a982ac7067e4874efb215788dad85a4b23af33a7ec37d51fb21377ec9.5z9w-oNbDT8vJRdbwNSd0roWSOYoXidiufEtGvwZ9bU
scenes-app-inbox-usagewidget--approaching-limit--light:
diff --git a/frontend/src/scenes/inbox/InboxScene.tsx b/frontend/src/scenes/inbox/InboxScene.tsx
index 31fca028456e..8a0da80cf302 100644
--- a/frontend/src/scenes/inbox/InboxScene.tsx
+++ b/frontend/src/scenes/inbox/InboxScene.tsx
@@ -11,8 +11,6 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import { ScoutDetailView } from './components/config/scouts/ScoutDetailView'
-import { AgentRunDetail } from './components/detail/AgentRunDetail'
-import { InboxDetailHeader } from './components/detail/InboxDetailHeader'
import { ReportDetail, ReportDetailSkeleton } from './components/detail/ReportDetail'
import { FindingsPanel } from './components/findings/FindingsPanel'
import { InboxOnboardingBanner, InboxOnboardingTakeover } from './components/onboarding/InboxOnboarding'
@@ -27,7 +25,7 @@ import { ReportsTab } from './components/tabs/ReportsTab'
import { RunsTab } from './components/tabs/RunsTab'
import { inboxSceneLogic } from './inboxSceneLogic'
import { inboxOnboardingLogic } from './logics/inboxOnboardingLogic'
-import { InboxTabKey, SignalReport } from './types'
+import { InboxTabKey, SignalReport, SignalRun } from './types'
export const scene: SceneExport = {
component: InboxScene,
@@ -42,7 +40,15 @@ function isReportListTab(tab: InboxTabKey): boolean {
return tab === 'pulls' || tab === 'reports' || tab === 'not-actionable' || tab === 'archived'
}
-function ActiveTabBody({ tab, runsReports }: { tab: InboxTabKey; runsReports: SignalReport[] }): JSX.Element {
+function ActiveTabBody({
+ tab,
+ signalRuns,
+ signalRunsLoading,
+}: {
+ tab: InboxTabKey
+ signalRuns: SignalRun[]
+ signalRunsLoading: boolean
+}): JSX.Element {
switch (tab) {
case 'pulls':
return <PullRequestsTab />
@@ -53,7 +59,7 @@ function ActiveTabBody({ tab, runsReports }: { tab: InboxTabKey; runsReports: Si
case 'archived':
return <ArchivedTab />
case 'runs':
- return <RunsTab reports={runsReports} />
+ return <RunsTab runs={signalRuns} loading={signalRunsLoading} />
case 'config':
return <AgentSetupColumn layout="stacked" />
}
@@ -68,7 +74,7 @@ function ActiveTabBody({ tab, runsReports }: { tab: InboxTabKey; runsReports: Si
* and chrome-less.
*/
function InboxListView(): JSX.Element {
- const { activeTab, runsTabReports } = useValues(inboxSceneLogic)
+ const { activeTab, signalRuns, signalRunsLoading } = useValues(inboxSceneLogic)
const { onboardingMode } = useValues(inboxOnboardingLogic)
const { ref: widthRef, size } = useResizeBreakpoints(
{ 0: 'narrow', [SETUP_RAIL_MIN_PX]: 'wide' },
@@ -101,7 +107,11 @@ function InboxListView(): JSX.Element {
{onboarding ? (
<InboxOnboardingTakeover />
) : (
- <ActiveTabBody tab={effectiveTab} runsReports={runsTabReports} />
+ <ActiveTabBody
+ tab={effectiveTab}
+ signalRuns={signalRuns}
+ signalRunsLoading={signalRunsLoading}
+ />
)}
</div>
</div>
@@ -116,21 +126,12 @@ function InboxListView(): JSX.Element {
/**
* Detail view: replaces the list full-width. Report / PR / Not actionable render the unified
- * `ReportDetail`, which owns its own merged header (back link, title, copy link). The Runs view
- * keeps `AgentRunDetail` under the shared `InboxDetailHeader`.
+ * `ReportDetail`, which owns its own merged header (back link, title, copy link). The Runs tab no
+ * longer opens an in-inbox detail — its rows link out to the standalone Tasks scene.
*/
function InboxDetailView({ report }: { report: SignalReport }): JSX.Element {
const { activeTab } = useValues(inboxSceneLogic)
- if (activeTab === 'runs') {
- return (
- <div className="flex flex-col min-h-0 flex-1 overflow-auto">
- <InboxDetailHeader report={report} tab={activeTab} />
- <AgentRunDetail report={report} />
- </div>
- )
- }
-
return (
<div className="flex flex-col min-h-0 flex-1 overflow-auto">
<ReportDetail report={report} tab={activeTab} />
diff --git a/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx b/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
index c98fc5588120..c11d78eed7aa 100644
--- a/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
+++ b/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
@@ -1,6 +1,4 @@
-import clsx from 'clsx'
-
-import { LemonTag, LemonTagType, Link } from '@posthog/lemon-ui'
+import { LemonTag, Link } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
import { urls } from 'scenes/urls'
@@ -9,8 +7,7 @@ import { isFinishedRunReport, isLiveRunReport, isQueuedRunReport } from '../../i
import { SignalReport } from '../../types'
import { deriveHeadline, parsePrUrlParts } from '../../utils/reportPresentation'
import { hasKnownSourceProduct, knownSourceProductEntries, SourceProductIconRow } from '../badges/sourceProductIcons'
-
-type RunVariant = 'queued' | 'live' | 'completed' | 'failed'
+import { RunStatusOrb, RunVariant, VARIANT_META } from './runStatusVariant'
/** Single source of truth for the four-bucket lifecycle of a run-shaped report. */
export function resolveRunVariant(report: SignalReport): RunVariant {
@@ -33,45 +30,6 @@ const RUN_VARIANT_TIMESTAMP_LABEL: Record<RunVariant, string> = {
failed: 'Failed',
}
-interface VariantMeta {
- label: string
- badgeType: LemonTagType
- orbClass: string
- dotClass: string
- ariaLabel: string
-}
-
-const VARIANT_META: Record<RunVariant, VariantMeta> = {
- queued: {
- label: 'Queued',
- badgeType: 'default',
- orbClass: 'bg-fill-primary ring-primary',
- dotClass: 'bg-muted',
- ariaLabel: 'Queued',
- },
- live: {
- label: 'Running',
- badgeType: 'highlight',
- orbClass: 'bg-primary-highlight ring-primary',
- dotClass: 'bg-accent animate-pulse',
- ariaLabel: 'In progress',
- },
- completed: {
- label: 'Completed',
- badgeType: 'success',
- orbClass: 'bg-success-highlight ring-success',
- dotClass: 'bg-success',
- ariaLabel: 'Completed',
- },
- failed: {
- label: 'Failed',
- badgeType: 'danger',
- orbClass: 'bg-danger-highlight ring-danger',
- dotClass: 'bg-danger',
- ariaLabel: 'Failed',
- },
-}
-
function pickTimestamp(report: SignalReport, variant: RunVariant): string {
if (variant === 'live') {
return report.created_at
@@ -79,23 +37,6 @@ function pickTimestamp(report: SignalReport, variant: RunVariant): string {
return report.updated_at ?? report.created_at
}
-function RunStatusOrb({ meta }: { meta: VariantMeta }): JSX.Element {
- return (
- <div
- className={clsx(
- 'flex items-center justify-center h-7 w-7 shrink-0 rounded-full ring-1 ring-inset',
- meta.orbClass
- )}
- >
- <span
- className={clsx('block h-1.5 w-1.5 rounded-full', meta.dotClass)}
- role="img"
- aria-label={meta.ariaLabel}
- />
- </div>
- )
-}
-
/** Source-product icon stack reused inside the run card meta row. */
function RunSourceStack({ sourceProducts }: { sourceProducts?: string[] | null }): JSX.Element | null {
const [primary, ...overflow] = knownSourceProductEntries(sourceProducts)
diff --git a/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx b/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx
new file mode 100644
index 000000000000..9b0228a915f0
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx
@@ -0,0 +1,77 @@
+import clsx from 'clsx'
+
+import { IconCompass, IconSignal } from '@posthog/icons'
+import { LemonTag, Link } from '@posthog/lemon-ui'
+
+import { TZLabel } from 'lib/components/TZLabel'
+import { urls } from 'scenes/urls'
+
+import { SignalRun } from '../../types'
+import { stripScoutPrefix } from '../../utils/scoutRunsWindow'
+import { resolveRunVariant, VARIANT_META } from './runStatusVariant'
+import { inboxCardRowClassName } from './useReportArchive'
+
+export function SignalRunCard({ run }: { run: SignalRun }): JSX.Element {
+ const meta = VARIANT_META[resolveRunVariant(run.status)]
+ const isScout = run.kind === 'scout'
+ // Scout titles are skill code names, shown verbatim in monospace (identifiers, not prose); signal
+ // titles are the originating report's title.
+ const displayTitle = isScout ? stripScoutPrefix(run.title) : run.title
+
+ return (
+ <div className={clsx('relative', inboxCardRowClassName(false))}>
+ {/* The task (agent transcript) is the primary click target; the report link sits in its own
+ column so it isn't nested inside this link. */}
+ <Link
+ to={urls.taskDetail(run.task_id)}
+ className="flex min-w-0 flex-1 items-start gap-2.5 text-left text-inherit no-underline"
+ >
+ {/* One small color-coded dot carries the status — no separate orb or status tag. */}
+ <span
+ className={clsx('mt-1.5 block size-2 shrink-0 rounded-full', meta.dotClass)}
+ role="img"
+ aria-label={meta.ariaLabel}
+ />
+ <div className="flex flex-col gap-1 min-w-0 flex-1">
+ <span
+ className={clsx(
+ 'min-w-0 truncate text-sm leading-snug',
+ isScout ? 'font-mono text-[13px]' : 'font-semibold'
+ )}
+ >
+ {displayTitle || 'Untitled run'}
+ </span>
+ <div className="flex items-center flex-wrap gap-x-2 gap-y-0.5 text-xs text-tertiary leading-none select-none">
+ <LemonTag
+ icon={
+ isScout ? (
+ <IconCompass className="text-tertiary" />
+ ) : (
+ <IconSignal className="text-tertiary" />
+ )
+ }
+ >
+ {isScout ? 'Scout' : 'Signal'}
+ </LemonTag>
+ <span>{meta.label}</span>
+ <span aria-hidden>·</span>
+ <span>
+ Started <TZLabel time={run.created_at} className="tabular-nums align-baseline" />
+ </span>
+ </div>
+ </div>
+ </Link>
+
+ {run.report_id && (
+ <div className="flex items-center shrink-0 @lg:self-stretch @lg:border-l @lg:border-primary @lg:pl-3">
+ <Link
+ to={urls.inboxReport('reports', run.report_id)}
+ className="text-xs font-medium text-accent no-underline"
+ >
+ View report
+ </Link>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx b/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx
new file mode 100644
index 000000000000..abf51e5536c0
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx
@@ -0,0 +1,87 @@
+import clsx from 'clsx'
+
+import { LemonTagType } from '@posthog/lemon-ui'
+
+import { SignalScoutRunStatus } from '../../types'
+
+/** The four-bucket lifecycle every run-shaped card collapses its status into. */
+export type RunVariant = 'queued' | 'live' | 'completed' | 'failed'
+
+/** Single source of truth mapping a run status to its lifecycle variant. Shared by the card (badge +
+ * orb) and the Runs tab (Live vs Past split), so the two can't drift on which statuses are terminal. */
+export function resolveRunVariant(status: SignalScoutRunStatus | null): RunVariant {
+ switch (status) {
+ case 'in_progress':
+ return 'live'
+ case 'completed':
+ return 'completed'
+ case 'failed':
+ case 'cancelled':
+ return 'failed'
+ default:
+ // queued / not_started / null
+ return 'queued'
+ }
+}
+
+/** Whether a run is still live (running or pending) rather than in a terminal state. */
+export function isRunLive(status: SignalScoutRunStatus | null): boolean {
+ const variant = resolveRunVariant(status)
+ return variant === 'live' || variant === 'queued'
+}
+
+export interface VariantMeta {
+ label: string
+ badgeType: LemonTagType
+ orbClass: string
+ dotClass: string
+ ariaLabel: string
+}
+
+export const VARIANT_META: Record<RunVariant, VariantMeta> = {
+ queued: {
+ label: 'Queued',
+ badgeType: 'default',
+ orbClass: 'bg-fill-primary ring-primary',
+ dotClass: 'bg-muted',
+ ariaLabel: 'Queued',
+ },
+ live: {
+ label: 'Running',
+ badgeType: 'highlight',
+ orbClass: 'bg-primary-highlight ring-primary',
+ dotClass: 'bg-accent animate-pulse',
+ ariaLabel: 'In progress',
+ },
+ completed: {
+ label: 'Completed',
+ badgeType: 'success',
+ orbClass: 'bg-success-highlight ring-success',
+ dotClass: 'bg-success',
+ ariaLabel: 'Completed',
+ },
+ failed: {
+ label: 'Failed',
+ badgeType: 'danger',
+ orbClass: 'bg-danger-highlight ring-danger',
+ dotClass: 'bg-danger',
+ ariaLabel: 'Failed',
+ },
+}
+
+export function RunStatusOrb({ meta }: { meta: VariantMeta }): JSX.Element {
+ return (
+ <div
+ className={clsx(
+ 'flex items-center justify-center h-7 w-7 shrink-0 rounded-full ring-1 ring-inset',
+ meta.orbClass
+ )}
+ >
+ <span
+ className={clsx('block h-1.5 w-1.5 rounded-full', meta.dotClass)}
+ role="img"
+ aria-label={meta.ariaLabel}
+ />
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/inbox/components/scratchpad/ScratchpadEntryCard.tsx b/frontend/src/scenes/inbox/components/scratchpad/ScratchpadEntryCard.tsx
index 79a1599cb7b8..5a675a0eb187 100644
--- a/frontend/src/scenes/inbox/components/scratchpad/ScratchpadEntryCard.tsx
+++ b/frontend/src/scenes/inbox/components/scratchpad/ScratchpadEntryCard.tsx
@@ -9,6 +9,8 @@ import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
import type { ScratchpadEntryApi } from 'products/signals/frontend/generated/api.schemas'
+import { stripScoutPrefix } from '../../utils/scoutRunsWindow'
+
type LemonTagType = ComponentProps<typeof LemonTag>['type']
// The key prefix (everything before the first colon) encodes the note's *kind* — what the scout
@@ -32,11 +34,6 @@ function splitKey(key: string): { kind: string | null; body: string } {
return idx > 0 ? { kind: key.slice(0, idx), body: key.slice(idx + 1) } : { kind: null, body: key }
}
-// `signals-scout-apm` → `apm`. The fleet prefix is noise once you're inside the scouts surface.
-function scoutDisplayName(skill: string): string {
- return skill.replace(/^signals-scout-/, '')
-}
-
/**
* One scratchpad note the scout fleet has written about this project. Shares the collapse/expand
* grammar of the scout emission cards: a header (chevron · kind · key · updated time) that stays
@@ -47,7 +44,7 @@ export function ScratchpadEntryCard({ entry }: { entry: ScratchpadEntryApi }): J
const [expanded, setExpanded] = useState(false)
const { kind, body } = splitKey(entry.key)
- const scoutName = entry.created_by_skill ? scoutDisplayName(entry.created_by_skill) : null
+ const scoutName = entry.created_by_skill ? stripScoutPrefix(entry.created_by_skill) : null
// How long the note has been carried forward: a fresh creation reads ~0 days; a large gap
// means the fleet has re-touched this learning across many runs — the "gets sharper" signal.
diff --git a/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx b/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx
index 56240c60b130..fc1d815c9e08 100644
--- a/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx
+++ b/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx
@@ -47,8 +47,8 @@ const WELCOME_TAB_KEY = 'welcome'
type InboxTabBarKey = InboxTabKey | typeof WELCOME_TAB_KEY
/**
- * Tab bar: Pull requests / Reports (everyone) + Not actionable and Runs (staff-only, each with a
- * "Staff" tag). Each report tab shows its own server-computed count. The Configuration tab is only
+ * Tab bar: Pull requests / Reports / Runs (everyone) + Not actionable (staff-only, with a
+ * "Staff" tag). Each flat report tab shows its own server-computed count. The Configuration tab is only
* shown when `showConfigTab` is set – i.e. when the scene is too narrow for the setup rail; on wide
* viewports the rail replaces it.
*
diff --git a/frontend/src/scenes/inbox/components/tabs/InboxTabs.stories.tsx b/frontend/src/scenes/inbox/components/tabs/InboxTabs.stories.tsx
index c894810b513d..ec2eefd54d05 100644
--- a/frontend/src/scenes/inbox/components/tabs/InboxTabs.stories.tsx
+++ b/frontend/src/scenes/inbox/components/tabs/InboxTabs.stories.tsx
@@ -2,16 +2,43 @@ import type { Decorator, Meta, StoryObj } from '@storybook/react'
import { mswDecorator } from '~/mocks/browser'
-import { pullRequestReports, reportTabReports, runReportsFew, runReportsMany } from '../../__mocks__/inboxMocks'
-import { SignalReport } from '../../types'
+import { pullRequestReports, reportTabReports } from '../../__mocks__/inboxMocks'
+import { SignalReport, SignalRun } from '../../types'
import { PullRequestsTab } from './PullRequestsTab'
import { ReportsTab } from './ReportsTab'
import { RunsTab } from './RunsTab'
// Stories for the inbox tab bodies. The flat report tabs (Reports / Pull requests) load via
// `reportListLogic`, so they get an mswDecorator that mocks the reports list endpoint; the
-// Runs tab is prop-driven and receives mock reports directly. Use these to polish list
-// density, card design, and the Runs-tab queued / live / finished sections.
+// Runs tab is prop-driven and receives mock runs directly. Use these to polish list density
+// and the scout/signal run-card design.
+
+const SAMPLE_RUNS: SignalRun[] = [
+ {
+ task_id: 'task-scout-1',
+ kind: 'scout',
+ title: 'signals-scout-error-tracking',
+ status: 'in_progress',
+ report_id: null,
+ created_at: '2026-06-11T10:30:00Z',
+ },
+ {
+ task_id: 'task-signal-1',
+ kind: 'signal',
+ title: 'Users hitting a crash when submitting the login form',
+ status: 'completed',
+ report_id: 'report-1',
+ created_at: '2026-06-11T09:00:00Z',
+ },
+ {
+ task_id: 'task-scout-2',
+ kind: 'scout',
+ title: 'signals-scout-surveys',
+ status: 'failed',
+ report_id: null,
+ created_at: '2026-06-10T18:00:00Z',
+ },
+]
// Mocks the shared reports list endpoint so the logic-driven flat tabs render the given set.
function reportsListDecorator(reports: SignalReport[]): Decorator {
@@ -74,18 +101,18 @@ export const PullRequestsEmpty: Story = {
),
}
-export const RunsManyAgents: Story = {
+export const Runs: Story = {
render: () => (
<div className="bg-primary min-h-screen">
- <RunsTab reports={runReportsMany} />
+ <RunsTab runs={SAMPLE_RUNS} loading={false} />
</div>
),
}
-export const RunsFewAgents: Story = {
+export const RunsLoading: Story = {
render: () => (
<div className="bg-primary min-h-screen">
- <RunsTab reports={runReportsFew} />
+ <RunsTab runs={[]} loading />
</div>
),
}
@@ -93,7 +120,7 @@ export const RunsFewAgents: Story = {
export const RunsEmpty: Story = {
render: () => (
<div className="bg-primary min-h-screen">
- <RunsTab reports={[]} />
+ <RunsTab runs={[]} loading={false} />
</div>
),
}
diff --git a/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx b/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
index 309bb4a7fd54..85ba45d64b17 100644
--- a/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
+++ b/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
@@ -1,94 +1,41 @@
-import { useMemo, useState } from 'react'
-
import { IconBrain } from '@posthog/icons'
-import { isFinishedRunReport, isLiveRunReport, isQueuedRunReport } from '../../inboxMembership'
-import { SignalReport } from '../../types'
-import { AgentRunCard } from '../cards/AgentRunCard'
-
-const RECENTLY_FINISHED_LIMIT = 10
-const QUEUED_LIMIT = 10
+import { SignalRun } from '../../types'
+import { CardSkeleton } from '../cards/CardSkeleton'
+import { isRunLive } from '../cards/runStatusVariant'
+import { SignalRunCard } from '../cards/SignalRunCard'
-function timestampMs(value: string | null | undefined): number {
- if (!value) {
- return 0
+/**
+ * Runs tab: the project's scout and signals-pipeline tasks, split into what's happening now ("Live")
+ * and what's already finished ("Past"). Each row links out to the standalone Tasks scene.
+ * `inboxSceneLogic` merges the two sources newest-first, so each section stays newest-first too. A
+ * skeleton covers the first load so the empty state doesn't flash before any data has been fetched.
+ */
+export function RunsTab({ runs, loading }: { runs: SignalRun[]; loading: boolean }): JSX.Element {
+ const liveRuns: SignalRun[] = []
+ const pastRuns: SignalRun[] = []
+ for (const run of runs) {
+ ;(isRunLive(run.status) ? liveRuns : pastRuns).push(run)
}
- const ms = new Date(value).getTime()
- return Number.isFinite(ms) ? ms : 0
-}
-
-export function RunsTab({ reports }: { reports: SignalReport[] }): JSX.Element {
- const [showAllFinished, setShowAllFinished] = useState(false)
- const [showAllQueued, setShowAllQueued] = useState(false)
-
- const { queuedRuns, liveRuns, finishedRuns } = useMemo(() => {
- const queued: SignalReport[] = []
- const live: SignalReport[] = []
- const finished: SignalReport[] = []
- for (const report of reports) {
- if (isQueuedRunReport(report)) {
- queued.push(report)
- } else if (isLiveRunReport(report)) {
- live.push(report)
- } else if (isFinishedRunReport(report)) {
- finished.push(report)
- }
- }
- const newestFirst = (a: SignalReport, b: SignalReport): number =>
- timestampMs(b.updated_at ?? b.created_at) - timestampMs(a.updated_at ?? a.created_at)
- queued.sort(newestFirst)
- live.sort(newestFirst)
- finished.sort(newestFirst)
- return { queuedRuns: queued, liveRuns: live, finishedRuns: finished }
- }, [reports])
-
- const visibleFinishedRuns = showAllFinished ? finishedRuns : finishedRuns.slice(0, RECENTLY_FINISHED_LIMIT)
- const hiddenFinishedCount = Math.max(0, finishedRuns.length - visibleFinishedRuns.length)
- const finishedShowAll = resolveShowAllControl(
- finishedRuns.length,
- RECENTLY_FINISHED_LIMIT,
- hiddenFinishedCount,
- showAllFinished,
- () => setShowAllFinished(true),
- () => setShowAllFinished(false)
- )
-
- const visibleQueuedRuns = showAllQueued ? queuedRuns : queuedRuns.slice(0, QUEUED_LIMIT)
- const hiddenQueuedCount = Math.max(0, queuedRuns.length - visibleQueuedRuns.length)
- const queuedShowAll = resolveShowAllControl(
- queuedRuns.length,
- QUEUED_LIMIT,
- hiddenQueuedCount,
- showAllQueued,
- () => setShowAllQueued(true),
- () => setShowAllQueued(false)
- )
-
- const hasAnyRuns = queuedRuns.length > 0 || liveRuns.length > 0 || finishedRuns.length > 0
return (
- <div className="mx-auto max-w-3xl flex flex-col gap-4 px-6 py-4">
- {!hasAnyRuns ? (
+ <div className="mx-auto max-w-3xl flex flex-col gap-5 px-6 py-4">
+ {loading ? (
+ <CardSkeleton count={4} variant="cards" />
+ ) : runs.length === 0 ? (
<div className="mx-auto max-w-md flex flex-col items-center text-center py-16 gap-2">
<div className="flex items-center justify-center h-12 w-12 rounded-full bg-fill-primary text-secondary mb-1">
<IconBrain className="text-2xl" />
</div>
- <h3 className="text-base font-semibold m-0">No agents are working on anything right now</h3>
+ <h3 className="text-base font-semibold m-0">No runs yet</h3>
<p className="text-sm text-tertiary m-0">
- When Self-driving kicks one off, you'll see the live run land here until it finishes as a Pull
- request or a Report.
+ Self-driving agent runs.
+ <br />
+ Scouts exploring your data and per-signal agents show up here.
</p>
</div>
) : (
- <div className="flex flex-col gap-5">
- {queuedRuns.length > 0 && (
- <RunsSection
- title="Queued"
- count={queuedRuns.length}
- runs={visibleQueuedRuns}
- showAll={queuedShowAll}
- />
- )}
+ <>
<RunsSection
title="Live"
count={liveRuns.length}
@@ -96,66 +43,33 @@ export function RunsTab({ reports }: { reports: SignalReport[] }): JSX.Element {
runs={liveRuns}
empty={{
title: 'Nothing in motion right now',
- description: 'Self-driving will queue something up here when it kicks off a run.',
+ description: 'Active runs show up here as soon as self-driving kicks one off.',
}}
/>
- {finishedRuns.length > 0 && (
- <RunsSection
- title="Recently finished"
- count={finishedRuns.length}
- runs={visibleFinishedRuns}
- showAll={finishedShowAll}
- />
- )}
- </div>
+ {pastRuns.length > 0 && <RunsSection title="Past" count={pastRuns.length} runs={pastRuns} />}
+ </>
)}
</div>
)
}
-type ShowAllControl =
- | { kind: 'expand'; hiddenCount: number; onClick: () => void }
- | { kind: 'collapse'; onClick: () => void }
-
-function resolveShowAllControl(
- totalCount: number,
- limit: number,
- hiddenCount: number,
- expanded: boolean,
- onExpand: () => void,
- onCollapse: () => void
-): ShowAllControl | undefined {
- if (hiddenCount > 0) {
- return { kind: 'expand', hiddenCount, onClick: onExpand }
- }
- if (expanded && totalCount > limit) {
- return { kind: 'collapse', onClick: onCollapse }
- }
- return undefined
-}
-
interface RunsSectionProps {
title: string
count: number
- description?: string
isLive?: boolean
- runs: SignalReport[]
+ runs: SignalRun[]
empty?: { title: string; description: string }
- showAll?: ShowAllControl
}
-function RunsSection({ title, count, description, isLive, runs, empty, showAll }: RunsSectionProps): JSX.Element {
+function RunsSection({ title, count, isLive, runs, empty }: RunsSectionProps): JSX.Element {
return (
<div className="flex flex-col gap-2">
- <div className="flex flex-col gap-0.5 cursor-default select-none">
- <div className="flex items-center gap-2">
- <span className="font-semibold text-[13px] text-default">{title}</span>
- <span className="text-xs text-tertiary tabular-nums">{count}</span>
- {isLive && count > 0 && (
- <span className="inline-flex h-1.5 w-1.5 animate-pulse rounded-full bg-accent" aria-hidden />
- )}
- </div>
- {description && <span className="text-xs text-secondary leading-snug">{description}</span>}
+ <div className="flex items-center gap-2 cursor-default select-none">
+ <span className="font-semibold text-[13px] text-default">{title}</span>
+ <span className="text-xs text-tertiary tabular-nums">{count}</span>
+ {isLive && count > 0 && (
+ <span className="inline-flex h-1.5 w-1.5 animate-pulse rounded-full bg-accent" aria-hidden />
+ )}
</div>
{runs.length === 0 && empty ? (
<div className="flex items-center gap-3 cursor-default select-none rounded border border-dashed border-primary bg-surface-secondary px-4 py-3.5">
@@ -169,20 +83,11 @@ function RunsSection({ title, count, description, isLive, runs, empty, showAll }
</div>
) : (
<div className="flex flex-col gap-3">
- {runs.map((report) => (
- <AgentRunCard key={report.id} report={report} />
+ {runs.map((run) => (
+ <SignalRunCard key={run.task_id} run={run} />
))}
</div>
)}
- {showAll && (
- <button
- type="button"
- onClick={showAll.onClick}
- className="self-start rounded px-1.5 py-1 font-medium text-xs text-accent hover:bg-accent-highlight"
- >
- {showAll.kind === 'collapse' ? 'Show less' : `Show all ${showAll.hiddenCount} more`}
- </button>
- )}
</div>
)
}
diff --git a/frontend/src/scenes/inbox/inboxSceneLogic.test.ts b/frontend/src/scenes/inbox/inboxSceneLogic.test.ts
new file mode 100644
index 000000000000..f0997bf4dba9
--- /dev/null
+++ b/frontend/src/scenes/inbox/inboxSceneLogic.test.ts
@@ -0,0 +1,84 @@
+import { OriginProduct, Task, TaskRun, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
+
+import { mergeSignalRuns } from './inboxSceneLogic'
+import { SignalScoutRunSummary } from './types'
+
+function scoutRun(overrides: Partial<SignalScoutRunSummary> = {}): SignalScoutRunSummary {
+ return {
+ run_id: 'run-1',
+ skill_name: 'signals-scout-error-tracking',
+ skill_version: 1,
+ status: 'completed',
+ created_at: '2026-06-11T10:00:00Z',
+ started_at: '2026-06-11T10:00:00Z',
+ completed_at: null,
+ task_id: 'task-scout',
+ summary: '',
+ emitted_count: 0,
+ emitted_finding_ids: [],
+ emitted_report_ids: [],
+ edited_report_ids: [],
+ ...overrides,
+ }
+}
+
+function signalTask(overrides: Partial<Task> = {}): Task {
+ return {
+ id: 'task-signal',
+ task_number: null,
+ slug: '',
+ title: 'Crash on login',
+ description: '',
+ origin_product: OriginProduct.SIGNAL_REPORT,
+ repository: null,
+ github_integration: null,
+ signal_report: 'report-1',
+ json_schema: null,
+ internal: false,
+ latest_run: null,
+ created_at: '2026-06-11T09:00:00Z',
+ updated_at: '2026-06-11T09:00:00Z',
+ created_by: null,
+ ...overrides,
+ }
+}
+
+describe('mergeSignalRuns', () => {
+ it('drops scout runs without a backing task_id (they cannot deep-link to a task)', () => {
+ const merged = mergeSignalRuns([scoutRun({ task_id: null }), scoutRun({ task_id: 'task-ok' })], [])
+ expect(merged.map((r) => r.task_id)).toEqual(['task-ok'])
+ })
+
+ it('interleaves scout and signal rows newest-first by created_at', () => {
+ const merged = mergeSignalRuns(
+ [scoutRun({ task_id: 'scout-old', created_at: '2026-06-10T00:00:00Z' })],
+ [signalTask({ id: 'signal-new', created_at: '2026-06-12T00:00:00Z' })]
+ )
+ expect(merged.map((r) => r.task_id)).toEqual(['signal-new', 'scout-old'])
+ })
+
+ it('tags kind and title per source (scout → skill_name, signal → report title)', () => {
+ const [scoutRow, signalRow] = mergeSignalRuns(
+ [scoutRun({ task_id: 'scout', skill_name: 'signals-scout-surveys', created_at: '2026-06-11T11:00:00Z' })],
+ [signalTask({ id: 'signal', title: 'Slow query', created_at: '2026-06-11T08:00:00Z' })]
+ )
+ expect(scoutRow).toMatchObject({ kind: 'scout', title: 'signals-scout-surveys', report_id: null })
+ expect(signalRow).toMatchObject({ kind: 'signal', title: 'Slow query', report_id: 'report-1' })
+ })
+
+ it('falls back to the task timestamp and a null status when a signal task has no run', () => {
+ const [row] = mergeSignalRuns([], [signalTask({ latest_run: null, created_at: '2026-06-11T07:00:00Z' })])
+ expect(row).toMatchObject({ status: null, created_at: '2026-06-11T07:00:00Z' })
+ })
+
+ it("maps the latest run's task status to the scout status string, and uses the run's timestamp", () => {
+ const latest_run = {
+ status: TaskRunStatus.IN_PROGRESS,
+ created_at: '2026-06-11T12:00:00Z',
+ } as TaskRun
+ const [row] = mergeSignalRuns([], [signalTask({ latest_run, created_at: '2026-06-11T07:00:00Z' })])
+ // The `TaskRunStatus` enum is bridged to the equivalent `SignalScoutRunStatus` string the row
+ // field holds (here 'in_progress'), and the run's own timestamp wins over the task's.
+ expect(row).toMatchObject({ status: 'in_progress', created_at: '2026-06-11T12:00:00Z' })
+ })
+})
diff --git a/frontend/src/scenes/inbox/inboxSceneLogic.ts b/frontend/src/scenes/inbox/inboxSceneLogic.ts
index 2ba274970605..a78f12aabc6e 100644
--- a/frontend/src/scenes/inbox/inboxSceneLogic.ts
+++ b/frontend/src/scenes/inbox/inboxSceneLogic.ts
@@ -4,7 +4,7 @@ import { actionToUrl, router, urlToAction } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
-import api, { CountedPaginatedResponse } from 'lib/api'
+import api from 'lib/api'
import { sceneConfigurations } from 'scenes/scenes'
import { Scene } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -12,24 +12,86 @@ import { userLogic } from 'scenes/userLogic'
import { Breadcrumb } from '~/types'
+import { OriginProduct, Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
+
import {
captureInboxReportClosed,
captureInboxReportOpened,
InboxReportCloseMethod,
InboxReportOpenMethod,
} from './inboxAnalytics'
-import { isAgentRunReport, isFinishedRunReport } from './inboxMembership'
import type { inboxSceneLogicType } from './inboxSceneLogicType'
-import { INBOX_PIPELINE_STATUS_FILTERS } from './logics/inboxFiltersLogic'
import { INBOX_FLAT_TAB_LIST_PARAMS, reportListLogic } from './logics/reportListLogic'
import { scratchpadLogic } from './logics/scratchpadLogic'
import { signalSourcesLogic } from './signalSourcesLogic'
-import { InboxFlatListTabKey, INBOX_STAFF_ONLY_TAB_KEYS, INBOX_TAB_KEYS, InboxTabKey, SignalReport } from './types'
+import {
+ InboxFlatListTabKey,
+ INBOX_STAFF_ONLY_TAB_KEYS,
+ INBOX_TAB_KEYS,
+ InboxTabKey,
+ SignalReport,
+ SignalRun,
+ SignalScoutRunStatus,
+ SignalScoutRunSummary,
+} from './types'
-const RUNS_PAGE_SIZE = 200
+// Newest-first scout runs to pull for the Runs tab. The scout-runs endpoint caps at 100 server-side.
+const SCOUT_RUNS_LIMIT = 100
+// Signal-pipeline tasks to pull. Bounded symmetrically with the scout side (the tasks endpoint caps
+// at 100); passed explicitly so the cap is visible rather than relying on the server default.
+const SIGNAL_TASKS_LIMIT = 100
+// How often the Runs tab refetches while it's open, so live runs update in place.
+const RUNS_POLL_INTERVAL_MS = 5000
const SESSION_ANALYSIS_POLL_INTERVAL_MS = 5000
+// `TaskRunStatus` and `SignalScoutRunStatus` enumerate the same run states. This `Record` keyed on the
+// enum makes the relationship exhaustive: a new `TaskRunStatus` value breaks the build here instead of
+// silently rendering as 'queued', so the two type vocabularies can't drift unnoticed.
+const TASK_RUN_STATUS_TO_SCOUT_STATUS: Record<TaskRunStatus, SignalScoutRunStatus> = {
+ [TaskRunStatus.NOT_STARTED]: 'not_started',
+ [TaskRunStatus.QUEUED]: 'queued',
+ [TaskRunStatus.IN_PROGRESS]: 'in_progress',
+ [TaskRunStatus.COMPLETED]: 'completed',
+ [TaskRunStatus.FAILED]: 'failed',
+ [TaskRunStatus.CANCELLED]: 'cancelled',
+}
+
+/**
+ * Merge the Runs tab's two sources — scout runs and signal-pipeline tasks — into one newest-first
+ * `SignalRun[]`. Pure (no I/O) so the merge/sort/normalize contract is unit-testable directly.
+ * Scout runs without a backing `task_id` are dropped (they can't deep-link to a task); signal rows
+ * fall back to the task's own timestamp / a null status when no run exists yet.
+ */
+export function mergeSignalRuns(scoutRuns: SignalScoutRunSummary[], signalTasks: Task[]): SignalRun[] {
+ const scoutRows = scoutRuns
+ .filter((run): run is SignalScoutRunSummary & { task_id: string } => !!run.task_id)
+ .map(
+ (run): SignalRun => ({
+ task_id: run.task_id,
+ kind: 'scout',
+ title: run.skill_name,
+ status: run.status,
+ report_id: null,
+ created_at: run.created_at,
+ })
+ )
+ const signalRows = signalTasks.map((task): SignalRun => {
+ const latestStatus = task.latest_run?.status
+ return {
+ task_id: task.id,
+ kind: 'signal',
+ title: task.title,
+ status: latestStatus ? TASK_RUN_STATUS_TO_SCOUT_STATUS[latestStatus] : null,
+ report_id: task.signal_report,
+ created_at: task.latest_run?.created_at ?? task.created_at,
+ }
+ })
+ return [...scoutRows, ...signalRows].sort(
+ (a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()
+ )
+}
+
function isInboxTabKey(value: string | undefined): value is InboxTabKey {
return value !== undefined && (INBOX_TAB_KEYS as string[]).includes(value)
}
@@ -39,8 +101,8 @@ function isStaffOnlyTab(tab: string | undefined): boolean {
}
/**
- * Find a report already loaded in one of the mounted per-tab lists (or the staff Runs list),
- * so opening it can render the detail instantly from the list row instead of waiting on a fresh
+ * Find a report already loaded in one of the mounted per-tab lists, so opening it can render the
+ * detail instantly from the list row instead of waiting on a fresh
* `GET`. The background fetch still runs to converge on the authoritative record.
*/
// The Fleet memory callout reads the same singleton `scratchpadLogic` the panel filters, so a
@@ -53,14 +115,10 @@ function clearScratchpadSearch(): void {
}
}
-function findLoadedReport(id: string, runsReports: SignalReport[]): SignalReport | null {
- const fromRuns = runsReports.find((r) => r.id === id)
- if (fromRuns) {
- return fromRuns
- }
+function findLoadedReport(id: string): SignalReport | null {
for (const tabKey of Object.keys(INBOX_FLAT_TAB_LIST_PARAMS) as InboxFlatListTabKey[]) {
const mounted = reportListLogic.findMounted({ tabKey, listParams: INBOX_FLAT_TAB_LIST_PARAMS[tabKey] })
- const found = mounted?.values.reports.find((r) => r.id === id)
+ const found = mounted?.values.reports.find((r: SignalReport) => r.id === id)
if (found) {
return found
}
@@ -69,29 +127,19 @@ function findLoadedReport(id: string, runsReports: SignalReport[]): SignalReport
}
/**
- * Position (1-based) and size of the report's list, for `Inbox report opened`. Prefers the active
- * Runs list when it's open, then any mounted flat-tab list that holds the report. Null when the
- * report isn't in a loaded list (e.g. a cold deep-link).
+ * Position (1-based) and size of the report's list, for `Inbox report opened`. Searches the mounted
+ * flat-tab lists for the report. Null when the report isn't in a loaded list (e.g. a cold deep-link).
*/
-function findReportRank(
- id: string,
- activeTab: InboxTabKey,
- runsReports: SignalReport[]
-): { rank: number | null; listSize: number | null } {
- const lists: SignalReport[][] = []
- if (activeTab === 'runs') {
- lists.push(runsReports)
- }
+function findReportRank(id: string): { rank: number | null; listSize: number | null } {
for (const tabKey of Object.keys(INBOX_FLAT_TAB_LIST_PARAMS) as InboxFlatListTabKey[]) {
const mounted = reportListLogic.findMounted({ tabKey, listParams: INBOX_FLAT_TAB_LIST_PARAMS[tabKey] })
- if (mounted) {
- lists.push(mounted.values.reports)
+ const reports = mounted?.values.reports
+ if (!reports) {
+ continue
}
- }
- for (const list of lists) {
- const idx = list.findIndex((r) => r.id === id)
+ const idx = reports.findIndex((r: SignalReport) => r.id === id)
if (idx >= 0) {
- return { rank: idx + 1, listSize: list.length }
+ return { rank: idx + 1, listSize: reports.length }
}
}
return { rank: null, listSize: null }
@@ -132,7 +180,7 @@ interface InboxOpenTracking {
/**
* Inbox scene orchestrator. Owns the active tab, the selected report (loaded by id),
- * the staff-only project-wide Runs list, and session-analysis. The per-tab report
+ * the project-wide Runs list, and session-analysis. The per-tab report
* lists + their counts live in the keyed `reportListLogic` (one instance per flat tab),
* so this logic no longer holds a shared report list.
*/
@@ -172,17 +220,34 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
}),
loaders(() => ({
- // Staff-only Runs tab: project-wide, UNFILTERED (no reviewer scope / source / priority / search) –
- // every report whose run is in progress or has concluded.
- runsResponse: [
- null as CountedPaginatedResponse<SignalReport> | null,
+ // Runs tab: a newest-first list of scout + signals-pipeline runs, composed from two existing
+ // endpoints, scout runs (clean `skill_name`) and signal-pipeline tasks (whose title is the
+ // originating report's title). Merged client-side; there is no unified backend "runs" resource
+ // by design. Both endpoints are team-scoped and readable by any member, so the tab is public.
+ signalRunsResponse: [
+ null as SignalRun[] | null,
{
- loadRuns: async () => {
- return await api.signalReports.list({
- status: INBOX_PIPELINE_STATUS_FILTERS.join(','),
- ordering: 'status,-updated_at',
- limit: RUNS_PAGE_SIZE,
- })
+ loadRuns: async (_payload: void, breakpoint) => {
+ const [scoutResult, signalResult] = await Promise.allSettled([
+ api.signalScout.runs.list({ limit: SCOUT_RUNS_LIMIT }),
+ // `internal: 'all'` so the pipeline's research runs (created internal) are included,
+ // not just the non-internal implementation/PR runs.
+ api.tasks.list({
+ origin_product: OriginProduct.SIGNAL_REPORT,
+ internal: 'all',
+ limit: SIGNAL_TASKS_LIMIT,
+ }),
+ ])
+ breakpoint()
+ // Degrade gracefully: surface whichever source resolved, matching the inbox's other
+ // fan-out loaders (scoutDetailLogic) so one source's outage doesn't blank the tab.
+ // Only fail the load if both sources rejected.
+ if (scoutResult.status === 'rejected' && signalResult.status === 'rejected') {
+ throw scoutResult.reason
+ }
+ const scoutRuns = scoutResult.status === 'fulfilled' ? scoutResult.value : []
+ const signalTasks = signalResult.status === 'fulfilled' ? signalResult.value.results : []
+ return mergeSignalRuns(scoutRuns, signalTasks)
},
},
],
@@ -273,12 +338,18 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
],
],
isStaff: [() => [userLogic.selectors.user], (user): boolean => user?.is_staff ?? false],
- runsTabReports: [
- (s) => [s.runsResponse],
- (runsResponse: CountedPaginatedResponse<SignalReport> | null): SignalReport[] =>
- (runsResponse?.results ?? []).filter((r) => isAgentRunReport(r) || isFinishedRunReport(r)),
+ signalRuns: [
+ (s) => [s.signalRunsResponse],
+ (signalRunsResponse: SignalRun[] | null): SignalRun[] => signalRunsResponse ?? [],
+ ],
+ // True only while the first load is in flight (response still null), so the Runs tab shows a
+ // skeleton instead of the empty state before any data lands. A refetch on tab re-open keeps the
+ // already-loaded list visible rather than flashing the skeleton.
+ signalRunsLoading: [
+ (s) => [s.signalRunsResponse, s.signalRunsResponseLoading],
+ (signalRunsResponse: SignalRun[] | null, signalRunsResponseLoading: boolean): boolean =>
+ signalRunsResponse === null && signalRunsResponseLoading,
],
- runsCount: [(s) => [s.runsTabReports], (runsTabReports: SignalReport[]): number => runsTabReports.length],
selectedReport: [
(s) => [s.selectedReportResponse],
(selectedReportResponse: SignalReport | null): SignalReport | null => selectedReportResponse,
@@ -291,9 +362,18 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
listeners(({ actions, values, cache }) => ({
setActiveTab: ({ tab }) => {
- // Refresh the project-wide runs list each time the (staff-only) Runs tab opens.
- if (tab === 'runs' && values.isStaff) {
+ // While the Runs tab is open, refetch on a slow poll so live runs update in place. The
+ // keyed disposable replaces any prior poll and is torn down on tab switch / unmount, and
+ // kea-disposables pauses it while the browser tab is hidden. The refetch is silent (the
+ // skeleton only shows before the first load), so it swaps the list without flicker.
+ if (tab === 'runs') {
actions.loadRuns()
+ cache.disposables.add(() => {
+ const interval = setInterval(() => actions.loadRuns(), RUNS_POLL_INTERVAL_MS)
+ return () => clearInterval(interval)
+ }, 'runsPoll')
+ } else {
+ cache.disposables.dispose('runsPoll')
}
},
setSelectedReportId: ({ id, openMethod }) => {
@@ -324,7 +404,7 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
actions.setSelectedScoutSkillName(null)
}
// Reuse the list row if we already have it (instant render), then refresh from the server.
- actions.seedSelectedReport(findLoadedReport(id, values.runsTabReports))
+ actions.seedSelectedReport(findLoadedReport(id))
actions.loadSelectedReport({ id })
},
// Fire `Inbox report opened` once the authoritative record lands (skip background refreshes
@@ -336,7 +416,7 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
if (!report || values.selectedReportId !== report.id || cache.openTracking?.report.id === report.id) {
return
}
- const { rank, listSize } = findReportRank(report.id, values.activeTab, values.runsTabReports)
+ const { rank, listSize } = findReportRank(report.id)
captureInboxReportOpened({
report,
openMethod: (cache.pendingOpenMethod as InboxReportOpenMethod | undefined) ?? 'unknown',
@@ -403,13 +483,9 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
},
})),
- events(({ actions, values, cache }) => ({
- afterMount: () => {
- // Runs is a staff-only (internal) tab; only fetch its list for staff users.
- if (values.isStaff) {
- actions.loadRuns()
- }
- },
+ events(({ cache }) => ({
+ // The Runs list loads lazily when its tab opens (via the `setActiveTab` listener). There is no
+ // mount pre-fetch, so an inbox visit that never opens Runs doesn't pay for its two requests.
beforeUnmount: () => {
clearInterval(cache.sessionAnalysisPollInterval)
// Flush dwell time for a report still open when the scene unmounts (navigated away).
@@ -501,7 +577,7 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
return
}
cache.inboxListVisited = true
- // Staff-only tabs (Runs, Not actionable): bounce non-staff to the default tab.
+ // Staff-only tabs (Not actionable): bounce non-staff to the default tab.
if (isStaffOnlyTab(tab) && userLogic.values.user != null && !values.isStaff) {
actions.setActiveTab('pulls')
return
diff --git a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
index 505c05903627..0d8f43f22a88 100644
--- a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
@@ -3,7 +3,7 @@ import { loaders } from 'kea-loaders'
import api from 'lib/api'
-import { INBOX_SCOPE_FOR_YOU, InboxScope, SignalReportPriority, SignalReportStatus } from '../types'
+import { INBOX_SCOPE_FOR_YOU, InboxScope, SignalReportPriority } from '../types'
import type { inboxFiltersLogicType } from './inboxFiltersLogicType'
/** A teammate who can be scoped to / suggested as a reviewer. Matches the `available_reviewers` API row. */
@@ -13,21 +13,6 @@ export interface InboxReviewerOption {
email: string
}
-/**
- * Status set always sent to the list API: every in-flight pipeline status.
- * Mirrors desktop `INBOX_PIPELINE_STATUS_FILTER`. There is no user-facing status
- * filter (desktop dropped it in filter-store v2); status is a fixed request
- * constant, and tab membership does the rest of the partitioning client-side.
- */
-export const INBOX_PIPELINE_STATUS_FILTERS: SignalReportStatus[] = [
- SignalReportStatus.POTENTIAL,
- SignalReportStatus.CANDIDATE,
- SignalReportStatus.IN_PROGRESS,
- SignalReportStatus.READY,
- SignalReportStatus.PENDING_INPUT,
- SignalReportStatus.FAILED,
-]
-
export type InboxSortField = 'priority' | 'created_at' | 'updated_at'
export type InboxSortDirection = 'asc' | 'desc'
diff --git a/frontend/src/scenes/inbox/types.ts b/frontend/src/scenes/inbox/types.ts
index 39dc084e5991..e29aad758c10 100644
--- a/frontend/src/scenes/inbox/types.ts
+++ b/frontend/src/scenes/inbox/types.ts
@@ -138,10 +138,10 @@ export const INBOX_CONFIG_TAB_KEY: InboxTabKey = 'config'
export const INBOX_REPORT_TAB_KEYS: InboxTabKey[] = ['pulls', 'reports', 'not-actionable', 'runs', 'archived']
/**
- * Tabs only visible to staff users (internal). Non-staff see Pull requests + Reports.
- * Not-actionable reports and the project-wide Runs debug view are internal.
+ * Tabs only visible to staff users (internal). The Not-actionable reports view is an internal
+ * triage surface; everything else (including Runs) is public to any team member.
*/
-export const INBOX_STAFF_ONLY_TAB_KEYS: InboxTabKey[] = ['not-actionable', 'runs']
+export const INBOX_STAFF_ONLY_TAB_KEYS: InboxTabKey[] = ['not-actionable']
/** The flat report-list tabs that share the keyed reportListLogic + InboxReportList primitive. */
export const INBOX_FLAT_LIST_TAB_KEYS = ['pulls', 'reports', 'not-actionable', 'archived'] as const
@@ -200,6 +200,29 @@ export interface SignalTeamConfig {
updated_at?: string
}
+// ── Runs (composed client-side from scout runs + signal-pipeline tasks) ───────
+
+/** Whether a run-shaped task came from a headless scout or the signals pipeline. */
+export type SignalRunKind = 'scout' | 'signal'
+
+/**
+ * One row in the Runs tab. Not a backend resource — `inboxSceneLogic` composes these from two
+ * existing endpoints: scout runs (`signals/scout/runs`, kind `scout`) and signal-pipeline tasks
+ * (`tasks?origin_product=signal_report`, kind `signal`), merged newest-first. Rows link out to the
+ * standalone Tasks scene (`/tasks/{task_id}`).
+ */
+export interface SignalRun {
+ task_id: string
+ kind: SignalRunKind
+ /** Scout: the `signals-scout-*` skill code name (shown verbatim). Signal: the report title. */
+ title: string
+ /** Latest run status, or null if unknown. Shares `TaskRunStatus` values. */
+ status: SignalScoutRunStatus | null
+ /** Signal runs: the inbox report this run belongs to, for linking to it. Null for scouts. */
+ report_id: string | null
+ created_at: string
+}
+
// ── Scouts (backend SignalScoutConfigViewSet / SignalScoutRunViewSet) ─────────
/** Canonical (PostHog-shipped) vs custom (team-authored) scout, resolved server-side. */
diff --git a/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts b/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts
index ffb4ef22dca2..ef9a910cdc1c 100644
--- a/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts
+++ b/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts
@@ -49,12 +49,21 @@ export function mostRecentEmittedRuns(runs: SignalScoutRunSummary[]): SignalScou
)
}
+// ── Scout skill-name helpers ──────────────────────────────────────────────────
+
+/** The shared `signals-scout-*` skill-name prefix. The fleet prefix is noise inside the scouts surface. */
+export const SIGNALS_SCOUT_SKILL_PREFIX = 'signals-scout-'
+
+/** Strip the fleet prefix, leaving the bare scout code name verbatim. `signals-scout-apm` → `apm`. */
+export function stripScoutPrefix(skillName: string): string {
+ return skillName.startsWith(SIGNALS_SCOUT_SKILL_PREFIX)
+ ? skillName.slice(SIGNALS_SCOUT_SKILL_PREFIX.length)
+ : skillName
+}
+
/** "signals-scout-error-tracking" → "Error tracking" */
export function prettifyScoutSkillName(skillName: string): string {
- const cleaned = skillName
- .replace(/^signals-scout-/, '')
- .replace(/[-_]/g, ' ')
- .trim()
+ const cleaned = stripScoutPrefix(skillName).replace(/[-_]/g, ' ').trim()
if (!cleaned) {
return skillName
}
diff --git a/products/posthog_ai/frontend/logics/taskLogic.test.ts b/products/posthog_ai/frontend/logics/taskLogic.test.ts
index 8e2cb6d903d4..7dc0bbb3f151 100644
--- a/products/posthog_ai/frontend/logics/taskLogic.test.ts
+++ b/products/posthog_ai/frontend/logics/taskLogic.test.ts
@@ -17,6 +17,7 @@ const createMockTask = (id: string): Task => ({
origin_product: OriginProduct.USER_CREATED,
repository: 'test/repo',
github_integration: null,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: null,
diff --git a/products/posthog_ai/frontend/logics/tasksLogic.test.ts b/products/posthog_ai/frontend/logics/tasksLogic.test.ts
index 838ea902b1ea..485e14c30fb3 100644
--- a/products/posthog_ai/frontend/logics/tasksLogic.test.ts
+++ b/products/posthog_ai/frontend/logics/tasksLogic.test.ts
@@ -19,6 +19,7 @@ const createMockTask = (id: string): Task => ({
origin_product: OriginProduct.USER_CREATED,
repository: 'test/repo',
github_integration: null,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
index e835854dea71..c4db6326e0a4 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
@@ -50,6 +50,7 @@ const TASKS: Task[] = [
origin_product: OriginProduct.USER_CREATED,
repository: 'PostHog/posthog',
github_integration: 1,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: mockRun('task-1', TaskRunStatus.COMPLETED, '2024-01-15T09:30:00Z', '2024-01-15T09:48:00Z'),
@@ -66,6 +67,7 @@ const TASKS: Task[] = [
origin_product: OriginProduct.USER_CREATED,
repository: 'PostHog/posthog',
github_integration: 1,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: mockRun('task-2', TaskRunStatus.COMPLETED, '2024-01-15T11:40:00Z', '2024-01-15T11:52:00Z'),
@@ -82,6 +84,7 @@ const TASKS: Task[] = [
origin_product: OriginProduct.USER_CREATED,
repository: 'PostHog/posthog',
github_integration: 1,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
index ed79dfc8aee8..d85ed6f4b435 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
@@ -18,6 +18,7 @@ const createMockTask = (id: string): Task => ({
origin_product: OriginProduct.USER_CREATED,
repository: 'test/repo',
github_integration: null,
+ signal_report: null,
json_schema: null,
internal: false,
latest_run: null,
diff --git a/products/posthog_ai/frontend/types/taskTypes.ts b/products/posthog_ai/frontend/types/taskTypes.ts
index abaefd639929..1940bd477b2b 100644
--- a/products/posthog_ai/frontend/types/taskTypes.ts
+++ b/products/posthog_ai/frontend/types/taskTypes.ts
@@ -76,6 +76,8 @@ export interface Task {
origin_product: OriginProduct
repository: string | null
github_integration: number | null
+ /** For signal-report-origin tasks: the inbox `SignalReport` this task ran for (set-once at creation). */
+ signal_report: string | null
json_schema: Record<string, any> | null
internal: boolean
latest_run: TaskRun | null
@@ -101,9 +103,13 @@ export interface TaskListParams {
organization?: string
stage?: string
origin_product?: string
- internal?: boolean
+ /** `all` includes internal tasks (shown-by-default flag, not an access gate); `true` is a staff-only internal-only view. */
+ internal?: 'true' | 'false' | 'all'
search?: string
status?: TaskRunStatus
+ /** Page size (LimitOffset pagination); the viewset caps it at 100. */
+ limit?: number
+ offset?: number
}
export interface KanbanColumn {
diff --git a/products/signals/backend/auto_start.py b/products/signals/backend/auto_start.py
index 59ac84376954..fc47f65a58cb 100644
--- a/products/signals/backend/auto_start.py
+++ b/products/signals/backend/auto_start.py
@@ -134,7 +134,9 @@ def _create_implementation_task_if_absent(
team = Team.objects.select_related("organization").get(id=team_id)
created = tasks_facade.create_and_run_task(
team=team,
- title=title,
+ # "Implementation: <report title>" mirrors the research task's "Research: <report title>"
+ # relabel, so the Runs surface reads "<relationship>: <report>" for every pipeline run.
+ title=f"Implementation: {title}",
description=description,
origin_product=tasks_facade.TaskOriginProduct.SIGNAL_REPORT,
user_id=user_id,
diff --git a/products/signals/backend/temporal/agentic/report.py b/products/signals/backend/temporal/agentic/report.py
index be581349edd6..7107c6bbe633 100644
--- a/products/signals/backend/temporal/agentic/report.py
+++ b/products/signals/backend/temporal/agentic/report.py
@@ -273,6 +273,14 @@ async def _persist_agentic_report_artefacts(
artefacts=artefacts,
)
+ # Backfill the research task's title now that research has produced the report title. At
+ # task-creation time the report has no title yet (research is what produces it), so the task
+ # starts with a sandbox-prompt placeholder; relabel it "Research: <report title>".
+ if result.research_task_id and result.title:
+ await database_sync_to_async(tasks_facade.set_task_title, thread_sensitive=False)(
+ result.research_task_id, team_id, f"Research: {result.title}"
+ )
+
try:
await maybe_autostart_implementation_task(
team_id=team_id,
diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.py
index a57f377df9e7..30b8ac55af8a 100644
--- a/products/tasks/backend/facade/api.py
+++ b/products/tasks/backend/facade/api.py
@@ -165,6 +165,7 @@ __all__ = [
"send_user_message",
"select_repository_for_message",
"set_task_run_output",
+ "set_task_title",
"signal_report_queryset",
"signal_task_run_user_message",
"signal_workflow_completion",
@@ -2639,8 +2640,13 @@ def _list_tasks_queryset(
latest_run_status = latest_run.values("status")[:1]
qs = qs.annotate(_latest_run_status=Subquery(latest_run_status)).filter(_latest_run_status=status_filter)
+ # `internal` controls default visibility, not access — task visibility (applied above) is the real
+ # authorization boundary. `all` returns both and is open to any team member; `true` (only-internal)
+ # stays a staff/debug view; the default excludes internal tasks so the main task list stays clean.
internal_param = filters.get("internal")
- if internal_param is True and is_debug_or_staff:
+ if internal_param == "all":
+ pass
+ elif internal_param == "true" and is_debug_or_staff:
qs = qs.filter(internal=True)
else:
qs = qs.filter(internal=False)
@@ -2859,6 +2865,15 @@ def create_task(team_id: int, user_id: int | None, *, validated_data: dict) -> c
return _task_detail_to_dto(_task_detail_queryset().get(pk=task.pk))
+def set_task_title(task_id: str | UUID, team_id: int, title: str) -> bool:
+ """Set a task's title, team-scoped. For automated relabels — e.g. backfilling a Signals research
+ task with ``"Research: <report title>"`` once research produces the title. Leaves
+ ``title_manually_set`` untouched (this isn't a user edit) and clamps to the column length. Returns
+ whether a row was updated.
+ """
+ return bool(Task.objects.filter(id=task_id, team_id=team_id).update(title=title[:255]))
+
+
def update_task(
task_id: str | UUID, team_id: int, user_id: int | None, *, validated_data: dict
) -> contracts.TaskDetailDTO | None:
diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.py
index 5d4f296664c4..e7d34a4d01d2 100644
--- a/products/tasks/backend/presentation/serializers.py
+++ b/products/tasks/backend/presentation/serializers.py
@@ -922,9 +922,15 @@ class TaskListQuerySerializer(serializers.Serializer):
choices=[choice.value for choice in tasks_facade.TaskRunStatus],
help_text="Filter tasks by the status of their most recent run.",
)
- internal = serializers.BooleanField(
+ internal = serializers.ChoiceField(
required=False,
- help_text="When true, list internal tasks instead of user-facing ones. Honored in debug environments or for staff users; ignored for non-staff users in production. Defaults to excluding internal tasks.",
+ choices=["true", "false", "all"],
+ help_text=(
+ "Filter by the internal flag, which controls whether a task is shown by default, not whether "
+ "it is accessible. Defaults to excluding internal tasks. Use 'all' to include both internal "
+ "and user-facing tasks (available to any team member; access stays governed by task "
+ "visibility). 'true' lists only internal tasks and is a staff/debug view."
+ ),
)
archived = serializers.ChoiceField(
required=False,
diff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.py
index 3d1c9f717b7b..2317ebc4b8d8 100644
--- a/products/tasks/backend/tests/test_api.py
+++ b/products/tasks/backend/tests/test_api.py
@@ -2991,6 +2991,18 @@ class TestTaskInternalFilterAPI(BaseTaskAPITest):
self.assertIn(str(self.external_task.id), task_ids)
self.assertNotIn(str(self.internal_task.id), task_ids)
+ def test_list_internal_all_includes_both_for_non_staff(self):
+ # `internal=all` surfaces internal tasks to any team member without a staff/DEBUG requirement —
+ # the internal flag is a default-visibility toggle, not an access gate (task visibility is).
+ self.assertFalse(self.user.is_staff)
+ with self.settings(DEBUG=False):
+ response = self.client.get("/api/projects/@current/tasks/?internal=all")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+
+ task_ids = [t["id"] for t in response.json()["results"]]
+ self.assertIn(str(self.external_task.id), task_ids)
+ self.assertIn(str(self.internal_task.id), task_ids)
+
def test_internal_field_in_response(self):
response = self.client.get(f"/api/projects/@current/tasks/{self.external_task.id}/")
self.assertEqual(response.status_code, status.HTTP_200_OK)
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index 549c6befa492..f96f94a6e099 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -2084,9 +2084,14 @@ export type TasksListParams = {
*/
created_by?: number
/**
- * When true, list internal tasks instead of user-facing ones. Honored in debug environments or for staff users; ignored for non-staff users in production. Defaults to excluding internal tasks.
+ * Filter by the internal flag, which controls whether a task is shown by default, not whether it is accessible. Defaults to excluding internal tasks. Use 'all' to include both internal and user-facing tasks (available to any team member; access stays governed by task visibility). 'true' lists only internal tasks and is a staff/debug view.
+ *
+ * * `true` - true
+ * * `false` - false
+ * * `all` - all
+ * @minLength 1
*/
- internal?: boolean
+ internal?: TasksListInternal
/**
* Number of results to return per page.
* @minimum 1
@@ -2144,6 +2149,14 @@ export const TasksListArchived = {
All: 'all',
} as const
+export type TasksListInternal = (typeof TasksListInternal)[keyof typeof TasksListInternal]
+
+export const TasksListInternal = {
+ True: 'true',
+ False: 'false',
+ All: 'all',
+} as const
+
export type TasksListStatus = (typeof TasksListStatus)[keyof typeof TasksListStatus]
export const TasksListStatus = {
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 00b95c71fa7c..2b66f1a36cdc 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -66427,9 +66427,14 @@ export namespace Schemas {
*/
created_by?: number;
/**
- * When true, list internal tasks instead of user-facing ones. Honored in debug environments or for staff users; ignored for non-staff users in production. Defaults to excluding internal tasks.
+ * Filter by the internal flag, which controls whether a task is shown by default, not whether it is accessible. Defaults to excluding internal tasks. Use 'all' to include both internal and user-facing tasks (available to any team member; access stays governed by task visibility). 'true' lists only internal tasks and is a staff/debug view.
+ *
+ * * `true` - true
+ * * `false` - false
+ * * `all` - all
+ * @minLength 1
*/
- internal?: boolean;
+ internal?: TasksListInternal;
/**
* Number of results to return per page.
* @minimum 1
@@ -66488,6 +66493,15 @@ export namespace Schemas {
All: 'all',
} as const;
+ export type TasksListInternal = typeof TasksListInternal[keyof typeof TasksListInternal];
+
+
+ export const TasksListInternal = {
+ True: 'true',
+ False: 'false',
+ All: 'all',
+ } as const;
+
export type TasksListStatus = typeof TasksListStatus[keyof typeof TasksListStatus];
diff --git a/services/mcp/src/generated/tasks/api.ts b/services/mcp/src/generated/tasks/api.ts
index d955c5921dfb..8499eef36c19 100644
--- a/services/mcp/src/generated/tasks/api.ts
+++ b/services/mcp/src/generated/tasks/api.ts
@@ -35,10 +35,10 @@ export const TasksListQueryParams = /* @__PURE__ */ zod.object({
),
created_by: zod.number().optional().describe('Filter by creator user ID'),
internal: zod
- .boolean()
+ .enum(['true', 'false', 'all'])
.optional()
.describe(
- 'When true, list internal tasks instead of user-facing ones. Honored in debug environments or for staff users; ignored for non-staff users in production. Defaults to excluding internal tasks.'
+ "Filter by the internal flag, which controls whether a task is shown by default, not whether it is accessible. Defaults to excluding internal tasks. Use 'all' to include both internal and user-facing tasks (available to any team member; access stays governed by task visibility). 'true' lists only internal tasks and is a staff/debug view.\n\n* `true` - true\n* `false` - false\n* `all` - all"
),
limit: zod
.number()
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
index d828ef1f9eb2..1ab125f00408 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
@@ -11,8 +11,9 @@
"type": "number"
},
"internal": {
- "description": "When true, list internal tasks instead of user-facing ones. Honored in debug environments or for staff users; ignored for non-staff users in production. Defaults to excluding internal tasks.",
- "type": "boolean"
+ "description": "Filter by the internal flag, which controls whether a task is shown by default, not whether it is accessible. Defaults to excluding internal tasks. Use 'all' to include both internal and user-facing tasks (available to any team member; access stays governed by task visibility). 'true' lists only internal tasks and is a staff/debug view.\n\n* `true` - true\n* `false` - false\n* `all` - all",
+ "enum": ["true", "false", "all"],
+ "type": "string"
},
"limit": {
"default": 50,