Skip to content

chore(llma): Add PostHog LLM Analytics instrumentation to PR approval agent#52984

Closed
andrewm4894 wants to merge 6 commits into
masterfrom
claude/add-llm-analytics-stamphog-sFBg2
Closed

chore(llma): Add PostHog LLM Analytics instrumentation to PR approval agent#52984
andrewm4894 wants to merge 6 commits into
masterfrom
claude/add-llm-analytics-stamphog-sFBg2

Conversation

@andrewm4894
Copy link
Copy Markdown
Member

Problem

The PR approval agent currently has no observability into LLM performance, costs, and behavior. We need to capture telemetry about reviewer calls and pipeline execution to understand model performance, token usage, and costs in production.

Changes

Added comprehensive LLM Analytics instrumentation using PostHog's standard events:

  • New analytics.py module: Provides TraceRecorder class to capture $ai_generation events (per LLM call) and $ai_trace events (pipeline completion). Uses PostHog's internal project API key by default with opt-out support via OPT_OUT_CAPTURE=1.

  • Updated review_pr.py:

    • Instantiates TraceRecorder in the pipeline orchestrator
    • Populates PR metadata (number, repo, author, tier, lines changed, etc.) after classification
    • Emits trace event on pipeline completion with final verdict and gate results
    • Passes trace recorder to Reviewer for generation-level instrumentation
  • Updated reviewer.py:

    • Accepts optional TraceRecorder in constructor
    • Records each LLM generation with model, tokens, cost, latency, cache metrics, and structured output
    • Captures usage data from Claude Agent SDK's ResultMessage
  • Updated README.md: Documents the LLM Analytics feature, configuration options, and captured events.

  • Updated dependencies: Added posthoganalytics to the script dependencies comment.

All events include custom stamphog_* properties (PR number, author, tier, verdict, etc.) for filtering and analysis in the PostHog dashboard.

How did you test this code?

The implementation follows PostHog's standard LLM Analytics event schema ($ai_generation and $ai_trace). Code review of:

  • Event property mapping and schema compliance
  • Proper token/cost aggregation across generations
  • Graceful handling when analytics is disabled (client=None)
  • Integration points with existing Claude Agent SDK result data

No manual testing performed as this is an agent-authored change. The instrumentation is non-blocking (analytics failures won't affect PR review) and can be validated through PostHog dashboard inspection once deployed.

Publish to changelog?

No

https://claude.ai/code/session_01NCn85Cf1g54u29vQj5W9es

claude added 2 commits April 1, 2026 08:33
Adds PostHog LLM Analytics tracking to the PR approval agent so every
stamphog run is visible in the LLM Analytics dashboard with cost,
token usage, latency, and verdict data.

- New analytics.py module with TraceRecorder that captures $ai_generation
  and $ai_trace events via the posthoganalytics SDK
- Instrument the Reviewer to record generation-level metrics (model,
  tokens, cost, cache metrics, duration, num_turns) from ResultMessage
- Instrument the Pipeline to emit a trace-level event on completion with
  aggregate stats and PR metadata (tier, verdict, gate results)
- Pass STAMPHOG_POSTHOG_API_KEY and STAMPHOG_POSTHOG_HOST secrets in the
  GitHub Actions workflow
- Analytics is a no-op when the API key is not configured

https://claude.ai/code/session_01NCn85Cf1g54u29vQj5W9es
Use the standard internal project API key (sTMFPsFhdP1Ssg) by default
so no new GitHub secrets are needed. Analytics is always on unless
OPT_OUT_CAPTURE=1 is set. The STAMPHOG_POSTHOG_API_KEY env var still
works as an override.

https://claude.ai/code/session_01NCn85Cf1g54u29vQj5W9es
@andrewm4894 andrewm4894 requested a review from a team as a code owner April 1, 2026 08:42
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team April 1, 2026 08:42
@andrewm4894 andrewm4894 changed the title Add PostHog LLM Analytics instrumentation to PR approval agent chore(llma): Add PostHog LLM Analytics instrumentation to PR approval agent Apr 1, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 1, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 139-143

Comment:
**Analytics failures can crash the pipeline or trigger spurious retries**

The PR description says analytics is "non-blocking (analytics failures won't affect PR review)", but the code does not enforce this. `self.client.capture(...)` is called without any error handling.

- In `reviewer.py`, if `record_generation()` raises (e.g. network error, PostHog auth failure), the exception propagates through `asyncio.run(self._review(...))` and is caught by the retry loop in `_llm_review()`, causing the reviewer to be retried unnecessarily — up to 3 times — due to an analytics error, not a review failure.
- In `review_pr.py`, `_emit_trace()` is called directly in `run()` with no try/except. If it raises, the entire pipeline crashes with an unhandled exception.

To actually make analytics non-blocking, both `record_generation` and `record_trace` should swallow exceptions internally:

```python
        try:
            self.client.capture(
                event="$ai_generation",
                distinct_id=DISTINCT_ID,
                properties=properties,
            )
        except Exception:
            pass  # analytics must never break the pipeline
```

The same pattern should be applied to `record_trace` and `flush`.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 15

Comment:
**API key hardcoded in a public repository**

The internal project API key is hardcoded as a string literal in a public open-source repository, and is also documented verbatim in `README.md`. Even if this is a write-only ingest key, committing credentials in source is against best practices — especially in a public repo where any reader can see it.

A `STAMPHOG_POSTHOG_API_KEY` env-var override already exists, so the hardcoded fallback could be removed entirely. The caller would need to supply the key via the environment variable, keeping credentials out of source.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 73-86

Comment:
**`structured_output` parameter is accepted but never used**

The `structured_output: Any = None` parameter is declared in `record_generation`'s signature but is never referenced anywhere in the method body. This is a superfluous part — remove it to keep the interface minimal and avoid confusion about whether the parameter has any effect.

```suggestion
    def record_generation(
        self,
        *,
        model: str,
        input_messages: list[dict[str, str]],
        output_text: str,
        usage: dict[str, Any] | None = None,
        model_usage: dict[str, Any] | None = None,
        duration_ms: int = 0,
        total_cost_usd: float | None = None,
        num_turns: int = 0,
        stop_reason: str | None = None,
    ) -> None:
```

The call site in `reviewer.py` would need to drop the `structured_output=structured_output` keyword argument accordingly.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "chore(llma): use internal PostHog projec..." | Re-trigger Greptile

Comment thread tools/pr-approval-agent/analytics.py Outdated
Comment on lines +139 to +143
self.client.capture(
event="$ai_generation",
distinct_id=DISTINCT_ID,
properties=properties,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Analytics failures can crash the pipeline or trigger spurious retries

The PR description says analytics is "non-blocking (analytics failures won't affect PR review)", but the code does not enforce this. self.client.capture(...) is called without any error handling.

  • In reviewer.py, if record_generation() raises (e.g. network error, PostHog auth failure), the exception propagates through asyncio.run(self._review(...)) and is caught by the retry loop in _llm_review(), causing the reviewer to be retried unnecessarily — up to 3 times — due to an analytics error, not a review failure.
  • In review_pr.py, _emit_trace() is called directly in run() with no try/except. If it raises, the entire pipeline crashes with an unhandled exception.

To actually make analytics non-blocking, both record_generation and record_trace should swallow exceptions internally:

        try:
            self.client.capture(
                event="$ai_generation",
                distinct_id=DISTINCT_ID,
                properties=properties,
            )
        except Exception:
            pass  # analytics must never break the pipeline

The same pattern should be applied to record_trace and flush.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 139-143

Comment:
**Analytics failures can crash the pipeline or trigger spurious retries**

The PR description says analytics is "non-blocking (analytics failures won't affect PR review)", but the code does not enforce this. `self.client.capture(...)` is called without any error handling.

- In `reviewer.py`, if `record_generation()` raises (e.g. network error, PostHog auth failure), the exception propagates through `asyncio.run(self._review(...))` and is caught by the retry loop in `_llm_review()`, causing the reviewer to be retried unnecessarily — up to 3 times — due to an analytics error, not a review failure.
- In `review_pr.py`, `_emit_trace()` is called directly in `run()` with no try/except. If it raises, the entire pipeline crashes with an unhandled exception.

To actually make analytics non-blocking, both `record_generation` and `record_trace` should swallow exceptions internally:

```python
        try:
            self.client.capture(
                event="$ai_generation",
                distinct_id=DISTINCT_ID,
                properties=properties,
            )
        except Exception:
            pass  # analytics must never break the pipeline
```

The same pattern should be applied to `record_trace` and `flush`.

How can I resolve this? If you propose a fix, please make it concise.


from posthoganalytics import Posthog

_INTERNAL_PROJECT_API_KEY = "sTMFPsFhdP1Ssg"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 API key hardcoded in a public repository

The internal project API key is hardcoded as a string literal in a public open-source repository, and is also documented verbatim in README.md. Even if this is a write-only ingest key, committing credentials in source is against best practices — especially in a public repo where any reader can see it.

A STAMPHOG_POSTHOG_API_KEY env-var override already exists, so the hardcoded fallback could be removed entirely. The caller would need to supply the key via the environment variable, keeping credentials out of source.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 15

Comment:
**API key hardcoded in a public repository**

The internal project API key is hardcoded as a string literal in a public open-source repository, and is also documented verbatim in `README.md`. Even if this is a write-only ingest key, committing credentials in source is against best practices — especially in a public repo where any reader can see it.

A `STAMPHOG_POSTHOG_API_KEY` env-var override already exists, so the hardcoded fallback could be removed entirely. The caller would need to supply the key via the environment variable, keeping credentials out of source.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +73 to +86
def record_generation(
self,
*,
model: str,
input_messages: list[dict[str, str]],
output_text: str,
usage: dict[str, Any] | None = None,
model_usage: dict[str, Any] | None = None,
duration_ms: int = 0,
total_cost_usd: float | None = None,
num_turns: int = 0,
stop_reason: str | None = None,
structured_output: Any = None,
) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 structured_output parameter is accepted but never used

The structured_output: Any = None parameter is declared in record_generation's signature but is never referenced anywhere in the method body. This is a superfluous part — remove it to keep the interface minimal and avoid confusion about whether the parameter has any effect.

Suggested change
def record_generation(
self,
*,
model: str,
input_messages: list[dict[str, str]],
output_text: str,
usage: dict[str, Any] | None = None,
model_usage: dict[str, Any] | None = None,
duration_ms: int = 0,
total_cost_usd: float | None = None,
num_turns: int = 0,
stop_reason: str | None = None,
structured_output: Any = None,
) -> None:
def record_generation(
self,
*,
model: str,
input_messages: list[dict[str, str]],
output_text: str,
usage: dict[str, Any] | None = None,
model_usage: dict[str, Any] | None = None,
duration_ms: int = 0,
total_cost_usd: float | None = None,
num_turns: int = 0,
stop_reason: str | None = None,
) -> None:

The call site in reviewer.py would need to drop the structured_output=structured_output keyword argument accordingly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tools/pr-approval-agent/analytics.py
Line: 73-86

Comment:
**`structured_output` parameter is accepted but never used**

The `structured_output: Any = None` parameter is declared in `record_generation`'s signature but is never referenced anywhere in the method body. This is a superfluous part — remove it to keep the interface minimal and avoid confusion about whether the parameter has any effect.

```suggestion
    def record_generation(
        self,
        *,
        model: str,
        input_messages: list[dict[str, str]],
        output_text: str,
        usage: dict[str, Any] | None = None,
        model_usage: dict[str, Any] | None = None,
        duration_ms: int = 0,
        total_cost_usd: float | None = None,
        num_turns: int = 0,
        stop_reason: str | None = None,
    ) -> None:
```

The call site in `reviewer.py` would need to drop the `structured_output=structured_output` keyword argument accordingly.

How can I resolve this? If you propose a fix, please make it concise.

claude added 2 commits April 1, 2026 08:46
Wrap capture/flush calls in try/except so analytics errors never crash
the pipeline or trigger spurious reviewer retries. Remove unused
structured_output parameter from record_generation.

https://claude.ai/code/session_01NCn85Cf1g54u29vQj5W9es
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e81b374ef8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/pr-approval-agent/analytics.py Outdated
Uses the internal PostHog project key by default so no extra secrets
are needed. Set OPT_OUT_CAPTURE=1 to disable.
"""
if os.environ.get("OPT_OUT_CAPTURE"):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check OPT_OUT_CAPTURE value before disabling capture

create_client currently turns analytics off whenever OPT_OUT_CAPTURE is set to any non-empty value, so OPT_OUT_CAPTURE=0 (a common “false” convention used in this repo’s workflows) will still disable telemetry. In environments where that variable is inherited, this silently drops all $ai_generation/$ai_trace events and defeats the instrumentation. Compare against an explicit opt-out value (for example "1") or parse a boolean string instead of relying on truthiness.

Useful? React with 👍 / 👎.

OPT_OUT_CAPTURE=0 or OPT_OUT_CAPTURE=false should not disable
analytics. Check against explicit truthy values (true/yes/1) to
match the convention in posthog/settings/base_variables.py.

https://claude.ai/code/session_01NCn85Cf1g54u29vQj5W9es
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

Size Change: 0 B

Total Size: 127 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/368Hedgehogs 5.26 kB
frontend/dist/abap 14.2 kB
frontend/dist/Action 20.5 kB
frontend/dist/Actions 1.02 kB
frontend/dist/AdvancedActivityLogsScene 33.9 kB
frontend/dist/AgenticAuthorize 5.25 kB
frontend/dist/apex 3.95 kB
frontend/dist/ApprovalDetail 16.2 kB
frontend/dist/array.full.es5.js 326 kB
frontend/dist/array.full.js 421 kB
frontend/dist/array.js 177 kB
frontend/dist/AsyncMigrations 13.1 kB
frontend/dist/AuthorizationStatus 716 B
frontend/dist/azcli 846 B
frontend/dist/bat 1.84 kB
frontend/dist/BatchExportScene 60.3 kB
frontend/dist/bicep 2.55 kB
frontend/dist/Billing 493 B
frontend/dist/BillingSection 20.8 kB
frontend/dist/BoxPlot 4.99 kB
frontend/dist/browserAll-0QZMN1W2 37.4 kB
frontend/dist/ButtonPrimitives 562 B
frontend/dist/CalendarHeatMap 4.79 kB
frontend/dist/cameligo 2.18 kB
frontend/dist/changeRequestsLogic 544 B
frontend/dist/CLIAuthorize 11.3 kB
frontend/dist/CLILive 3.97 kB
frontend/dist/clojure 9.64 kB
frontend/dist/coffee 3.59 kB
frontend/dist/Cohort 23.2 kB
frontend/dist/CohortCalculationHistory 6.22 kB
frontend/dist/Cohorts 9.39 kB
frontend/dist/ConfirmOrganization 4.48 kB
frontend/dist/conversations.js 63.8 kB
frontend/dist/Coupons 720 B
frontend/dist/cpp 5.3 kB
frontend/dist/Create 829 B
frontend/dist/crisp-chat-integration.js 1.88 kB
frontend/dist/csharp 4.52 kB
frontend/dist/csp 1.42 kB
frontend/dist/css 4.51 kB
frontend/dist/cssMode 4.15 kB
frontend/dist/CustomCssScene 3.55 kB
frontend/dist/CustomerAnalyticsConfigurationScene 1.99 kB
frontend/dist/CustomerAnalyticsScene 26.1 kB
frontend/dist/CustomerJourneyBuilderScene 1.6 kB
frontend/dist/CustomerJourneyTemplatesScene 7.39 kB
frontend/dist/customizations.full.js 17.8 kB
frontend/dist/CyclotronJobInputAssignee 1.32 kB
frontend/dist/CyclotronJobInputTicketTags 711 B
frontend/dist/cypher 3.38 kB
frontend/dist/dart 4.25 kB
frontend/dist/Dashboard 1.04 kB
frontend/dist/Dashboards 20 kB
frontend/dist/DataManagementScene 646 B
frontend/dist/DataPipelinesNewScene 2.28 kB
frontend/dist/DataWarehouseScene 1.14 kB
frontend/dist/DataWarehouseSourceScene 634 B
frontend/dist/Deactivated 1.13 kB
frontend/dist/dead-clicks-autocapture.js 13 kB
frontend/dist/DeadLetterQueue 5.38 kB
frontend/dist/DebugScene 20 kB
frontend/dist/decompressionWorker 2.85 kB
frontend/dist/decompressionWorker.js 2.85 kB
frontend/dist/DefinitionEdit 7.11 kB
frontend/dist/DefinitionView 22.7 kB
frontend/dist/DestinationsScene 2.67 kB
frontend/dist/dist 575 B
frontend/dist/dockerfile 1.87 kB
frontend/dist/EarlyAccessFeature 719 B
frontend/dist/EarlyAccessFeatures 2.84 kB
frontend/dist/ecl 5.33 kB
frontend/dist/EditorScene 828 B
frontend/dist/elixir 10.3 kB
frontend/dist/elk.bundled 1.44 MB
frontend/dist/EmailMFAVerify 2.98 kB
frontend/dist/EndpointScene 37.1 kB
frontend/dist/EndpointsScene 21.8 kB
frontend/dist/ErrorTrackingConfigurationScene 2.19 kB
frontend/dist/ErrorTrackingIssueFingerprintsScene 6.98 kB
frontend/dist/ErrorTrackingIssueScene 81.8 kB
frontend/dist/ErrorTrackingScene 12.9 kB
frontend/dist/EvaluationTemplates 575 B
frontend/dist/EventsScene 2.44 kB
frontend/dist/exception-autocapture.js 11.8 kB
frontend/dist/Experiment 246 kB
frontend/dist/Experiments 17.1 kB
frontend/dist/exporter 20.5 MB
frontend/dist/exporter.js 20.5 MB
frontend/dist/ExportsScene 3.86 kB
frontend/dist/FeatureFlag 116 kB
frontend/dist/FeatureFlags 572 B
frontend/dist/FeatureFlagTemplatesScene 7.03 kB
frontend/dist/FlappyHog 5.78 kB
frontend/dist/flow9 1.8 kB
frontend/dist/freemarker2 16.7 kB
frontend/dist/fsharp 2.98 kB
frontend/dist/go 2.65 kB
frontend/dist/graphql 2.26 kB
frontend/dist/Group 14.5 kB
frontend/dist/Groups 3.93 kB
frontend/dist/GroupsNew 7.34 kB
frontend/dist/handlebars 7.34 kB
frontend/dist/hcl 3.59 kB
frontend/dist/HealthCategoryDetailScene 7.23 kB
frontend/dist/HealthScene 10.3 kB
frontend/dist/HeatmapNewScene 4.16 kB
frontend/dist/HeatmapRecordingScene 3.92 kB
frontend/dist/HeatmapScene 6.04 kB
frontend/dist/HeatmapsScene 3.88 kB
frontend/dist/hls 394 kB
frontend/dist/HogFunctionScene 58.8 kB
frontend/dist/HogRepl 7.37 kB
frontend/dist/html 5.58 kB
frontend/dist/htmlMode 4.62 kB
frontend/dist/image-blob-reduce.esm 49.4 kB
frontend/dist/InboxScene 59.1 kB
frontend/dist/index 307 kB
frontend/dist/index.js 307 kB
frontend/dist/ini 1.1 kB
frontend/dist/InsightOptions 5.41 kB
frontend/dist/InsightScene 28 kB
frontend/dist/IntegrationsRedirect 733 B
frontend/dist/intercom-integration.js 1.93 kB
frontend/dist/InviteSignup 14.4 kB
frontend/dist/java 3.22 kB
frontend/dist/javascript 985 B
frontend/dist/jsonMode 13.9 kB
frontend/dist/julia 7.22 kB
frontend/dist/kotlin 3.4 kB
frontend/dist/lazy 150 kB
frontend/dist/LegacyPluginScene 26.6 kB
frontend/dist/LemonTextAreaMarkdown 502 B
frontend/dist/less 3.9 kB
frontend/dist/lexon 2.44 kB
frontend/dist/lib 2.22 kB
frontend/dist/Link 468 B
frontend/dist/LinkScene 24.8 kB
frontend/dist/LinksScene 4.19 kB
frontend/dist/liquid 4.53 kB
frontend/dist/LiveDebugger 19.1 kB
frontend/dist/LiveEventsTable 4.44 kB
frontend/dist/LLMAnalyticsClusterScene 15.7 kB
frontend/dist/LLMAnalyticsClustersScene 43 kB
frontend/dist/LLMAnalyticsDatasetScene 19.7 kB
frontend/dist/LLMAnalyticsDatasetsScene 3.28 kB
frontend/dist/LLMAnalyticsEvaluation 40.5 kB
frontend/dist/LLMAnalyticsEvaluationsScene 29.3 kB
frontend/dist/LLMAnalyticsPlaygroundScene 36.3 kB
frontend/dist/LLMAnalyticsScene 115 kB
frontend/dist/LLMAnalyticsSessionScene 13.4 kB
frontend/dist/LLMAnalyticsTraceScene 127 kB
frontend/dist/LLMAnalyticsUsers 526 B
frontend/dist/LLMASessionFeedbackDisplay 4.83 kB
frontend/dist/LLMPromptScene 20.6 kB
frontend/dist/LLMPromptsScene 4.21 kB
frontend/dist/Login 8.49 kB
frontend/dist/Login2FA 4.2 kB
frontend/dist/logs.js 38.3 kB
frontend/dist/LogsScene 18.7 kB
frontend/dist/lua 2.11 kB
frontend/dist/m3 2.81 kB
frontend/dist/main 819 kB
frontend/dist/ManagedMigration 14 kB
frontend/dist/markdown 3.79 kB
frontend/dist/MarketingAnalyticsScene 24.6 kB
frontend/dist/MaterializedColumns 10.2 kB
frontend/dist/Max 835 B
frontend/dist/mdx 5.39 kB
frontend/dist/MessageTemplate 16.3 kB
frontend/dist/MetricsScene 828 B
frontend/dist/mips 2.58 kB
frontend/dist/ModelsScene 13.6 kB
frontend/dist/MonacoDiffEditor 403 B
frontend/dist/monacoEditorWorker 288 kB
frontend/dist/monacoEditorWorker.js 288 kB
frontend/dist/monacoJsonWorker 419 kB
frontend/dist/monacoJsonWorker.js 419 kB
frontend/dist/monacoTsWorker 7.02 MB
frontend/dist/monacoTsWorker.js 7.02 MB
frontend/dist/MoveToPostHogCloud 4.46 kB
frontend/dist/msdax 4.91 kB
frontend/dist/mysql 11.3 kB
frontend/dist/NavTabChat 4.63 kB
frontend/dist/NewSourceWizard 724 B
frontend/dist/NewTabScene 681 B
frontend/dist/NodeDetailScene 15.5 kB
frontend/dist/NotebookCanvasScene 3.06 kB
frontend/dist/NotebookPanel 5.08 kB
frontend/dist/NotebookScene 8.07 kB
frontend/dist/NotebooksScene 7.58 kB
frontend/dist/OAuthAuthorize 573 B
frontend/dist/objective-c 2.41 kB
frontend/dist/Onboarding 683 kB
frontend/dist/OnboardingCouponRedemption 1.2 kB
frontend/dist/pascal 2.99 kB
frontend/dist/pascaligo 2 kB
frontend/dist/passkeyLogic 484 B
frontend/dist/PasswordReset 4.32 kB
frontend/dist/PasswordResetComplete 2.94 kB
frontend/dist/perl 8.25 kB
frontend/dist/PersonScene 16 kB
frontend/dist/PersonsScene 4.73 kB
frontend/dist/pgsql 13.5 kB
frontend/dist/php 8.02 kB
frontend/dist/PipelineStatusScene 6.22 kB
frontend/dist/pla 1.67 kB
frontend/dist/posthog 250 kB
frontend/dist/postiats 7.86 kB
frontend/dist/powerquery 16.9 kB
frontend/dist/powershell 3.27 kB
frontend/dist/PreflightCheck 5.53 kB
frontend/dist/product-tours.js 115 kB
frontend/dist/ProductTour 274 kB
frontend/dist/ProductTours 4.7 kB
frontend/dist/ProjectHomepage 24.8 kB
frontend/dist/protobuf 9.05 kB
frontend/dist/pug 4.82 kB
frontend/dist/python 4.76 kB
frontend/dist/qsharp 3.19 kB
frontend/dist/r 3.12 kB
frontend/dist/razor 9.35 kB
frontend/dist/recorder-v2.js 111 kB
frontend/dist/recorder.js 111 kB
frontend/dist/redis 3.55 kB
frontend/dist/redshift 11.8 kB
frontend/dist/RegionMap 29.4 kB
frontend/dist/render-query 20.2 MB
frontend/dist/render-query.js 20.2 MB
frontend/dist/ResourceTransfer 9.17 kB
frontend/dist/restructuredtext 3.9 kB
frontend/dist/RevenueAnalyticsScene 25.6 kB
frontend/dist/ruby 8.5 kB
frontend/dist/rust 4.16 kB
frontend/dist/SavedInsights 664 B
frontend/dist/sb 1.82 kB
frontend/dist/scala 7.32 kB
frontend/dist/scheme 1.76 kB
frontend/dist/scss 6.41 kB
frontend/dist/SdkDoctorScene 9.42 kB
frontend/dist/SessionAttributionExplorerScene 6.6 kB
frontend/dist/SessionGroupSummariesTable 4.62 kB
frontend/dist/SessionGroupSummaryScene 17 kB
frontend/dist/SessionProfileScene 15.8 kB
frontend/dist/SessionRecordingDetail 1.73 kB
frontend/dist/SessionRecordingFilePlaybackScene 4.46 kB
frontend/dist/SessionRecordings 742 B
frontend/dist/SessionRecordingsKiosk 8.84 kB
frontend/dist/SessionRecordingsPlaylistScene 4.1 kB
frontend/dist/SessionRecordingsSettingsScene 1.9 kB
frontend/dist/SessionsScene 3.86 kB
frontend/dist/SettingsScene 2.98 kB
frontend/dist/SharedMetric 15.7 kB
frontend/dist/SharedMetrics 549 B
frontend/dist/shell 3.07 kB
frontend/dist/SignupContainer 24.5 kB
frontend/dist/Site 1.18 kB
frontend/dist/solidity 18.6 kB
frontend/dist/sophia 2.76 kB
frontend/dist/SourcesScene 5.96 kB
frontend/dist/sourceWizardLogic 662 B
frontend/dist/sparql 2.55 kB
frontend/dist/sql 10.3 kB
frontend/dist/SqlVariableEditScene 7.24 kB
frontend/dist/st 7.4 kB
frontend/dist/StartupProgram 21.2 kB
frontend/dist/SupportSettingsScene 40.7 kB
frontend/dist/SupportTicketScene 23 kB
frontend/dist/SupportTicketsScene 733 B
frontend/dist/Survey 746 B
frontend/dist/SurveyFormBuilder 1.54 kB
frontend/dist/Surveys 18.2 kB
frontend/dist/surveys.js 89.8 kB
frontend/dist/SurveyWizard 57.6 kB
frontend/dist/swift 5.26 kB
frontend/dist/SystemStatus 16.8 kB
frontend/dist/systemverilog 7.61 kB
frontend/dist/TaskDetailScene 19.6 kB
frontend/dist/TaskTracker 13.2 kB
frontend/dist/tcl 3.57 kB
frontend/dist/TextCardMarkdownEditor 11 kB
frontend/dist/toolbar 10 MB
frontend/dist/toolbar.js 10 MB
frontend/dist/ToolbarLaunch 2.52 kB
frontend/dist/tracing-headers.js 1.74 kB
frontend/dist/TracingScene 14.7 kB
frontend/dist/TransformationsScene 1.91 kB
frontend/dist/tsMode 24 kB
frontend/dist/twig 5.97 kB
frontend/dist/TwoFactorReset 3.98 kB
frontend/dist/typescript 240 B
frontend/dist/typespec 2.82 kB
frontend/dist/Unsubscribe 1.62 kB
frontend/dist/UserInterview 4.53 kB
frontend/dist/UserInterviews 2.01 kB
frontend/dist/vb 5.79 kB
frontend/dist/VercelConnect 4.95 kB
frontend/dist/VercelLinkError 1.91 kB
frontend/dist/VerifyEmail 4.48 kB
frontend/dist/vimMode 211 kB
frontend/dist/VisualReviewRunScene 18.6 kB
frontend/dist/VisualReviewRunsScene 6.16 kB
frontend/dist/VisualReviewSettingsScene 10.6 kB
frontend/dist/web-vitals.js 6.39 kB
frontend/dist/WebAnalyticsScene 5.7 kB
frontend/dist/WebGLRenderer-DYjOwNoG 60.3 kB
frontend/dist/WebGPURenderer-B_wkl_Ja 36.3 kB
frontend/dist/WebScriptsScene 2.54 kB
frontend/dist/webworkerAll-puPV1rBA 324 B
frontend/dist/wgsl 7.34 kB
frontend/dist/Wizard 4.45 kB
frontend/dist/WorkflowScene 101 kB
frontend/dist/WorkflowsScene 46.9 kB
frontend/dist/WorldMap 4.73 kB
frontend/dist/xml 2.98 kB
frontend/dist/yaml 4.6 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

Storybook visual regression tests failed

If your changes intentionally update UI snapshots: add the update-snapshots label, then re-run the workflow. Snapshots will be auto-committed.

If you didn't change any UI: this is likely a flaky snapshot — wait for a fix to land on master.

Copy link
Copy Markdown
Contributor

@webjunkie webjunkie left a comment

Choose a reason for hiding this comment

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

Some of the bot reviews seem worth looking into.

Copy link
Copy Markdown
Member Author

All four bot review comments have been addressed:

  1. P1: Analytics failures can crash the pipeline (Greptile) — Fixed in 12a7cdf1. All capture()/flush() calls are now wrapped in try/except Exception: pass.

  2. P1: API key hardcoded (Greptile) — Intentional, no change. sTMFPsFhdP1Ssg is a write-only ingest key already hardcoded in posthog/settings/web.py — standard practice for PostHog self-analytics.

  3. P2: Unused structured_output parameter (Greptile) — Fixed in 12a7cdf1. Removed from both the signature and the call site in reviewer.py.

  4. P2: OPT_OUT_CAPTURE boolean parsing (Codex) — Fixed in 26b5b5f6. Now checks against explicit truthy values ("true", "yes", "1") instead of raw truthiness, matching the str_to_bool convention in posthog/settings/base_variables.py.


Generated by Claude Code

@andrewm4894
Copy link
Copy Markdown
Member Author

Closing in favor of a cleaner approach. Instead of hand-rolling analytics in stamphog, we built a proper PostHog SDK integration for the Claude Agent SDK:

Once posthog-python#477 is released, #53008 will light up stamphog analytics automatically — no custom analytics module needed.

@andrewm4894 andrewm4894 closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants