Skip to content

fix(tasks): open today report questions as a new session - #110940

Closed
VojtechBartos wants to merge 2 commits into
posthog/new-chat-new-sessionfrom
posthog/today-ask-new-session
Closed

VojtechBartos wants to merge 2 commits into
posthog/new-chat-new-sessionfrom
posthog/today-ask-new-session

Conversation

@VojtechBartos

@VojtechBartos VojtechBartos commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Problem

  • On a Today report page behind today-rail-nav, "Ask about this report" starts a session in the side panel.
  • #110347 made New session open a session on its own page, in a space. The report prompts did not follow it.

Changes

  • The report prompts now start the session in the default space and open the session page, not the side panel.
  • The default space follows the New session rules: the last space the person was in, else their personal space.
  • The session stays a report discussion task. It keeps its link to the report, the per-report task cap, and the safety instructions in its prompt.
  • The hint under the report composer now names the space: "Starts a new session in the space with this report attached."
  • The Today ask box is unchanged. It still goes to /ai?ask=…, which opens the run as soon as the question is sent.
  • Mechanical: inboxTaskKickoffLogic.discussReport takes an optional space target. The Inbox callers do not pass it, so the Inbox keeps the side panel.

The only visible change on the page is the hint text. The rest is where a submit goes, so there is no screenshot.

How did you test this code?

  • Ran the Jest files for inboxTaskKickoffLogic, newSessionSceneLogic and todayLogic, and the frontend type check.
  • Not checked: a real submit against a running stack, and a render of the report page in Storybook.

Test rationale: inboxTaskKickoffLogic.test.ts has one new case for the space target. It fails if the task loses its space, or if the session opens in the side panel. The nearest test covers the side panel path only.

Release status

  • No feature flag controls this change
  • This change is behind a feature flag and is not available to users
  • This change makes a previously flagged feature available to everyone

Automatic notifications

  • Publish to changelog?

Docs update

None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: PostHog Desktop (Claude Code), Claude Opus 5.5

  • Based on the branch of #110347.
  • Skills invoked: /writing-tests, /writing-code-comments, /writing-user-facing-copy, /writing-pr-descriptions.
  • An earlier version sent the ask box to the new session page with the question seeded. That page shows its composer until the run starts, so it flashed before the session opened. The ask box went back to /ai?ask=….
  • A session for a space starts without the warm sandbox, because the side panel owns the warm run and a warm run has no space.
  • No duplicate open PR found.

Created with PostHog Desktop

🤖 Generated with Claude Code

The Today ask box and its walk-through link open /spaces/new?ask=..., which seeds the default space's composer and sends it when the organization accepts AI data processing.

The Today report prompts start the report discussion in the default space and open the session page, not the side panel. The task stays linked to the report.

Generated-By: PostHog Desktop
Task-Id: f32478c0-2f55-4a4b-80c7-bfd60fea5a3e
@VojtechBartos VojtechBartos self-assigned this Oct 2, 2026
@VojtechBartos
VojtechBartos added this pull request to stack #110941 October 2, 2026 15:39
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

⚠️ Complexity (TypeScript) — 3 functions above the limit (max 18)

Cyclomatic complexity above the limit in changed typescript files (10 for production files, 15 for test files). Warn only: worth simplifying when you next touch these functions.

Function Location Complexity Limit
discussReport products/signals/frontend/inbox/inboxTaskKickoffLogic.ts:711 18 10
warmReportDiscussion products/signals/frontend/inbox/inboxTaskKickoffLogic.ts:606 16 10
createReportTask products/signals/frontend/inbox/inboxTaskKickoffLogic.ts:258 14 10
✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

⚠️ Comment density — 5% of added code lines are comments (3 of 56)

This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.

Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.

Files with the most added comment lines:

File Comment lines Added lines
products/signals/frontend/inbox/inboxTaskKickoffLogic.ts 2 26
frontend/src/scenes/project-homepage/today/TodayReportPrompts.tsx 1 10

This check does not block merging. It updates on every push and clears when the share drops.

⚠️ Bundle size — 🔺 +19.6 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 69.66 MiB · 🔺 +19.6 KiB (+0.0%)

File Size Δ vs base
render-query/src/render-query/render-query.js 18.78 MiB 🔺 +22.8 KiB (+0.1%)
posthog-app/_parent/products/tasks/frontend/spaces/NewSessionScene.js 7.4 KiB 🟢 -1.8 KiB (-19.5%)

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

✅ Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.63 MiB · 22 files no change █████████░ 88.7% of 1.84 MiB
logged-out boot: index + App + bootApp (preloaded by every page, including /login)
src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
3.72 MiB · 660 files no change █████████░ 92.3% of 4.03 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
7.82 MiB · 2,507 files 🟢 -1.1 KiB (-0.0%) █████████░ 93.7% of 8.34 MiB
dashboard scene
src/scenes/dashboard/Dashboard.tsx
9.68 MiB · 3,401 files 🔺 +20.9 KiB (+0.2%) ███████░░░ 71.8% of 13.48 MiB
project home scene
src/scenes/project-homepage/ProjectHomepage.tsx
14.06 MiB · 5,036 files 🔺 +25.8 KiB (+0.2%) █████████░ 85.5% of 16.44 MiB
events scene
src/scenes/activity/explore/EventsScene.tsx
9.30 MiB · 3,253 files 🔺 +20.9 KiB (+0.2%) ███████░░░ 73.6% of 12.64 MiB
replay detail scene
src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
12.12 MiB · 4,130 files 🔺 +20.9 KiB (+0.2%) ████████░░ 77.1% of 15.72 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/layout/navigation-3000/navigationLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/dashboard/dashboardLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/lemon-ui/LemonMarkdown/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/RichContentEditor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/CodeSnippet/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/taxonomy/core-filter-definitions-by-group.json stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.3 KiB src/index.tsx
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
854 B src/scenes/ChunkLoadErrorBoundary.tsx
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
Size File
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
100.5 KiB src/lib/api.ts
92.7 KiB src/products.tsx
69.4 KiB src/lib/lemon-ui/icons/icons.tsx
40.1 KiB src/lib/utils/eventUsageLogic.ts
38.7 KiB ../node_modules/.pnpm/@dnd-kit+core@6.0.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js
33.9 KiB ../node_modules/.pnpm/kea@4.0.0-pre.6_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js
29.0 KiB ../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
279.9 KiB src/taxonomy/core-filter-definitions-by-group.json
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
110.1 KiB ../packages/quill/packages/quill/dist/index.js
100.5 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
92.7 KiB src/products.tsx
90.6 KiB ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
Size File
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
279.9 KiB src/taxonomy/core-filter-definitions-by-group.json
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
181.8 KiB src/queries/validators.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
110.1 KiB ../packages/quill/packages/quill/dist/index.js
100.5 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
92.7 KiB src/products.tsx
Largest files eagerly shipped from src/scenes/project-homepage/ProjectHomepage.tsx
Size File
315.5 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
279.9 KiB src/taxonomy/core-filter-definitions-by-group.json
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
181.8 KiB src/queries/validators.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
110.1 KiB ../packages/quill/packages/quill/dist/index.js
100.5 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
Size File
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
279.9 KiB src/taxonomy/core-filter-definitions-by-group.json
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
181.8 KiB src/queries/validators.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
110.1 KiB ../packages/quill/packages/quill/dist/index.js
100.5 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
92.7 KiB src/products.tsx
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
Size File
315.5 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js
306.2 KiB ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
279.9 KiB src/taxonomy/core-filter-definitions-by-group.json
220.3 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
181.8 KiB src/queries/validators.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
110.1 KiB ../packages/quill/packages/quill/dist/index.js
100.5 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

✅ Toolbar bundle — eager 2.20 MiB within budget

What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.

Metric Size Δ vs base Budget
Eager (shipped)
entry + static imports
2.20 MiB · 19 files no change ████░░░░░░ 38.4% of 5.72 MiB
Deferred (lazy) 2.11 MiB · 44 files no change n/a — loads on demand
Loader dist/toolbar.js 1.2 KiB no change █░░░░░░░░░ 6.0% of 19.5 KiB
Largest eagerly-shipped chunks
Size File
834.4 KiB dist/toolbar/toolbar-app-3U3RM2CS.css
657.4 KiB dist/toolbar/chunk-chunk-TNRTR3I3.js
259.4 KiB dist/toolbar/chunk-chunk-SVMAQ3OC.js
138.2 KiB dist/toolbar/chunk-chunk-BUO6MW6E.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
75.2 KiB dist/toolbar/toolbar-app-WHQRWUQS.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-LWEC4HSN.js
21.0 KiB dist/toolbar/chunk-chunk-AVIOSREB.js
6.8 KiB dist/toolbar/chunk-chunk-DV7IWQNF.js

Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile

✅ Dist folder size — 🔺 +264.0 KiB (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 959.61 MiB · 🔺 +264.0 KiB (+0.0%)

@VojtechBartos
VojtechBartos removed this pull request from stack #110941 October 2, 2026 15:39
@github-actions github-actions Bot added the feature/desktop Feature Tag: Desktop label Oct 2, 2026
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Retrigger

[Medium risk] Changes how AI questions flow to task creation.

The PR should not merge until Today questions and report prompts handle unresolved or absent spaces without losing their intended destination.

Reviews (1) · Last reviewed commit: "fix(tasks): start a new session from the..."

// panel still shows a discussion about another report.
openReportDiscussion(report, reportUrl)
discussReport(report, reportUrl, question)
discussReport(report, reportUrl, question, undefined, undefined, { channelId: space?.id ?? null })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Report session misses its space If someone submits a report prompt before the spaces request finishes, space is still null. This call passes a null space ID, so the task is created outside the person's default space. Disable submission until the space resolves, or resolve the target before creating the task.

Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/scenes/project-homepage/today/TodayReportPrompts.tsx
Line: 62

Comment:
**Report session misses its space** If someone submits a report prompt before the spaces request finishes, `space` is still null. This call passes a null space ID, so the task is created outside the person's default space. Disable submission until the space resolves, or resolve the target before creating the task.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread products/tasks/frontend/spaces/newSessionSceneLogic.ts Outdated
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

Today AI prompts now open new-session routes, where URL questions seed the selected space's composer and auto-submit depends on AI-data-processing consent. Report prompts pass a selected space or null to discussReport. Targeted report discussions create channel-linked tasks and navigate to the task page instead of opening the report side panel. Untargeted discussions retain the existing side-panel flow.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes the required sections, testing details, release status, and agent context. However, it incorrectly states that the Today ask box is unchanged and still uses /ai?ask=…; the c… Update the Changes section to describe the Today ask box and walkthrough link behavior accurately, including /spaces/new?ask=…, default-space selection, URL cleanup, and consent-dependent auto-submit. Remove the conflicting /ai?ask=… st…
Full details: Description check

Explanation

The description includes the required sections, testing details, release status, and agent context. However, it incorrectly states that the Today ask box is unchanged and still uses /ai?ask=…; the changes and objectives indicate that Today ask inputs now use /spaces/new?ask=… and seed the new-session composer.

Resolution

Update the Changes section to describe the Today ask box and walkthrough link behavior accurately, including /spaces/new?ask=…, default-space selection, URL cleanup, and consent-dependent auto-submit. Remove the conflicting /ai?ask=… statement.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
products/signals/frontend/inbox/inboxTaskKickoffLogic.ts-780-782 (1)

780-782: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard disposed targeted completions before navigation.

When the Today-owned inboxTaskKickoffLogic mount is disposed while the request is pending, the targeted branch still calls loadRecentTasks and pushes the task route. Add the disposal guard before these side effects. Keep navigation for active logic, because targeted discussions intentionally open their task session page.

Suggested fix
                 if (target) {
+                    if (cache.disposables.isDisposed) {
+                        return
+                    }
                     todaySpacesLogic.findMounted()?.actions.loadRecentTasks()
                     router.actions.push(urls.aiTask(taskId))

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: PostHog/posthog/.coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 24bb99e9-f223-47b8-acb7-6efd93083f79

📥 Commits

Reviewing files that changed from the base of the PR and between 311d369 and e00a4f7.

📒 Files selected for processing (9)
  • frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
  • frontend/src/scenes/project-homepage/today/TodayReportPrompts.tsx
  • frontend/src/scenes/project-homepage/today/todayLogic.test.ts
  • frontend/src/scenes/project-homepage/today/todayLogic.ts
  • products/signals/frontend/inbox/inboxTaskKickoffLogic.test.ts
  • products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
  • products/tasks/frontend/spaces/NewSessionScene.tsx
  • products/tasks/frontend/spaces/newSessionSceneLogic.test.ts
  • products/tasks/frontend/spaces/newSessionSceneLogic.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

if (search.ask) {
const { ask, ...remainingSearch } = search
// Remove the question first, so a later visit to this URL cannot send it again.
router.actions.replace(router.values.location.pathname, remainingSearch, hash)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep ask recoverable until the composer seed exists.

If spaces fail to load and the person refreshes, Line 214 has already removed ask from the URL. The refresh also discards pendingAsk, so the question and its Today context are lost. The same loss occurs when the person refreshes before spaces finish loading. Remove ask only after seedPendingAsk stores the seed, or persist the pending question across refreshes. The router supports replacing a URL while retaining its other search and hash parameters. (keajs.org)

The new session page shows its composer until the session is created and its run starts, so a seeded ask flashed that page before the session opened. The /ai page opens the run as soon as the question is sent, so the ask box goes to /ai?ask=... again.

Generated-By: PostHog Desktop
Task-Id: f32478c0-2f55-4a4b-80c7-bfd60fea5a3e
@VojtechBartos VojtechBartos changed the title fix(tasks): start a new session from the today ask inputs fix(tasks): open today report questions as a new session Oct 2, 2026
@trunk-io

trunk-io Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

Failed Test Failure Summary Logs
Scenes/Code review Default play-test The test failed because a logic component was not mounted when accessed, and there were unhandled network requests intercepted by the mock service... Logs ↗︎

View Full Report ↗︎ ⋅ Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/desktop Feature Tag: Desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant