This repository was archived by the owner on Jul 27, 2026. It is now read-only.
Repository navigation
feat: instrument PostHog events for automation lifecycle - #1549
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tofarr
approved these changes
Jun 30, 2026
Contributor
✅ Mock-LLM Docker E2E Test Results60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Contributor
✅ Mock-LLM E2E Tests60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Contributor
|
🚀 Released in v1.2.0. |
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
HUMAN:
Add application-level PostHog analytics for the Automation lifecycle to support redefining the activation funnel. All events go through the existing consent-gated useTracking hook; payloads carry only backend_kind (local vs cloud/OHE) — no ids, names, prompts, or schedules.
Events:
The existing toggle-ON tracking (prebuilt_automation_enabled) is left untouched, so there is no double-count and no behavior change. Each event fires exactly once: created on the click handler, the rest in mutation onSuccess (retries resolve before success; rerenders/remounts never refire).
Adds five typed helpers to use-tracking.ts (reusing the BackendKind type) and tests covering each event plus the deactivate enable/disable guard.
AGENT:
Why
We need granular Automation lifecycle data to redefine the product activation funnel. Automation Created is expected to become a high-value activation event and may eventually replace the "5+ conversations" metric. Until now, the only automation analytics was
prebuilt_automation_enabled; create / execute / delete / deactivate were untracked.Summary
useTracking(automation_created,automation_executed,automation_deleted,automation_deactivated,automation_edited), each emitting onlybackend_kind(local|cloud).automation_createdto the create-launch CTA and the other four to the respective automation mutationonSuccesshandlers (deactivated guarded onenabled === false); existing toggle-ON tracking is untouched.useTrackingwith the PostHog service mocked.Issue Number
N/A.
How to Test
npm installnpx vitest run __tests__/components/automations/create-instructions.test.tsx __tests__/hooks/query/use-automations-backend-switch.test.tsxnpm run lintto confirm typecheck + eslint + prettier pass.posthog.captureper action with the correct event name and abackend_kindproperty (PostHog debug or the[us.i.posthog.com/e](https://us.i.posthog.com/e)request). With consent withheld or no key configured, confirm no events are captured.Type
Notes
track()).backend_kind— no ids, names, prompts, or schedules — to keep analytics free of sensitive data.automation_createdfires at creation intent (the create-launch CTA), because there is no client-side create API; this matches the existingprebuilt_automation_enabledconvention. Follow-up: if a server-confirmed "created" signal is later required, it can be added without changing these helpers.Changed files
src/hooks/use-tracking.tsBackendKindimport, returnssrc/components/features/automations/create-instructions.tsxautomation_createdat CTAsrc/hooks/query/use-automations.tsonSuccess__tests__/components/automations/create-instructions.test.tsx__tests__/hooks/query/use-automations-backend-switch.test.tsx🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.29.3-pythonopenhands-automation==1.0.0a13ec5258c8bf5e7744105b4aa918c52e78dcc1ddd4Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-ec5258cRun
All tags pushed for this build
About Multi-Architecture Support
sha-ec5258c) is a multi-arch manifest supporting both amd64 and arm64sha-ec5258c-amd64) are also available if needed