This repository was archived by the owner on Jul 27, 2026. It is now read-only.
Repository navigation
feat: emit backend_added PostHog event on user-initiated backend adds - #1548
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
✅ Mock-LLM E2E Tests60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
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
|
🚀 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 a typed
trackBackendAddedhelper touseTrackingand fire abackend_addedevent once after a user successfully adds an additional backend through the add-backend UI (Add Backend modal and Manage Backends "Add"). The two connection columns now pass aconnection_methoddiscriminator ("manual" | "cloud_login") toonConnectedso the event can distinguish OpenHands Cloud login from manual configuration, and the modal threads asourcesurface ("add_backend_modal" | "manage_backends_modal").Properties are coarse and non-sensitive: backend_kind, connection_method, is_openhands_cloud, is_custom_host, has_api_key (boolean), source. No host URL, API key, or token is ever emitted. The event is routed through the existing consent-gated track() wrapper, never posthog.capture() directly.
Editing (updateBackend), removals, and the launcher-seeded default backend (which bypasses addBackend) do not emit. First-backend setup flows (onboarding, public-auth API-key gate) are intentionally excluded: the consent flag is unavailable before a backend exists, so the event would be suppressed there in production.
Tests: unit coverage for the helper contract, plus integration tests that a manual add emits once with the expected properties, that adds from Manage Backends carry source=manage_backends_modal, and that editing emits nothing.
AGENT:
Why
We currently have no telemetry on backend additions. Product wants to measure backend adoption — OpenHands Cloud vs local/custom, which connection flow was used, and basic non-sensitive segmentation — to understand how users connect.
Summary
trackBackendAddedhelper touseTracking(consent-gated; no directposthog.capturefrom components) that emitsbackend_addedwithbackend_kind,connection_method,is_openhands_cloud,is_custom_host,has_api_key, and an optionalsource.manual/cloud_logindiscriminator from the two connection columns and asourcesurface (add_backend_modaldefault,manage_backends_modalfrom Manage Backends).Issue Number
N/A.
How to Test
This change has no UI/visual change; correctness is the emitted analytics event, covered by automated tests that assert the real
posthog.capturecall.Result of (3):
New tests added (all green):
Manual end-to-end verification (in a running app with
VITE_POSTHOG_CLIENT_KEYset and analytics consent enabled):npm run devand open the app with at least one backend already connected.[us.i.posthog.com/e](https://us.i.posthog.com/e)), confirm a singlebackend_addedevent with the expectedconnection_method/backend_kind/is_openhands_cloud/is_custom_host/has_api_key/source: add_backend_modal.source: manage_backends_modal.backend_addedevent is emitted.Type
🐳 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.0a13937ff744b69191971cdc6e5b7a289b6c9dd758c4Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-937ff74Run
All tags pushed for this build
About Multi-Architecture Support
sha-937ff74) is a multi-arch manifest supporting both amd64 and arm64sha-937ff74-amd64) are also available if needed