Repository navigation
feat(mcp): stop sending standalone $identify events - #1067
Merged
Merged
Conversation
The identify callback still sets distinct_id, $set and $groups on every event. The standalone event carried no $anon_distinct_id, so ingestion merged no person, and stateless servers sent one per tool call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
posthog-python Compliance ReportDate: 2026-10-19T09:07:03.535493+00:00 ✅ All Tests Passed!121/121 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Capture_Ai Tests✅ 5/5 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
stamphog
Bot
dismissed
their stale review
October 19, 2026 09:01
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Approved.
The disclosed analytics write-path and event-contract changes have independent assurance from a current-head agent review. No outstanding substantive concerns or other refusal grounds were found.
- Author wrote 29% of the modified lines and has 13 merged PRs in these paths (familiarity MODERATE).
- PostHog Review (Standard) reviewed the current head: no findings.
- posthog[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 100L, 6F substantive, 198L/13F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (198L, 13F, cross-cutting, feat) |
| stamphog 2.6.0 | .stamphog/policy.yml @ f01d47e · reviewed head f01d47e |
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.
💡 Motivation and Context
$identifyon every tool call, on both MCP SDK majors and both spec eras. Some setups send two per call.$anon_distinct_id, so ingestion merges no person (merge condition). Every other MCP event already carries the samedistinct_id,$setand$groups.@posthog/mcp.Changes
posthog.mcpno longer sends$identifyfor any spec version, server type or session mode. Theidentifycallback still runs on every request and attributes each event.PostHogMCPAnalyticsEvent.IDENTIFYstays for compatibility, marked deprecated.💚 How did you test it?
mcp1.28.1 withfastmcp3.2.0, v2:mcp2.3.0 withfastmcp4.1.0). Tests now assert no$identifyand correct attribution.$identify. It fails againstmain.$identifycount per setup:MCPServerOn this PR every tool call keeps the identified
distinct_idand$set.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
claude-opus-5-5).🤖 Generated with Claude Code