Conversation
Add a PostHog fake implementing event capture, feature flag evaluation, and user/group identification for AI agent testing. Endpoints: - POST /batch/ (capture, set, set_once, group_identify) - POST /flags/ (feature_enabled, get_feature_flag, get_all_flags) - POST /decide/ (legacy flag evaluation) - GET /api/feature_flag/local_evaluation/ (load_feature_flags) 19 contract tests verify all endpoints using the official PostHog Python SDK v7.9. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AdamGold
approved these changes
Feb 26, 2026
rotemtam
pushed a commit
that referenced
this pull request
Feb 26, 2026
Add a PostHog fake implementing event capture, feature flag evaluation, and user/group identification for AI agent testing. Endpoints: - POST /batch/ (capture, set, set_once, group_identify) - POST /flags/ (feature_enabled, get_feature_flag, get_all_flags) - POST /decide/ (legacy flag evaluation) - GET /api/feature_flag/local_evaluation/ (load_feature_flags) 19 contract tests verify all endpoints using the official PostHog Python SDK v7.9. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
rotemtam
added a commit
that referenced
this pull request
Feb 26, 2026
* feat: add PostHog analytics API fake service (#34) Add a PostHog fake implementing event capture, feature flag evaluation, and user/group identification for AI agent testing. Endpoints: - POST /batch/ (capture, set, set_once, group_identify) - POST /flags/ (feature_enabled, get_feature_flag, get_all_flags) - POST /decide/ (legacy flag evaluation) - GET /api/feature_flag/local_evaluation/ (load_feature_flags) 19 contract tests verify all endpoints using the official PostHog Python SDK v7.9. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * feat: add Todoist REST API v2 fake service Adds a stateful fake of the Todoist REST API v2 with 10 contract test modules covering tasks, projects, sections, labels, comments, subtasks, due dates, filtering, and cross-resource agent workflows. Generated by da-agent (multi-phase pipeline). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add .mise.toml for todoist service Missing tool declaration caused CI to fail with "No such file or directory" because uv/python weren't installed by mise. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Assaf Ben Josef <80702314+assaf-benjosef@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Add a PostHog fake service for testing AI agents that interact with analytics and feature flags without hitting the real PostHog API.
/batch/— supportscapture(),set(),set_once(),group_identify()with person/group profile side effects/flags/— boolean flags, multivariate (variant) flags, and payloads/api/feature_flag/local_evaluation/— flag definitions for SDK-side evaluation/decide/endpoint for backwards compatibilityPOST /batch/capture(),set(),set_once(),group_identify()POST /flags/feature_enabled(),get_feature_flag(),get_all_flags(),get_feature_flag_payload()GET /api/feature_flag/local_evaluation/load_feature_flags()POST /decide/PostHog's SDK is unusual: auth is via
api_keyin the JSON body (not headers), and all events flow through a single/batch/endpoint.Test plan
doubleagent contract posthog— 19 contract tests pass using the official PostHog Python SDK v7.9$set,set(),set_once(),group_identify(), multi-event, filteringget_all_flags(), groups,load_feature_flags()local evaluation, local payloadGenerated with Claude Code