Skip to content

feat(sessions): remove stale-conversation cost notice#3189

Merged
charlesvien merged 4 commits into
mainfrom
posthog-code/stale-conversation-banner
Jul 6, 2026
Merged

feat(sessions): remove stale-conversation cost notice#3189
charlesvien merged 4 commits into
mainfrom
posthog-code/stale-conversation-banner

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 6, 2026

Copy link
Copy Markdown
Member

Problem

When PostHog staff returned to a large, idle conversation, a cost notice appeared warning that the prompt cache had likely expired. It started as a blocking prompt over the composer; this PR first made it a small non-blocking banner, but the conclusion from discussion is that the notice shouldn't exist at all.

As a non-blocking banner it's just visual noise — it doesn't change behaviour, and it's only shown to staff. And compacting isn't the right recommendation: you pay the same uncached full-price input cost on the next message whether or not you compact, and a normal message re-warms the cache for subsequent turns regardless. So the "compact" call-to-action was misleading.

Changes

Remove the stale-conversation notice/gate entirely:

  • Deleted the banner component (+ stories), the gate hook, and the gate store (+ test).
  • Removed the shouldWarnStaleCostlyConversation / extractLastActivityAt helpers and their thresholds/tests from core.
  • Removed the STALE_CONVERSATION_GATE_CHOICE analytics event and its properties.
  • Removed all wiring from SessionView.

Net ~630 lines deleted; no behavioural change for users (the notice was staff-only).

How did you test this?

  • pnpm --filter @posthog/core --filter @posthog/ui --filter @posthog/shared typecheck — clean
  • pnpm --filter @posthog/core test contextUsage — passing
  • biome ci . — clean (exit 0)

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog from a Slack thread

The large-idle-conversation cost warning replaced the composer with an
ActionSelector, forcing staff to choose compact / continue / new session
before they could type again. Turn it into a slim, dismissible banner pinned
above the composer so the input box stays usable — you can fire off one more
prompt or dismiss the notice and deal with compaction later.

Compact stays a one-click action; the dismiss (X) acknowledges the warning
for the session so it doesn't keep nagging.

Generated-By: PostHog Code
Task-Id: f70fc300-9167-4c69-b96b-3e34fe03588e
@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit f9325f5.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

  1. packages/ui/src/features/sessions/components/SessionView.tsx, line 356-359 (link)

    P2 The analytics event still records "continue" for what is now a dismiss action in the UI. If these events are queried to understand user intent (compact vs. continue vs. new-session), the label will not match the new banner vocabulary — future readers of dashboards will see "continue" where the user actually clicked "✕ dismiss". Renaming to "dismiss" keeps the tracking consistent with the redesigned UX.

Reviews (1): Last reviewed commit: "fix(sessions): make stale-conversation c..." | Re-trigger Greptile

Comment thread packages/ui/src/features/sessions/components/StaleConversationCostNotice.tsx Outdated
The `spent` assignment exceeded the line width; `biome ci` (which checks
formatting) flagged it. Wrap it as the formatter expects to turn the quality
check green.

Generated-By: PostHog Code
Task-Id: f70fc300-9167-4c69-b96b-3e34fe03588e
- Use the shared `@posthog/ui/primitives/Tooltip` instead of the Radix Themes
  one, so the banner's tooltips match the rest of the UI (dark theme, padding,
  shadow) like other Quill-button tooltips.
- Rename the gate-choice analytics value "continue" -> "dismiss" to match the
  redesigned UX (the "Continue anyway" button is now a dismiss ✕), keeping the
  event vocabulary consistent for dashboards.

Generated-By: PostHog Code
Task-Id: f70fc300-9167-4c69-b96b-3e34fe03588e
@charlesvien charlesvien closed this Jul 6, 2026
@charlesvien charlesvien changed the title fix(sessions): make stale-conversation cost notice a dismissible banner feat(sessions): remove stale-conversation cost notice Jul 6, 2026
@charlesvien charlesvien reopened this Jul 6, 2026
Remove the staff-only stale-conversation gate/notice entirely. As a
non-blocking banner it was just visual noise: it didn't change user behaviour,
and compacting isn't the right recommendation anyway — the next message pays
the same uncached input cost whether or not you compact, then warms the cache
for the following turns regardless.

Removes the banner component and stories, the gate hook and store (+test), the
`shouldWarnStaleCostlyConversation` / `extractLastActivityAt` helpers and their
tests in core, and the `STALE_CONVERSATION_GATE_CHOICE` analytics event.

Generated-By: PostHog Code
Task-Id: f70fc300-9167-4c69-b96b-3e34fe03588e
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "feat(sessions): remove stale-conversatio..." | Re-trigger Greptile

@charlesvien charlesvien marked this pull request as ready for review July 6, 2026 19:51
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "feat(sessions): remove stale-conversatio..." | Re-trigger Greptile

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 6, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates denied this PR because it exceeds the automated review size ceiling (673 lines, 9 files). While the change is mostly deletions (removing the stale-conversation cost notice feature), the scale requires a human reviewer to confirm no dependent code paths were missed. Request a review from a teammate before re-requesting auto-approval.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 6, 2026
@charlesvien charlesvien merged commit 699db78 into main Jul 6, 2026
31 checks passed
@charlesvien charlesvien deleted the posthog-code/stale-conversation-banner branch July 6, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant