Repository navigation
Conversation
Declare feature_flag_payloads and add /get_feature_flag_payload, which reads a flag's payload remotely with get_feature_flag_payload. The harness uses it to check payloads read from /flags?v=4 records.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed ebe6e54: 1 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
| groups=data.get("groups"), | ||
| group_properties=data.get("group_properties"), | ||
| disable_geoip=data.get("disable_geoip"), | ||
| only_evaluate_locally=False, |
There was a problem hiding this comment.
P2 · Honor local-only payload evaluation requests
A request with only_evaluate_locally: true still performs remote evaluation because this call hardcodes False and selects the definitions-free client. The harness contract gives this endpoint the same fields as /get_feature_flag, whose local-only option forbids remote fallback. Honor that option using state.client and reject conflicting evaluation modes.
posthog-python Compliance ReportDate: 2026-11-04T10:16:57.378478+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
|
💡 Motivation and Context
The SDK test harness has a new
feature_flags_v4suite (PostHog/posthog-sdk-test-harness#100). It checks how an SDK reads the/flags?v=4flag records, including payloads. It runs only for adapters that declare bothflags_response_v4andfeature_flag_payloads. This adapter already declaresflags_response_v4. This PR adds the other half:/healthnow declares thefeature_flag_payloadscapability.POST /get_feature_flag_payloadroute. It reads a flag's payload remotely with the legacyget_feature_flag_payloadaccessor and returns it as{"success": true, "value": <payload>}. It needskeyanddistinct_id, and it acceptsperson_properties,groups,group_propertiesanddisable_geoip.CI does not change yet. The workflow pins harness 1.23.0, which does not know
feature_flag_payloads, so it ignores the new capability and route. Thefeature_flags_v4suite starts to run, and blocks merges, after harness #100 is released and the pin insdk-compliance.ymlmoves to that release.This PR does not move the pin. The capture v1 job fails
retry_behavior.retries_on_404andretries_on_429from harness 1.24.0. #1178 fixes that separately. A pin bump can follow after both PRs merge and harness #100 is released.💚 How did you test it?
pytest sdk_compliance_adapter/test_adapter.py: 24 passed, including a new test that the payload route reads remotely and returns the parsed payload.ruff format --check .,ruff check .andmypy ... | mypy-baseline filterpass.6b250e5) without Docker, with this adapter on this branch:feature_flags_v4The two v1 failures are
retry_behavior.retries_on_404andretries_on_429. They are not related to this PR, and #1178 fixes them.📝 Checklist
If releasing new changes
sampo addto generate a changeset fileNo changeset: this changes only the test adapter, not the published package.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored with Claude Code, directed by @andehen. The harness was run locally without Docker against the adapter in v0 and v1 capture modes.
🤖 Generated with Claude Code