feat(mcp): show PostHog exec payload in permission dialog#2080
Merged
Conversation
The PostHog exec destructive flow was rendering only "The agent wants to run X on PostHog" with no payload because the agent didn't tag the permission request with `_meta.claudeCode.toolName`, so the renderer fell through to DefaultPermission. Setting that meta routes the dialog to McpPermission, which unwraps the `call <subTool> <json>` command and shows the JSON args pretty-printed. Also moves the PostHog-specific exec-display helpers out of the generic mcp-apps feature into their own posthog-mcp feature, and adds a formatPosthogExecBody helper so the dialog body matches the chat row's unwrapped preview.
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/posthog-mcp/utils/posthog-exec-display.test.ts:204-230
**Non-parameterised tests in `formatPosthogExecBody` suite**
The team's stated preference is parameterised tests. The six new `it()` blocks here are testing the same function with different inputs/outputs and are a textbook candidate for `it.each`. For example, the five cases that check input→output could collapse to a single `it.each` table, and the two `undefined` / `""` cases to another `it.each`, keeping the intent clear without repeating `expect(formatPosthogExecBody(...)).toBe(...)` every time.
Reviews (1): Last reviewed commit: "feat(code): show PostHog exec payload in..." | Re-trigger Greptile |
joshsny
approved these changes
May 7, 2026
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
Beautify the formatting of PostHog MCP tools.
Changes
_meta.claudeCode.toolNameon therequestPermissiontoolCall inhandlePostHogExecApprovalFlowso the renderer routes the dialog toMcpPermission.McpPermission, format the body via a newformatPosthogExecBodyhelper that pretty-prints JSONcallpayloads (and passes other args — e.g.searchregex — through unchanged); verbs without args (tools/info/schema) render no body since the title already conveys the action.mcp-appsfeature into a newposthog-mcpfeature.info/tools/searchverbs alongside the existingcallstory.How did you test this code?
_meta.claudeCode.toolNameis set in the destructive PostHog flow, and new tests forformatPosthogExecBody).Permissions/PermissionSelector → McpPostHogExecshows pretty-printed{ "query": "select 1" }body; sibling stories (McpPostHogExecInfo/Tools/Search) show no body or the regex.Publish to changelog?
no