Repository navigation
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-10-06T19:08:26.100214+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
|
3 of 5 tasks
eli-r-ph
marked this pull request as ready for review
October 7, 2026 20:43
This was referenced Oct 7, 2026
eli-r-ph
marked this pull request as draft
October 8, 2026 19:40
Contributor
Author
|
Putting this back in draft for safety as per the other SDK |
4 of 5 tasks
…nts (#1017) feat!: send capture through v1 by default; capture_ai posts to /i/v1/ai/events Capture v1 is now the default capture mode. The AI lane always posts capture v1 to /i/v1/ai/events, uncompressed, regardless of the analytics capture_mode. Tests move to a shared capture v1 send seam (posthog/test/capture_helpers.py); v0-only tests are pinned to CaptureMode.V0 until v0 removal.
Capture v1 is the only capture path. Remove CaptureMode, the capture_mode kwarg and POSTHOG_CAPTURE_MODE, the gzip kwarg, request.batch_post and the v0 endpoint constants, and the backoff dependency. Client and AsyncPosthog constructors are keyword-only after host.
Rename CaptureV1Error to CaptureError and export it from posthog. Event shaping moves to posthog.capture_event and transport to posthog.capture_send. No behavior change.
…1020) * feat!: report capture v1 results through CaptureError and on_error * test: cover _uuid7 layout for the mutation gate * fix: re-raise sync capture failures in debug mode after reporting them Also document which events verdict_summary() counts.
* feat: AI lane config and size-aware batching * chore: tighten AI lane comments * fix: reject non-finite AI lane config values
test(mcp): drop get_tool checks that fastmcp 4.0.11 invalidated fastmcp 4.0.11 resolves middleware-injected tools through the server's tool lookup (PrefectHQ/fastmcp#5431), so get_tool() now returns them. The two setup assertions that expected None fail on any fresh install. The SDK behavior the tests check is unchanged and passes on 4.0.10 and 4.0.11. (cherry picked from commit 897cd43) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
feat!: per-event capture options and legacy property hoisting
* feat!: super_options, context options and personless as the lowest option layer * docs: state the option layer rules in capture docstrings * feat!: fill context and super values after before_send Context tags, context options, super_properties, super_options, the derived personless option and the environment $release_id now fill only keys an event leaves unset, after before_send runs. before_send sees only the event's own values and SDK enrichment, and its changes beat every default. A None option counts as unset and is filled. Legacy properties still fill only unset options and are always removed. * feat!: fill context and super values before before_send Context tags, context options, super_properties, super_options, the derived personless option and the environment $release_id now fill before before_send runs, still only into keys the event leaves unset. before_send sees every value and has the final say, including removing a super property. $set, $set_once, $groups and $group_set fill one level deep when both values are dicts. The set() and set_once() values now win key by key over a $set or $set_once in properties, as ingestion merges them. Hoisting still runs once, after the hook. * feat!: SDK values are defaults that caller values override $is_server, $geoip_disable and system context now fill last, only keys the event, context tags and super_properties left unset, before before_send. A super property $geoip_disable: False now wins over disable_geoip=True. The groups argument merges into a $groups property key by key and wins, in Client, AsyncClient and posthog.mcp events. * fix: copy async default layers at admission; typed groups win on MCP exception events AsyncPosthog filled defaults in the worker from references to the live super_properties and options, so a change after capture could reach a queued event. Each layer is now shallow-copied when the event is admitted, as 7.x merged super_properties into a new dict at capture. The MCP exception event now merges typed groups after custom properties, like the primary event, so both events of a failing call get the same groups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
feat!: AI wrappers and MCP send personless as a per-event option
* chore(ci): run compliance harness 1.13.1 once per codec The adapter now advertises capture_ai_v1 and event_options, passes options and uuids through unchanged, and takes its codec from COMPRESSION. The workflow runs the harness containers directly in a gzip/deflate/zstd matrix, so it no longer needs pull-requests: write. * chore(ci): install zstd extra for adapter protocol tests * chore: describe the single capture compliance job and harness 1.13.1 The standalone adapter-test setup installs the zstd extra, matching CI.
enable_full_ai_capture now controls only truncation and media redaction. A client object without capture_ai still gets capture calls.
* feat: AsyncPosthog AI capture lane * fix: type capture v1 send timeouts as float * feat: AsyncPosthog privacy_mode and enable_full_ai_capture * fix: keep async capture_ai from raising on a non-string event name
* test: capture invariant hardening * test: assert exactly one capture loss line per failed batch
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
Long-lived integration branch for posthog 8.0: capture v1 becomes the only capture path, and
capture_aimoves to an isolated v1 lane at/i/v1/ai/events. Feature PRs targetv1; this PR merges tomainonce the series lands. Do not merge.The
majorchangeset bumps the next release from 7.64.1 to 8.0.0.Series, stacked in merge order (each PR's base is the one before it, the first targets
v1):capture_aito/i/v1/ai/eventson a lane-aware v1 submitterhostcapture_v1module andCaptureV1ErrortoCaptureErrorsuper_options, context options, layer order and personless as an optioncapture_v1,capture_ai_v1,event_options), once per codeccapture_aiAsyncPosthogAI lane parity$libcomes only fromPostHog-Sdk-InfoRelated parity PRs: PostHog/posthog-go#359, PostHog/posthog-rs#279
mainis merged intov1periodically (no rebase, so open PRs keep their anchors).💚 How did you test it?
Changeset only. Each series PR carries its own tests.
📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored with Cursor (Claude Opus). Behavior follows the
v1branches of posthog-rs and posthog-go, adapted to this SDK's style.