: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
fix(tasks): open a new session page from the new chat button (#110347)
Peter Kirkham1ee2ba405406
diff --git a/frontend/src/layout/today/TodaySpaceActions.tsx b/frontend/src/layout/today/TodaySpaceActions.tsxindex eb25cb5cd974..be98e43cbe9f 100644--- a/frontend/src/layout/today/TodaySpaceActions.tsx+++ b/frontend/src/layout/today/TodaySpaceActions.tsx@@ -16,7 +16,7 @@ import { urls } from 'scenes/urls'import { ChannelDTOApi } from 'products/tasks/frontend/generated/api.schemas'import { TodayMenuParts } from './todayMenuParts'-import { spaceNewSessionUrl, todaySpacesLogic } from './todaySpacesLogic'+import { todaySpacesLogic } from './todaySpacesLogic'interface TodaySpaceActionsProps {parts: TodayMenuParts@@ -42,7 +42,7 @@ export function TodaySpaceActions({return (<>- <Item to={spaceNewSessionUrl(space.id)} dataAttr={attr('new-session')}>+ <Item to={urls.taskSpaceNewSession(space.id)} dataAttr={attr('new-session')}><IconPlus />New session</Item>diff --git a/frontend/src/layout/today/TodaySpacesSidebar.tsx b/frontend/src/layout/today/TodaySpacesSidebar.tsxindex 2f4df95edd75..eb268a24d277 100644--- a/frontend/src/layout/today/TodaySpacesSidebar.tsx+++ b/frontend/src/layout/today/TodaySpacesSidebar.tsx@@ -163,11 +163,11 @@ export function TodaySpacesSidebar(): JSX.Element {variant="primary"size="lg"className="w-full"- render={<LinkPrimitive to={urls.ai()} />}+ render={<LinkPrimitive to={urls.taskNewSession()} />}data-attr="today-spaces-new-chat"><IconPlus />- New chat+ New session</Button><div className="mt-6 flex min-h-0 flex-1 flex-col overflow-hidden px-1" ref={layout.measureRefs.area}>{hasPinned && (@@ -220,7 +220,7 @@ export function TodaySpacesSidebar(): JSX.Element {loadError('Recent sessions didn’t load.', loadRecentTasks, 'today-recent-retry')) : recentState === 'empty' ? (<Text size="xs" variant="muted" className="px-2 py-1">- Sessions and chats you open show up here. Start one with New chat.+ Sessions and chats you open show up here. Start one with New session.</Text>) : recentState === 'no-matches' ? (notice(diff --git a/frontend/src/layout/today/todaySpacesLogic.ts b/frontend/src/layout/today/todaySpacesLogic.tsindex 55ae7cb80772..a96a5df72523 100644--- a/frontend/src/layout/today/todaySpacesLogic.ts+++ b/frontend/src/layout/today/todaySpacesLogic.ts@@ -1,10 +1,11 @@import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'-import { combineUrl, router } from 'kea-router'+import { router } from 'kea-router'import type { LocationChangedPayload } from 'kea-router/lib/types'import { toast } from '@posthog/quill'+import { removeProjectIdIfPresent } from 'lib/utils/kea-router'import { writeToClipboard } from 'lib/utils/writeToClipboard'import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'import { teamLogic } from 'scenes/teamLogic'@@ -79,11 +80,10 @@ const SPACE_PRESENCE_POLL_INTERVAL_MS = 90_000export type TodayWorkSectionId = 'pinned' | 'recent' | 'spaces'-/** The space page reads this search param once and focuses its new-session composer. */-export const SPACE_COMPOSE_PARAM = 'compose'--export function spaceNewSessionUrl(spaceId: string): string {- return combineUrl(urls.taskSpace(spaceId), { [SPACE_COMPOSE_PARAM]: 1 }).url+/** The space a path is in, like PostHog Desktop's scoped space. `/spaces/new` is in no space. */+export function spaceIdForPath(pathname: string): string | null {+ const match = removeProjectIdIfPresent(pathname).match(/^\/spaces\/([^/]+)/)+ return match && match[1] !== 'new' ? match[1] : null}/** The personal space first, then the team's general space, then starred spaces, then the rest by name. */@@ -133,6 +133,7 @@ export interface todaySpacesLogicValues {user: UserType | null // userLogicallRecentItems: TodayWorkItem[]collapsedSections: TodayWorkSectionId[]+ lastSpaceId: string | nullpendingSpaceIds: string[]pinnedItems: TodayWorkItem[]pinnedTasks: TaskListItemApi[]@@ -325,6 +326,9 @@ export interface todaySpacesLogicActions {setSectionHeights: (heights: Partial<Record<TodayWorkSectionId, number>>) => {heights: Partial<Record<TodayWorkSectionId, number>>}+ spaceVisited: (spaceId: string) => {+ spaceId: string+ }starFailed: (spaceId: string) => {spaceId: string}@@ -408,6 +412,7 @@ export const todaySpacesLogic = kea<todaySpacesLogicType>([toggleSection: (sectionId: TodayWorkSectionId) => ({ sectionId }),setSectionHeights: (heights: Partial<Record<TodayWorkSectionId, number>>) => ({ heights }),resetSectionPair: (upper: TodayWorkSectionId, lower: TodayWorkSectionId) => ({ upper, lower }),+ spaceVisited: (spaceId: string) => ({ spaceId }),setRecentQuery: (query: string) => ({ query }),setRecentSearchOpen: (open: boolean) => ({ open }),setRecentFilters: (filters: TodayRecentFilters) => ({ filters }),@@ -529,6 +534,8 @@ export const todaySpacesLogic = kea<todaySpacesLogicType>([},},],+ // A generic New session files here, like PostHog Desktop's scoped space. A stale id falls back to personal.+ lastSpaceId: [null as string | null, { persist: true }, { spaceVisited: (_, { spaceId }) => spaceId }],recentQuery: ['', { setRecentQuery: (_, { query }) => query, clearRecentSearchAndFilters: () => '' }],recentSearchOpen: [false,@@ -709,7 +716,13 @@ export const todaySpacesLogic = kea<todaySpacesLogicType>([}}return {- locationChanged: markOpenSessionRead,+ locationChanged: ({ pathname }) => {+ const spaceId = spaceIdForPath(pathname)+ if (spaceId) {+ actions.spaceVisited(spaceId)+ }+ markOpenSessionRead()+ },loadTaskActivitySuccess: markOpenSessionRead,loadRecentTasks: () => actions.loadTaskActivity(),markSessionRead: async ({ marker, activityIds }) => {@@ -758,6 +771,10 @@ export const todaySpacesLogic = kea<todaySpacesLogicType>([},})),afterMount(({ actions, cache }) => {+ const spaceId = spaceIdForPath(router.values.location.pathname)+ if (spaceId) {+ actions.spaceVisited(spaceId)+ }actions.loadSpaces()actions.loadPinnedTasks()actions.loadRecentTasks()diff --git a/frontend/src/productScenes.tsx b/frontend/src/productScenes.tsxindex 598b8ff41c8b..51fc0bbca85b 100644--- a/frontend/src/productScenes.tsx+++ b/frontend/src/productScenes.tsx@@ -174,6 +174,7 @@ export const productScenes: Record<string, () => Promise<any>> = {Subscription: () => import('../../products/subscriptions/frontend/scenes/SubscriptionScene'),SlackTaskContext: () => import('../../products/tasks/frontend/SlackTaskContextScene'),TaskSpaces: () => import('../../products/tasks/frontend/spaces/SpacesScene'),+ TaskNewSession: () => import('../../products/tasks/frontend/spaces/NewSessionScene'),TaskSpace: () => import('../../products/tasks/frontend/spaces/SpaceScene'),Tracing: () => import('../../products/tracing/frontend/TracingScene'),TracingOperation: () => import('../../products/tracing/frontend/TracingOperationScene'),diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex 343b487e4c25..b4f907fb7aae 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -284,8 +284,10 @@ export const productRoutes: Record<string, [string, string]> = {'/subscriptions/:subscriptionId': ['Subscription', 'subscription'],'/slack-task-context': ['SlackTaskContext', 'slackTaskContext'],'/spaces': ['TaskSpaces', 'taskSpaces'],+ '/spaces/new': ['TaskNewSession', 'taskNewSession'],'/spaces/:id': ['TaskSpace', 'taskSpace'],'/spaces/:id/canvases': ['TaskSpace', 'taskSpaceCanvases'],+ '/spaces/:id/new': ['TaskNewSession', 'taskSpaceNewSession'],'/spaces/:id/settings': ['TaskSpace', 'taskSpaceSettings'],'/tracing': ['Tracing', 'tracing'],'/tracing/operation': ['TracingOperation', 'tracingOperation'],@@ -1106,6 +1108,7 @@ export const productConfiguration: Record<string, any> = {},SlackTaskContext: { name: 'Slack task context', projectBased: true },TaskSpaces: { name: 'Spaces', projectBased: true },+ TaskNewSession: { name: 'New session', projectBased: true },TaskSpace: { name: 'Space', projectBased: true },Toolbar: {name: 'Toolbar',@@ -1756,8 +1759,10 @@ export const productUrls = {`/surveys/guided/${id}${template ? `?template=${encodeURIComponent(template)}` : ''}`,slackTaskContext: (): string => '/slack-task-context',taskSpaces: (): string => '/spaces',+ taskNewSession: (): string => '/spaces/new',taskSpace: (id: string): string => `/spaces/${id}`,taskSpaceCanvases: (id: string): string => `/spaces/${id}/canvases`,+ taskSpaceNewSession: (id: string): string => `/spaces/${id}/new`,taskSpaceSettings: (id: string): string => `/spaces/${id}/settings`,toolbarLaunch: (): string => '/toolbar',tracing: (): string => '/tracing',diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsxindex e7d45a75d1de..97e99946b4e6 100644--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx@@ -778,6 +778,11 @@ export const SpacePage: Story = {parameters: { pageUrl: urls.taskSpace('space-checkout') },}+// New session opens this page. It files into the personal space until the user picks another one.+export const NewSessionPage: Story = {+ parameters: { pageUrl: urls.taskNewSession() },+}+// A Cmd-click pick can't be held in a static story, so the play step selects a pinned and a recent row through the logic.export const SpacesPaneWithSelectedSessions: Story = {parameters: { pageUrl: urls.taskSpace('space-checkout') },diff --git a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsxindex e5517a3d5d2b..edc2947b00c6 100644--- a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx@@ -86,11 +86,11 @@ export function TodayHomeSidebar(): JSX.Element {variant="primary"size="lg"className="w-full"- render={<LinkPrimitive to={urls.ai()} />}+ render={<LinkPrimitive to={urls.taskNewSession()} />}data-attr="today-new-chat"><IconPlus />- New chat+ New session</Button><div className="TodayPane__scroll"><div className="TodayPane__heading Today__label">Today</div>diff --git a/frontend/src/scenes/sceneTypes.ts b/frontend/src/scenes/sceneTypes.tsindex 1c27205c11d0..5f1fcfb2f34e 100644--- a/frontend/src/scenes/sceneTypes.ts+++ b/frontend/src/scenes/sceneTypes.ts@@ -260,6 +260,7 @@ export enum Scene {NewAction = 'NewAction',TaskTracker = 'TaskTracker',SlackTaskContext = 'SlackTaskContext',+ TaskNewSession = 'TaskNewSession',TaskSpace = 'TaskSpace',TaskSpaces = 'TaskSpaces',OrganizationDeactivated = 'OrganizationDeactivated',diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 31935246a363..a28514972bc2 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -5051,6 +5051,9 @@ importers:kea-subscriptions:specifier: 'catalog:'version: 3.0.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))+ posthog-js:+ specifier: 'catalog:'+ version: 1.435.5(@types/[email protected])([email protected])react:specifier: 18.3.1version: 18.3.1diff --git a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsxindex 651beda01c0c..6f288ae949b3 100644--- a/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx+++ b/products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx@@ -74,7 +74,8 @@ export interface ComposerModelEffortPickersProps {*/lockedRuntimeAdapter?: string | null/** The selection shown is the resolved default (user/project preference), not an explicit pick for- * this run — the model trigger renders a "Default ·" prefix so that's visible at a glance. */+ * this run — the lemon model trigger renders a "Default ·" prefix so that's visible at a glance. The quill+ * trigger shows only the model, like PostHog Desktop. */isDefaultSelection?: boolean/** Clears the explicit pick so the run falls back to the resolved default. Omit on a surface with no* configured default and the reset row falls back to the ladder's balanced notch. */@@ -99,9 +100,12 @@ interface PickerSectionProps {}/** One `label … current ›` row of the cascade, opening a radio list. */-const PICKER_CHROME: Record<ThreadSkin, { triggerVariant: 'outline' | 'default'; icons: boolean }> = {- lemon: { triggerVariant: 'outline', icons: true },- quill: { triggerVariant: 'default', icons: false },+const PICKER_CHROME: Record<+ ThreadSkin,+ { triggerVariant: 'outline' | 'default'; icons: boolean; defaultPrefix: boolean }+> = {+ lemon: { triggerVariant: 'outline', icons: true, defaultPrefix: true },+ quill: { triggerVariant: 'default', icons: false, defaultPrefix: false },}function PickerSection({ title, current, value, onValueChange, children, footer }: PickerSectionProps): JSX.Element {@@ -242,7 +246,7 @@ export function ComposerModelEffortPickers({<DropdownMenuTriggerrender={<Button variant={chrome.triggerVariant} size="sm">- {isDefaultSelection ? `Default · ${modelLabel}` : modelLabel}+ {isDefaultSelection && chrome.defaultPrefix ? `Default · ${modelLabel}` : modelLabel}{effortOptions.length > 0 && (<span className="text-muted">{getEffortLabel(selectedEffort)}</span>)}diff --git a/products/tasks/frontend/spaces/NewSessionScene.tsx b/products/tasks/frontend/spaces/NewSessionScene.tsxnew file mode 100644index 000000000000..1e9aa51ef418--- /dev/null+++ b/products/tasks/frontend/spaces/NewSessionScene.tsx@@ -0,0 +1,107 @@+import { useActions, useValues } from 'kea'++import {+ Button,+ Empty,+ EmptyContent,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ Heading,+ Skeleton,+} from '@posthog/quill'++import { NotFound } from 'lib/components/NotFound'+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'+import { SceneExport } from 'scenes/sceneTypes'++import { SceneContent } from '~/layout/scenes/components/SceneContent'++import { newSessionSceneLogic } from './newSessionSceneLogic'+import { NewSessionSpaceSelect } from './NewSessionSpaceSelect'+import { SpaceTaskComposer } from './SpaceTaskComposer'+import { SpaceTaskComposerSkeleton } from './SpaceTaskComposerSkeleton'++export const scene: SceneExport = {+ component: NewSessionScene,+ logic: newSessionSceneLogic,+}++export function NewSessionScene(): JSX.Element {+ const enabled = useFeatureFlag('TODAY_RAIL_NAV')+ const { space, spaceGroups, sortedSpaces, spacesLoading, spacesUnavailable, composerRepositoryConfig } =+ useValues(newSessionSceneLogic)+ const { pickSpace, sessionStarted, loadSpaces } = useActions(newSessionSceneLogic)++ if (!enabled) {+ return <NotFound object="page" />+ }++ const resolving = !space && spacesLoading+ const failed = !space && spacesUnavailable++ return (+ <SceneContent className="flex-1">+ {/* Like PostHog Desktop, the middle of the block sits 34% down the pane: the shrink weights take half the block's height from each spacer. */}+ <div className="flex flex-1 flex-col" data-quill>+ <div aria-hidden className="min-h-4 shrink-[66] basis-[34%]" />+ <div className="mx-auto flex w-full max-w-150 shrink-0 flex-col">+ {failed ? (+ <Empty className="py-12">+ <EmptyHeader>+ <EmptyTitle>Your spaces didn’t load</EmptyTitle>+ <EmptyDescription>Check your connection and try again.</EmptyDescription>+ </EmptyHeader>+ <EmptyContent>+ <Button+ variant="outline"+ loading={spacesLoading}+ onClick={() => loadSpaces()}+ data-attr="today-new-session-retry"+ >+ Try again+ </Button>+ </EmptyContent>+ </Empty>+ ) : (+ <>+ <Heading size="2xl" render={<h1 />} className="mb-5 flex flex-col">+ <span>Start a new session</span>+ <span className="flex min-w-0 flex-wrap items-baseline gap-x-2 text-muted-foreground">+ in+ {resolving ? (+ <Skeleton className="h-7 w-28 self-center" />+ ) : (+ <NewSessionSpaceSelect+ spaces={sortedSpaces}+ groups={spaceGroups}+ value={space}+ onChange={pickSpace}+ />+ )}+ <span>space</span>+ </span>+ </Heading>+ {resolving ? (+ <SpaceTaskComposerSkeleton />+ ) : (+ space && (+ // Each space gets its own composer, so it starts on that space's repository.+ <div data-attr="today-new-session-composer">+ <SpaceTaskComposer+ space={space}+ panelId={`new-session-${space.id}`}+ repositoryConfig={composerRepositoryConfig}+ onTaskCreated={sessionStarted}+ />+ </div>+ )+ )}+ </>+ )}+ </div>+ <div aria-hidden className="shrink-[34] basis-[66%]" />+ </div>+ </SceneContent>+ )+}diff --git a/products/tasks/frontend/spaces/NewSessionSpaceSelect.tsx b/products/tasks/frontend/spaces/NewSessionSpaceSelect.tsxnew file mode 100644index 000000000000..337d233d505d--- /dev/null+++ b/products/tasks/frontend/spaces/NewSessionSpaceSelect.tsx@@ -0,0 +1,93 @@+import { useMemo, useRef } from 'react'++import { IconChevronDown } from '@posthog/icons'+import {+ Combobox,+ ComboboxCollection,+ ComboboxContent,+ ComboboxEmpty,+ ComboboxGroup,+ ComboboxInput,+ ComboboxItem,+ ComboboxLabel,+ ComboboxList,+ ComboboxSeparator,+ ComboboxTrigger,+} from '@posthog/quill'++import { TodaySpaceGlyph } from '~/layout/today/TodaySpaceGlyph'+import { isLockedSpace, spaceLabel } from '~/layout/today/todaySpacesLogic'++import { ChannelDTOApi } from '../generated/api.schemas'+import { NewSessionSpaceGroup } from './newSessionSceneLogic'++export interface NewSessionSpaceSelectProps {+ spaces: ChannelDTOApi[]+ groups: NewSessionSpaceGroup[]+ value: ChannelDTOApi | null+ onChange: (spaceId: string) => void+}++/** The space a new session files into, drawn inside the page heading like PostHog Desktop. */+export function NewSessionSpaceSelect({ spaces, groups, value, onChange }: NewSessionSpaceSelectProps): JSX.Element {+ const anchorRef = useRef<HTMLButtonElement>(null)+ const byId = useMemo(() => new Map(spaces.map((space) => [space.id, space])), [spaces])++ return (+ <Combobox<string>+ items={groups}+ value={value?.id ?? null}+ onValueChange={(spaceId: string | null) => {+ if (spaceId && spaceId !== value?.id) {+ onChange(spaceId)+ }+ }}+ itemToStringLabel={(spaceId: string) => {+ const space = byId.get(spaceId)+ return space ? spaceLabel(space) : ''+ }}+ >+ <ComboboxTrigger+ render={+ <button+ ref={anchorRef}+ type="button"+ aria-label="Space"+ title={value ? spaceLabel(value) : undefined}+ className="inline-flex max-w-full items-center gap-1.5 border-b-2 border-dashed border-border text-foreground transition-colors hover:border-foreground"+ data-attr="today-new-session-space"+ >+ <span className="min-w-0 truncate">{value ? spaceLabel(value) : 'choose a space'}</span>+ <IconChevronDown className="size-5 shrink-0" />+ </button>+ }+ />+ <ComboboxContent anchor={anchorRef} side="bottom" sideOffset={6} className="min-w-56">+ <ComboboxInput placeholder="Search spaces" showTrigger={false} />+ <ComboboxEmpty>No spaces match that name.</ComboboxEmpty>+ <ComboboxList>+ {(group: NewSessionSpaceGroup, index: number) => (+ <ComboboxGroup key={group.value} items={group.items}>+ {index > 0 && <ComboboxSeparator />}+ <ComboboxLabel>{group.value}</ComboboxLabel>+ <ComboboxCollection>+ {(spaceId: string) => {+ const space = byId.get(spaceId)+ return space ? (+ <ComboboxItem key={spaceId} value={spaceId} title={spaceLabel(space)}>+ <TodaySpaceGlyph+ locked={isLockedSpace(space)}+ className="text-muted-foreground"+ />+ <span className="min-w-0 truncate">{spaceLabel(space)}</span>+ </ComboboxItem>+ ) : null+ }}+ </ComboboxCollection>+ </ComboboxGroup>+ )}+ </ComboboxList>+ </ComboboxContent>+ </Combobox>+ )+}diff --git a/products/tasks/frontend/spaces/SpaceScene.tsx b/products/tasks/frontend/spaces/SpaceScene.tsxindex 696b03cc394b..cd2edbc801ef 100644--- a/products/tasks/frontend/spaces/SpaceScene.tsx+++ b/products/tasks/frontend/spaces/SpaceScene.tsx@@ -9,7 +9,6 @@ import {EmptyDescription,EmptyHeader,EmptyTitle,- Skeleton,Tabs,TabsContent,TabsList,@@ -29,27 +28,11 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { spaceLabel } from '~/layout/today/todaySpacesLogic'-import { EmbeddedTaskComposer } from 'products/posthog_ai/frontend/api/runner'-import { SpaceCanvases } from './SpaceCanvases'import { SpaceFeed } from './SpaceFeed'import { SpaceSceneLogicProps, SpaceTab, spaceComposerPanelId, spaceSceneLogic } from './spaceSceneLogic'import { SpaceSettings } from './SpaceSettings'--const SPACE_COMPOSER_OVERRIDE = {- placeholder: 'What do you want to ship?',- hideSuggestions: true,- hideRecentTasks: true,- hideOnboardingReplay: true,-}--// The repository picker and the input frame at their loaded sizes, so the feed does not jump when the chunk lands.-const COMPOSER_SKELETON = (- <div className="flex flex-col gap-2">- <Skeleton className="h-8 w-36" />- <Skeleton className="h-36 w-full rounded-lg" />- </div>-)+import { SpaceTaskComposer } from './SpaceTaskComposer'export const scene: SceneExport<SpaceSceneLogicProps> = {component: SpaceScene,@@ -165,16 +148,12 @@ export function SpaceScene({ id }: SpaceSceneLogicProps): JSX.Element {{/* Mounted once the space loads, so the composer starts on the space's repository. */}{space && (<div className="mb-1 border-b border-border pb-4" data-attr="today-space-new-task">- <EmbeddedTaskComposer- key={space.id}+ <SpaceTaskComposer+ space={space}panelId={spaceComposerPanelId(id)}- channelId={space.id}- initialRepositoryConfig={composerRepositoryConfig}- composerOverride={SPACE_COMPOSER_OVERRIDE}+ repositoryConfig={composerRepositoryConfig}onTaskCreated={sessionStarted}focusRequest={composerFocusRequest}- autoFocus={false}- fallback={COMPOSER_SKELETON}/></div>)}diff --git a/products/tasks/frontend/spaces/SpaceTaskComposer.tsx b/products/tasks/frontend/spaces/SpaceTaskComposer.tsxnew file mode 100644index 000000000000..1a8db0b01df2--- /dev/null+++ b/products/tasks/frontend/spaces/SpaceTaskComposer.tsx@@ -0,0 +1,43 @@+import { EmbeddedTaskComposer } from 'products/posthog_ai/frontend/api/runner'++import { ChannelDTOApi } from '../generated/api.schemas'+import { SpaceComposerRepositoryConfig } from './spaceSceneLogic'+import { SpaceTaskComposerSkeleton } from './SpaceTaskComposerSkeleton'++const SPACE_COMPOSER_OVERRIDE = {+ placeholder: 'What do you want to ship?',+ hideSuggestions: true,+ hideRecentTasks: true,+ hideOnboardingReplay: true,+}++export interface SpaceTaskComposerProps {+ space: ChannelDTOApi+ panelId: string+ repositoryConfig: SpaceComposerRepositoryConfig+ onTaskCreated: (sessionId: string) => void+ focusRequest?: number+}++/** The new-session composer that files into a space, on the space's activity tab and on the new session page. */+export function SpaceTaskComposer({+ space,+ panelId,+ repositoryConfig,+ onTaskCreated,+ focusRequest,+}: SpaceTaskComposerProps): JSX.Element {+ return (+ <EmbeddedTaskComposer+ key={space.id}+ panelId={panelId}+ channelId={space.id}+ initialRepositoryConfig={repositoryConfig}+ composerOverride={SPACE_COMPOSER_OVERRIDE}+ onTaskCreated={onTaskCreated}+ focusRequest={focusRequest}+ autoFocus={false}+ fallback={<SpaceTaskComposerSkeleton />}+ />+ )+}diff --git a/products/tasks/frontend/spaces/SpaceTaskComposerSkeleton.tsx b/products/tasks/frontend/spaces/SpaceTaskComposerSkeleton.tsxnew file mode 100644index 000000000000..83644d7cec33--- /dev/null+++ b/products/tasks/frontend/spaces/SpaceTaskComposerSkeleton.tsx@@ -0,0 +1,20 @@+import { Skeleton } from '@posthog/quill'++/** The repository picker, the input and the control row at their loaded sizes, so the page does not jump when the composer chunk lands. */+export function SpaceTaskComposerSkeleton(): JSX.Element {+ return (+ <div aria-hidden className="flex flex-col gap-2">+ <Skeleton className="h-7 w-36" />+ <div className="flex flex-col gap-1">+ <div className="rounded-sm border border-border">+ <Skeleton className="h-16 w-full" />+ </div>+ <div className="flex h-6 items-center gap-1 px-1">+ <Skeleton className="size-6" />+ <Skeleton className="h-4 w-24" />+ <Skeleton className="h-4 w-32" />+ </div>+ </div>+ </div>+ )+}diff --git a/products/tasks/frontend/spaces/newSessionSceneLogic.test.ts b/products/tasks/frontend/spaces/newSessionSceneLogic.test.tsnew file mode 100644index 000000000000..d2b229200832--- /dev/null+++ b/products/tasks/frontend/spaces/newSessionSceneLogic.test.ts@@ -0,0 +1,20 @@+import { ChannelDTOApi } from '../generated/api.schemas'+import { NewSessionSpaceSource, newSessionSpace } from './newSessionSceneLogic'++const space = (id: string, systemRole: ChannelDTOApi['system_role'] = null): ChannelDTOApi =>+ ({ id, name: id, system_role: systemRole }) as ChannelDTOApi++const SPACES = [space('general', 'general'), space('me', 'personal'), space('checkout')]++describe('newSessionSpace', () => {+ it.each<[string, string | null, string | null, string, NewSessionSpaceSource]>([+ ['a space’s own New session wins over the last space', 'checkout', 'general', 'checkout', 'route'],+ ['a generic New session uses the last space', null, 'checkout', 'checkout', 'last_used'],+ ['a generic New session with no last space uses personal', null, null, 'me', 'personal'],+ ['a deleted last space falls back to personal', null, 'gone', 'me', 'personal'],+ ['a deleted route space falls back to the last space', 'gone', 'checkout', 'checkout', 'last_used'],+ ])('%s', (_, routeSpaceId, lastSpaceId, expectedId, expectedSource) => {+ const { space: chosen, source } = newSessionSpace(SPACES, routeSpaceId, lastSpaceId)+ expect({ id: chosen?.id, source }).toEqual({ id: expectedId, source: expectedSource })+ })+})diff --git a/products/tasks/frontend/spaces/newSessionSceneLogic.ts b/products/tasks/frontend/spaces/newSessionSceneLogic.tsnew file mode 100644index 000000000000..528404c41c7a--- /dev/null+++ b/products/tasks/frontend/spaces/newSessionSceneLogic.ts@@ -0,0 +1,166 @@+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import { router, urlToAction } from 'kea-router'+import posthog from 'posthog-js'++import { Scene } from 'scenes/sceneTypes'+import { urls } from 'scenes/urls'++import { starredSpaces, todaySpacesLogic } from '~/layout/today/todaySpacesLogic'+import { Breadcrumb } from '~/types'++import { ChannelDTOApi } from '../generated/api.schemas'+import { SpaceComposerRepositoryConfig, spaceComposerRepositoryConfig } from './spaceSceneLogic'++/** The `{ value, items }` shape is what the combobox reads as a group. */+export interface NewSessionSpaceGroup {+ value: string+ items: string[]+}++/** `route` is a space's own New session, or a pick in the heading. `last_used` and `personal` are the generic default. */+export type NewSessionSpaceSource = 'route' | 'last_used' | 'personal' | 'first'++export interface NewSessionSpaceChoice {+ space: ChannelDTOApi | null+ source: NewSessionSpaceSource | null+}++/** Like PostHog Desktop: the space in the URL, else the last space the person was in, else their personal space. */+export function newSessionSpace(+ spaces: ChannelDTOApi[],+ routeSpaceId: string | null,+ lastSpaceId: string | null+): NewSessionSpaceChoice {+ const candidates: [NewSessionSpaceSource, ChannelDTOApi | undefined][] = [+ ['route', spaces.find((space) => space.id === routeSpaceId)],+ ['last_used', spaces.find((space) => space.id === lastSpaceId)],+ ['personal', spaces.find((space) => space.system_role === 'personal')],+ ['first', spaces[0]],+ ]+ const [source, space] = candidates.find(([, candidate]) => candidate) ?? [null, null]+ return { space: space ?? null, source }+}++/** The personal and starred spaces first, then the rest, under the same headings as the Spaces page. */+export function newSessionSpaceGroups(spaces: ChannelDTOApi[]): NewSessionSpaceGroup[] {+ const starredIds = starredSpaces(spaces).map((space) => space.id)+ const restIds = spaces.filter((space) => !starredIds.includes(space.id)).map((space) => space.id)+ return [+ { value: 'Starred', items: starredIds },+ { value: 'Spaces', items: restIds },+ ].filter((group) => group.items.length > 0)+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface newSessionSceneLogicValues {+ lastSpaceId: string | null // todaySpacesLogic+ sortedSpaces: ChannelDTOApi[] // todaySpacesLogic+ spacesLoading: boolean // todaySpacesLogic+ spacesUnavailable: boolean // todaySpacesLogic+ breadcrumbs: Breadcrumb[]+ composerRepositoryConfig: SpaceComposerRepositoryConfig+ routeSpaceId: string | null+ space: ChannelDTOApi | null+ spaceChoice: NewSessionSpaceChoice+ spaceGroups: NewSessionSpaceGroup[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface newSessionSceneLogicActions {+ loadRecentTasks: () => any // todaySpacesLogic+ loadSpaces: () => any // todaySpacesLogic+ pickSpace: (spaceId: string) => {+ spaceId: string+ }+ sessionStarted: (sessionId: string) => {+ sessionId: string+ }+ setRouteSpaceId: (spaceId: string | null) => {+ spaceId: string | null+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface newSessionSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ spaceChoice: (+ sortedSpaces: ChannelDTOApi[],+ routeSpaceId: string | null,+ lastSpaceId: string | null+ ) => NewSessionSpaceChoice+ space: (spaceChoice: NewSessionSpaceChoice) => ChannelDTOApi | null+ spaceGroups: (sortedSpaces: ChannelDTOApi[]) => NewSessionSpaceGroup[]+ composerRepositoryConfig: (space: ChannelDTOApi | null) => SpaceComposerRepositoryConfig+ }+}++export type newSessionSceneLogicType = MakeLogicType<+ newSessionSceneLogicValues,+ newSessionSceneLogicActions,+ Record<string, any>,+ newSessionSceneLogicMeta+>++export const newSessionSceneLogic = kea<newSessionSceneLogicType>([+ path(['products', 'tasks', 'spaces', 'newSessionSceneLogic']),+ connect(() => ({+ values: [todaySpacesLogic, ['sortedSpaces', 'spacesLoading', 'spacesUnavailable', 'lastSpaceId']],+ actions: [todaySpacesLogic, ['loadSpaces', 'loadRecentTasks']],+ })),+ actions({+ pickSpace: (spaceId: string) => ({ spaceId }),+ setRouteSpaceId: (spaceId: string | null) => ({ spaceId }),+ sessionStarted: (sessionId: string) => ({ sessionId }),+ }),+ reducers({+ routeSpaceId: [null as string | null, { setRouteSpaceId: (_, { spaceId }) => spaceId }],+ }),+ selectors({+ spaceChoice: [+ (s) => [s.sortedSpaces, s.routeSpaceId, s.lastSpaceId],+ (+ sortedSpaces: ChannelDTOApi[],+ routeSpaceId: string | null,+ lastSpaceId: string | null+ ): NewSessionSpaceChoice => newSessionSpace(sortedSpaces, routeSpaceId, lastSpaceId),+ ],+ space: [+ (s) => [s.spaceChoice],+ (spaceChoice: NewSessionSpaceChoice): ChannelDTOApi | null => spaceChoice.space,+ ],+ spaceGroups: [+ (s) => [s.sortedSpaces],+ (sortedSpaces: ChannelDTOApi[]): NewSessionSpaceGroup[] => newSessionSpaceGroups(sortedSpaces),+ ],+ composerRepositoryConfig: [+ (s) => [s.space],+ (space: ChannelDTOApi | null): SpaceComposerRepositoryConfig => spaceComposerRepositoryConfig(space),+ ],+ breadcrumbs: [+ () => [],+ (): Breadcrumb[] => [+ { key: Scene.TaskSpaces, name: 'Spaces', path: urls.taskSpaces(), iconType: 'task' },+ { key: Scene.TaskNewSession, name: 'New session', path: urls.taskNewSession(), iconType: 'task' },+ ],+ ],+ }),+ listeners(({ actions, values }) => ({+ // Like PostHog Desktop, a pick moves to that space's own New session, so it becomes the last space too.+ pickSpace: ({ spaceId }) => {+ router.actions.push(urls.taskSpaceNewSession(spaceId))+ },+ sessionStarted: ({ sessionId }) => {+ // pinned: analytics event name and properties. Renaming them breaks dashboards.+ posthog.capture('today new session started', {+ space_role: values.space?.system_role ?? null,+ space_source: values.spaceChoice.source,+ })+ actions.loadRecentTasks()+ router.actions.push(urls.aiTask(sessionId))+ },+ })),+ urlToAction(({ actions }) => ({+ [urls.taskNewSession()]: () => actions.setRouteSpaceId(null),+ [urls.taskSpaceNewSession(':id')]: ({ id }) => actions.setRouteSpaceId(id ?? null),+ })),+])diff --git a/products/tasks/frontend/spaces/spaceSceneLogic.test.ts b/products/tasks/frontend/spaces/spaceSceneLogic.test.tsindex d21f2112bb21..b912f0b7bfea 100644--- a/products/tasks/frontend/spaces/spaceSceneLogic.test.ts+++ b/products/tasks/frontend/spaces/spaceSceneLogic.test.ts@@ -6,7 +6,7 @@ import { expectLogic } from 'kea-test-utils'import { urls } from 'scenes/urls'import { todaySessionMenuLogic } from '~/layout/today/todaySessionMenuLogic'-import { spaceNewSessionUrl, todaySpacesLogic } from '~/layout/today/todaySpacesLogic'+import { todaySpacesLogic } from '~/layout/today/todaySpacesLogic'import { useMocks } from '~/mocks/jest'import { initKeaTests } from '~/test/init'@@ -601,23 +601,6 @@ describe('spaceSceneLogic', () => {expect(writeText).toHaveBeenCalledWith('https://app.example.com/code/canvas/space-a/c-0')})- it('focuses the composer once when a new session is requested for this space', async () => {- const logic = spaceSceneLogic({ id: 'space-a' })- const other = spaceSceneLogic({ id: 'space-b' })- logic.mount()- other.mount()-- router.actions.push(spaceNewSessionUrl('space-a'))- await expectLogic(logic).toFinishAllListeners()- expect(logic.values.composerFocusRequest).toBe(1)- expect(router.values.searchParams).toEqual({})-- router.actions.push(urls.taskSpaceSettings('space-a'))- router.actions.push(urls.taskSpace('space-a'))- expect(logic.values.composerFocusRequest).toBe(1)- expect(other.values.composerFocusRequest).toBe(0)- })-it('fills this space’s composer with a suggestion without sending it', async () => {const logic = spaceSceneLogic({ id: 'space-a' })logic.mount()diff --git a/products/tasks/frontend/spaces/spaceSceneLogic.ts b/products/tasks/frontend/spaces/spaceSceneLogic.tsindex 4195afb00e78..30014cb12c10 100644--- a/products/tasks/frontend/spaces/spaceSceneLogic.ts+++ b/products/tasks/frontend/spaces/spaceSceneLogic.ts@@ -14,7 +14,7 @@ import { userLogic } from 'scenes/userLogic'import { recentSourceOptions } from '~/layout/today/todayRecentFilters'import { TodayRecentSort } from '~/layout/today/todayRecentOrder'import { todaySessionMenuLogic } from '~/layout/today/todaySessionMenuLogic'-import { SPACE_COMPOSE_PARAM, spaceLabel, todaySpacesLogic } from '~/layout/today/todaySpacesLogic'+import { spaceLabel, todaySpacesLogic } from '~/layout/today/todaySpacesLogic'import { TodayWorkItem, sessionItem } from '~/layout/today/todayWorkItems'import { Breadcrumb, TeamPublicType, TeamType, UserType } from '~/types'@@ -100,6 +100,13 @@ export function spaceComposerPanelId(spaceId: string): string {return `space-${spaceId}`}+/** A new session starts on the space's first repository. */+export function spaceComposerRepositoryConfig(space: ChannelDTOApi | null): SpaceComposerRepositoryConfig {+ return space?.repositories.length+ ? { integrationId: space.github_integration ?? undefined, repository: space.repositories[0] }+ : undefined+}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface spaceSceneLogicValues {filters: SpaceFeedFilters // spaceFeedViewLogic@@ -848,13 +855,9 @@ export const spaceSceneLogic = kea<spaceSceneLogicType>([},],],- // The new-session composer starts on the space's first repository.composerRepositoryConfig: [(s) => [s.space],- (space: ChannelDTOApi | null): SpaceComposerRepositoryConfig =>- space?.repositories.length- ? { integrationId: space.github_integration ?? undefined, repository: space.repositories[0] }- : undefined,+ (space: ChannelDTOApi | null): SpaceComposerRepositoryConfig => spaceComposerRepositoryConfig(space),],}),listeners(({ actions, props, values }) => ({@@ -1015,15 +1018,6 @@ export const spaceSceneLogic = kea<spaceSceneLogicType>([},})),urlToAction(({ actions, props }) => ({- [urls.taskSpace(':id')]: ({ id }, searchParams, hashParams) => {- if (id !== props.id || !searchParams[SPACE_COMPOSE_PARAM]) {- return- }- actions.focusComposer()- // Drop the param, so a reload or a back navigation does not focus the composer again.- const { [SPACE_COMPOSE_PARAM]: _compose, ...rest } = searchParams- router.actions.replace(urls.taskSpace(props.id), rest, hashParams)- },[urls.taskSpaceCanvases(':id')]: ({ id }) => {if (id === props.id) {actions.ensureCanvases()diff --git a/products/tasks/manifest.tsx b/products/tasks/manifest.tsxindex c6ef0c813a86..06ceaca3f3c5 100644--- a/products/tasks/manifest.tsx+++ b/products/tasks/manifest.tsx@@ -14,6 +14,11 @@ export const manifest: ProductManifest = {import: () => import('./frontend/spaces/SpacesScene'),projectBased: true,},+ TaskNewSession: {+ name: 'New session',+ import: () => import('./frontend/spaces/NewSessionScene'),+ projectBased: true,+ },TaskSpace: {name: 'Space',import: () => import('./frontend/spaces/SpaceScene'),@@ -23,16 +28,21 @@ export const manifest: ProductManifest = {routes: {'/slack-task-context': ['SlackTaskContext', 'slackTaskContext'],'/spaces': ['TaskSpaces', 'taskSpaces'],+ // Before `/spaces/:id`, so the router does not read `new` as a space id.+ '/spaces/new': ['TaskNewSession', 'taskNewSession'],'/spaces/:id': ['TaskSpace', 'taskSpace'],'/spaces/:id/canvases': ['TaskSpace', 'taskSpaceCanvases'],+ '/spaces/:id/new': ['TaskNewSession', 'taskSpaceNewSession'],'/spaces/:id/settings': ['TaskSpace', 'taskSpaceSettings'],},redirects: {},urls: {slackTaskContext: (): string => '/slack-task-context',taskSpaces: (): string => '/spaces',+ taskNewSession: (): string => '/spaces/new',taskSpace: (id: string): string => `/spaces/${id}`,taskSpaceCanvases: (id: string): string => `/spaces/${id}/canvases`,+ taskSpaceNewSession: (id: string): string => `/spaces/${id}/new`,taskSpaceSettings: (id: string): string => `/spaces/${id}/settings`,},fileSystemTypes: {},diff --git a/products/tasks/package.json b/products/tasks/package.jsonindex 4faf9f851e99..a369ae3ade43 100644--- a/products/tasks/package.json+++ b/products/tasks/package.json@@ -6,7 +6,8 @@"dependencies": {"@posthog/products-mcp-store": "workspace:*","@posthog/quill": "workspace:*",- "kea-disposables": "catalog:"+ "kea-disposables": "catalog:",+ "posthog-js": "catalog:"},"devDependencies": {"kea-test-utils": "catalog:",diff --git a/services/mcp/src/tools/links/app-url-manifest.json b/services/mcp/src/tools/links/app-url-manifest.jsonindex 1fa37516abdc..bd0d03d53e3d 100644--- a/services/mcp/src/tools/links/app-url-manifest.json+++ b/services/mcp/src/tools/links/app-url-manifest.json@@ -1684,6 +1684,11 @@"params": [],"scope": "project"},+ "taskNewSession": {+ "template": "/spaces/new",+ "params": [],+ "scope": "project"+ },"taskSpace": {"template": "/spaces/{id}","params": ["id"],@@ -1694,6 +1699,11 @@"params": ["id"],"scope": "project"},+ "taskSpaceNewSession": {+ "template": "/spaces/{id}/new",+ "params": ["id"],+ "scope": "project"+ },"taskSpaceSettings": {"template": "/spaces/{id}/settings","params": ["id"],diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.jsonindex 09ee7e7b3a0b..11975eca45fc 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json@@ -13,7 +13,7 @@"type": "object"},"url": {- "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/link/{id}\n/links\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/user_research\n/user_research/{id}\n/user_research/{topicId}/response/{responseId}\n/verify_email\n/views\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",+ "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/link/{id}\n/links\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/user_research\n/user_research/{id}\n/user_research/{topicId}/response/{responseId}\n/verify_email\n/views\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}","type": "string"}},