fix(sessions): drop redundant generic "PostHog" resource chip#2909
Draft
adboio wants to merge 2 commits into
Draft
fix(sessions): drop redundant generic "PostHog" resource chip#2909adboio wants to merge 2 commits into
adboio wants to merge 2 commits into
Conversation
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
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
posthogproduct 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:DOMAIN_PRODUCTkeys were written more specifically than the actual MCP domain token (e.g.notebooksvsnotebook,cdp-functionsvscdp-function,llma-personal-spendvs thellma-*family). Legitimate product calls were being mis-bucketed into the fallback instead of showing their real product chip.Changes
posthogproduct id. Unrecognized domains now classify asnulland surface nothing — matching how known admin/meta domains already behave. The exhaustiveRecord<PostHogProductId, …>types compile-enforced dropping its icon/docs-URL entries inSessionResourcesBar.isUnclassifiedPostHogSubTool+ a debug log in the agent, so genuinely-unknown PostHog sub-tools become visible andDOMAIN_PRODUCTcan be expanded deliberately. Deliberately-suppressed admin domains (project, docs-search, …) don't log.llma-*family → AI observability, fixednotebook/cdp-function/external-data/web-analytics, and addedevent-definition(Product analytics) andvision(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— cleanbiome linton the changed files — clean@posthog/agent's suite has pre-existing failures onmainunrelated to this change — stale@posthog/shared/@posthog/gitdist artifacts.)Automatic notifications
Created with PostHog Code from a Slack thread