Repository navigation
Conversation
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Ask for another review through the PostHog MCP or comment @posthog stamp once you have addressed this.
The prerequisites gate refused this pull request because it has merge conflicts. The other gates (deny-list, attestation, size, and tier) all passed, so the conflicts are the only thing blocking it. The author should resolve the conflicts against the base branch and push the update. If the pull request still needs a decision after that, they can ask a human reviewer to look at it.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✗ | merge conflicts present |
| deny-list | ✓ | no deny categories matched |
| every_file_attested | ✓ | not a bot PR |
| size | ✓ | 21L, 1F substantive, 158L/4F incl. size-exempt files — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (158L, 4F, two-areas, fix) |
| stamphog 2.11.0 | .stamphog/policy.yml @ unknown · reviewed head 6330704 |
…called-ingestion-inputs # Conflicts: # posthog/client.py
There was a problem hiding this comment.
Approved.
The ingestion-path change has independent assurance through the author's reported STRONG familiarity and added regression tests. No unresolved review concerns or other refusal grounds were found; the discussion bot summary is not a current-head review.
- Author wrote 100% of the modified lines and has 2 merged PRs in these paths (familiarity STRONG).
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| every_file_attested | ✓ | not a bot PR |
| size | ✓ | 19L, 1F substantive, 165L/4F incl. size-exempt files — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (165L, 4F, two-areas, fix) |
| stamphog 2.11.0 | .stamphog/policy.yml @ 911d013 · reviewed head 911d013 |
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
Minimal
$feature_flag_calledevents stripped the$ipand$raw_user_agentthat the Django, Flask and ASGI integrations attach. Ingestion fills$ipfrom the capture request only when the event doesn't have one. posthog-python sends from the app's server, so every minimal flag call got the server's GeoIP location instead of the visitor's. The allowlist also stripped the other inputs that ingestion hashes into the cookieless distinct id and session id. Ingestion drops a cookieless event that lacks$raw_user_agent,$ipor$host, so in cookieless mode it dropped every minimal flag call.This adds
$ip,$raw_user_agent,$host,$timezoneand$cookieless_extrato the minimal allowlist, next to$geoip_disable.$cookieless_modeis already on it. The SDK keeps these keys whenever the full event carries them and doesn't check for cookieless mode. Cookieless mode can come fromsuper_options, a context option, the$cookieless_modeproperty, or abefore_sendhook that runs after the allowlist. This implements follow-up task 3.5 of PostHog/sdk-specs#281.$current_url,$user_agent,$request_method,$request_pathand the browser and device properties stay off the list, as the spec requires of a server SDK.$os,$os_versionand the othersystem_context()keys describe the server's runtime, so they stay on it.💚 How did you test it?
test_feature_flag_called_minimization.pycheck that a minimal flag call keeps the ingestion inputs from the context and strips the request-only properties.super_options, throughset_context_option, and through the$cookieless_modeproperty. In each case the v1 event hasoptions.cookieless_mode: trueand still carries the inputs inproperties.test_middleware.pymakes a flag call whilePosthogContextMiddlewarehandles a request. The event keeps$ipand$raw_user_agentand strips$current_url,$user_agent,$request_methodand$request_path.posthog/test/mcp/test_fastmcp_v2.py, which fail because my installed fastmcp is older than the version they need.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
review-codepass and a Codex correctness review found no code defects, and I applied their wording fixes.super_options, so I kept main's list, added the five keys, and bound the cookieless test tosuper_optionsas the spec scenario describes.