feat(llma): tag stamphog traces with ai_product property#53598
Merged
Conversation
Adds the standard `ai_product=stamphog` property to PR approval agent LLM events so they can be filtered alongside other PostHog AI products (posthog_ai, signals, etc.) in LLM Analytics.
Contributor
|
Reviews (1): Last reviewed commit: "feat(llma): tag stamphog traces with ai_..." | Re-trigger Greptile |
rnegron
approved these changes
Apr 7, 2026
Member
Author
|
@PostHog/team-security 👋 i think this one might need a review from you too following codeowners |
rafaeelaudibert
approved these changes
Apr 8, 2026
MattBro
pushed a commit
that referenced
this pull request
Apr 8, 2026
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.
Problem
The stamphog PR approval agent now emits LLM Analytics events (since #53008), but its events don't carry the standard
ai_productproperty that PostHog uses internally to identify which product a trace belongs to. Other internal AI products already use this convention:ee/hogai/llm.py→ai_product = "posthog_ai"ee/hogai/session_summaries/tracking.py→ai_product = "signals"services/llm-gateway/.../posthog.py→ai_product = <product>Without this, stamphog traces can't be cleanly grouped/filtered alongside the other internal AI products in LLM Analytics.
Changes
One-line addition to
tools/pr-approval-agent/reviewer.py: include"ai_product": "stamphog"in theposthog_propertiesdict that's passed toposthoganalytics.ai.claude_agent_sdk.query. All other stamphog-specific properties (stamphog_pr_number,stamphog_repo, etc.) are unchanged.How did you test this code?
This is an agent-authored change. No new tests — it's a single property addition that flows through the existing SDK integration path added in #53008. Verified locally with
ruff checkandruff format. The property will appear on the next stamphog run after merge.Publish to changelog?
No
🤖 LLM context
Authored by Claude (Opus 4.6) in a Claude Code session. Context: cut posthog-python v7.10.0 release earlier today, merged #53008 to wire stamphog into the SDK integration, and noticed stamphog wasn't using the internal
ai_productconvention for filtering in LLM Analytics. Convention confirmed by greppingee/hogai/andservices/llm-gateway/for existing usages.