Skip to content

fix(sessions): drop redundant generic "PostHog" resource chip#2909

Draft
adboio wants to merge 2 commits into
mainfrom
posthog-code/drop-generic-posthog-resource-chip
Draft

fix(sessions): drop redundant generic "PostHog" resource chip#2909
adboio wants to merge 2 commits into
mainfrom
posthog-code/drop-generic-posthog-resource-chip

Conversation

@adboio

@adboio adboio commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem

In a session's "PostHog resources used" bar, one chip just said PostHog. As Matt flagged in the thread: inside a bar literally titled "PostHog resources used", a chip that says "PostHog" is redundant.

It was the generic fallback (posthog product id) the MCP sub-tool classifier returned whenever a call's domain wasn't recognized. Digging into what was actually hitting that fallback surfaced two further problems:

  • No visibility — an unrecognized call fell to the fallback silently, with nothing logged, so we had no way to know which sub-tools were landing there.
  • Real coverage gaps — several DOMAIN_PRODUCT keys were written more specifically than the actual MCP domain token (e.g. notebooks vs notebook, cdp-functions vs cdp-function, llma-personal-spend vs the llma-* family). Legitimate product calls were being mis-bucketed into the fallback instead of showing their real product chip.

Changes

  • Removed the generic posthog product id. Unrecognized domains now classify as null and surface nothing — matching how known admin/meta domains already behave. The exhaustive Record<PostHogProductId, …> types compile-enforced dropping its icon/docs-URL entries in SessionResourcesBar.
  • Added isUnclassifiedPostHogSubTool + a debug log in the agent, so genuinely-unknown PostHog sub-tools become visible and DOMAIN_PRODUCT can be expanded deliberately. Deliberately-suppressed admin domains (project, docs-search, …) don't log.
  • Closed domain-map gaps so real product calls resolve to the right chip: consolidated the whole llma-* family → AI observability, fixed notebook / cdp-function / external-data / web-analytics, and added event-definition (Product analytics) and vision (Replay Vision → Session replay).

No frontend screenshot — the only UI effect is removing a chip that should never have rendered.

How did you test this?

  • pnpm --filter @posthog/agent test posthog-products — 82 passing (incl. new coverage for the fixed domains and the new predicate)
  • pnpm --filter @posthog/agent --filter @posthog/ui typecheck — clean
  • biome lint on the changed files — clean
  • (Note: the rest of @posthog/agent's suite has pre-existing failures on main unrelated to this change — stale @posthog/shared / @posthog/git dist artifacts.)

Automatic notifications

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

Created with PostHog Code from a Slack thread

The "PostHog resources used" bar surfaced a generic "PostHog" chip whenever
the MCP sub-tool classifier didn't recognize a call's domain. Inside a bar
already titled "PostHog resources used", that chip carries no information.

Unrecognized domains now classify as null and surface nothing — matching how
known admin/meta domains already behave — and the generic `posthog` product id
is removed entirely.

Generated-By: PostHog Code
Task-Id: bd580ad9-3e3e-45e7-a3ee-665d5722c57d
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit cfb510e.

@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(sessions): drop redundant generic "P..." | Re-trigger Greptile

Investigating what fed the now-removed generic "PostHog" chip surfaced two
things:

- No visibility: an unrecognized exec call silently fell to the fallback,
  with nothing logged. Added `isUnclassifiedPostHogSubTool` and a debug log in
  the agent so genuinely-unknown sub-tools are visible (deliberately-suppressed
  admin domains like project/docs-search don't log).
- Real gaps: several DOMAIN_PRODUCT keys were written more specifically than the
  actual MCP domain token, so legitimate product calls were mis-bucketed into
  the fallback. Consolidated/fixed: the whole `llma-*` family, `notebook`,
  `cdp-function`, `external-data`, `web-analytics`, plus added `event-definition`
  and `vision` (Replay Vision).

Generated-By: PostHog Code
Task-Id: bd580ad9-3e3e-45e7-a3ee-665d5722c57d
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