Skip to content

feat(llma): tag stamphog traces with ai_product property#53598

Merged
andrewm4894 merged 1 commit into
masterfrom
feat/llma-stamphog-ai-product-property
Apr 8, 2026
Merged

feat(llma): tag stamphog traces with ai_product property#53598
andrewm4894 merged 1 commit into
masterfrom
feat/llma-stamphog-ai-product-property

Conversation

@andrewm4894
Copy link
Copy Markdown
Member

Problem

The stamphog PR approval agent now emits LLM Analytics events (since #53008), but its events don't carry the standard ai_product property that PostHog uses internally to identify which product a trace belongs to. Other internal AI products already use this convention:

  • ee/hogai/llm.pyai_product = "posthog_ai"
  • ee/hogai/session_summaries/tracking.pyai_product = "signals"
  • services/llm-gateway/.../posthog.pyai_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 the posthog_properties dict that's passed to posthoganalytics.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 check and ruff 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_product convention for filtering in LLM Analytics. Convention confirmed by grepping ee/hogai/ and services/llm-gateway/ for existing usages.

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.
@andrewm4894 andrewm4894 requested a review from a team as a code owner April 7, 2026 17:36
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team April 7, 2026 17:36
@andrewm4894 andrewm4894 self-assigned this Apr 7, 2026
@andrewm4894 andrewm4894 added the stamphog Request AI review from stamphog label Apr 7, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 7, 2026

Reviews (1): Last reviewed commit: "feat(llma): tag stamphog traces with ai_..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial additive change adding a single analytics property to telemetry. No production risk.

@andrewm4894 andrewm4894 enabled auto-merge (squash) April 7, 2026 17:40
@andrewm4894
Copy link
Copy Markdown
Member Author

@PostHog/team-security 👋 i think this one might need a review from you too following codeowners

@andrewm4894 andrewm4894 merged commit 87eb203 into master Apr 8, 2026
148 checks passed
@andrewm4894 andrewm4894 deleted the feat/llma-stamphog-ai-product-property branch April 8, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI review from stamphog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants