Repository navigation
Conversation
The error event for a streaming call that fails before the stream starts (OpenAI chat and responses, Anthropic create and messages.stream, Gemini; sync and async) now carries the caller's posthog_options, like the other AI events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The paired benchmark runs the merge-base SDK through this branch's receiver. It now accepts legacy /batch posts again, answering in the legacy format, beside capture v1 posts, so the baseline is measured instead of failing with 404. The receiver test covers both routes and their reply formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pollers left running by other test modules share the patched module-level get, and one of them failed this check on CI. The check now ignores calls made with another client's key; a mutation that makes this client fetch still fails 20 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Motivation and Context
When a streaming AI call fails before the stream starts (for example a bad API key), the error event is sent without the caller's
posthog_options. A call withposthog_options={"process_person_profile": False}or{"cookieless_mode": True}then sends its error event without those controls. Every other AI event carries them, as the 8.0ai-posthog-optionschangeset promises.This adds
options=to the 10 connect-error paths: OpenAI chat and responses, Anthropicmessages.create(stream=True)andmessages.stream(), and Gemini, sync and async.Also in this PR, from the review of #1016:
/batchagain, answering in the legacy format. A local paired capture run (main vs this branch, 2 repetitions) completes all 56 cases.invalid-events-and-sizesno longer says aNaNevent is dropped. A non-finite float is sent asnull(request.py:457-490).None$geoip_disableblocks the SDK'sTruemarker, likeFalse.test_evaluate_flags.pynow counts only calls made with the client's own key. Pollers left running by other test modules share the patchedget, and one failed this check on CI.💚 How did you test it?
posthog_optionsand assert the optionscapture_aireceives: the caller's, plusprocess_person_profile: Falsefor the 8 without a distinct id. All 10 fail without the fix and pass with it, and every earlier assertion is kept.v1and passes on this branch.test_metrics_autocapture.pythat fail the same way on unchangedv1on macOS.📝 Checklist
If releasing new changes
sampo addto generate a changeset file. Not needed: the unreleasedai-posthog-optionschangeset already covers this.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code (Claude Opus 5.5) after a review comment on #1016. The fix copies the
options=argument the success and mid-stream paths already pass.🤖 Generated with Claude Code