Repository navigation
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-10-07T02:08:45.202684+00:00 ✅ All Tests Passed!116/116 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
3 of 18 tasks
eli-r-ph
force-pushed
the
v1-capture-options
branch
from
October 7, 2026 02:03
891b4c8 to
a515200
Compare
eli-r-ph
force-pushed
the
v1-capture-ai-config
branch
from
October 7, 2026 02:03
0ae6eb7 to
8da410d
Compare
3 of 5 tasks
This branch has not been deployed
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
Capture v1 sends processing options (
process_person_profile,cookieless_mode,disable_skew_correction,product_tour_id) in a per-eventoptionsobject. Until now the SDK only filled it from legacy$properties, coerced the values, and gave callers no way to set options directly. posthog-go and posthog-rsv1already take per-event options and send them as given.New
optionsargument oncapture,capture_ai,set,set_once,group_identify,aliasandcapture_exception, onClient,AsyncPosthogand the module-level functions. For example:posthog.capture("signed_up", distinct_id=..., options={"cookieless_mode": True}).Behavior changes:
$cookieless_mode,$ignore_sent_at,$product_tour_idand$process_person_profilestill fill the matching option, unchanged. Before,"true"becameTrueand an unparseable value was dropped. The property is always removed fromproperties.nulloption counts as unset, so the property fills it. This matches go and rs.before_send. That was already the case.before_sendnow also seesoptionsand can change it.{...}braced andurn:uuid:in any case; each is canonicalizeduuid:prefix or misplaced hyphens, is replaced with a generated uuid and loggedAsyncPosthogtoo, which before accepted anythinguuid.UUID()parses$feature_flag_calledevents keep$cookieless_mode,$ignore_sent_at,$product_tour_idand$window_id. The allowlist runs before the legacy properties move into options, so these were dropped and their options lost. posthog-go has the same fix in feat!: add default and request-context options; event values win over defaults posthog-go#359.Not in this PR: global and context options, the layer-order change, and the personless option (next PR in the stack), and AI wrappers and MCP moving to options (the one after).
💚 How did you test it?
test_event_options.py. It checks thatoptionsreaches the wire from every method onClientandAsyncPosthog. Abefore_sendthat returns a new event can change options and remove a legacy property. A non-dictoptionsis logged and the event is still sent.window_id.aliasdropping optionspython -W error -c "import posthog", the public API snapshot anduv lock --check.📝 Checklist
If releasing new changes
sampo addto generate a changeset fileCovered by the existing
capture-v1-majorchangeset; the migration guide lands later in this stack.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Cursor (Claude Opus) under the direction of the assignee.
Agreed before implementation:
optionslogged and ignored$session_id/$window_idmove to top-level fieldsbefore_senduuid.ValidateAgent calls worth review:
options(maybe{}), sobefore_sendsees the keynulllegacy property still fills an unset option asnull, as in posthog-rs