fix: keep PostHog identity stable for Cloud context#1892
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: openhands <openhands@all-hands.dev>
|
Took a careful look since this touches the telemetry boundary. Two things I think are blockers. person_profiles is still identified_only
So I think we stop creating person profiles entirely, not just for Cloud. Anything counting unique users as persons, filtering on person properties, or using cohorts would go empty. Given the PR is about preserving journey continuity that seems unintended, so worth checking with whoever owns the dashboards first. Passing The legacy reset rotates distinct_id and defeats the OAuth bootstrap
The problem is the interaction with First load after deploy, every existing Cloud user gets a new Two smaller ones
Minor: |
Co-authored-by: openhands <openhands@all-hands.dev>
|
Addressed the telemetry review feedback in 2fb71fd:\n\n- switched the Canvas PostHog client to |
Co-authored-by: openhands <openhands@all-hands.dev>
|
Follow-up pushed in da8bdde:\n\n- |
✅ Mock-LLM E2E Tests60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
✅ Mock-LLM Docker E2E Test Results60/60 passed Commit: Details
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
HUMAN:
AGENT:
This PR was created by an AI agent (OpenHands) on behalf of the user.
Verification performed:
npx vitest run __tests__/services/telemetry.test.ts __tests__/hooks/use-telemetry-identity.test.ts— passed, 42 tests.npm run typecheck— passed.npm run build— passed; production app build completed with existing Vite/chunk-size warnings.npx eslint src/services/telemetry.ts src/services/telemetry-context.ts src/hooks/use-telemetry-identity.ts— passed.npx prettier --check src/services/telemetry.ts src/services/telemetry-context.ts src/hooks/use-telemetry-identity.ts __tests__/services/telemetry.test.ts __tests__/hooks/use-telemetry-identity.test.ts— passed.npm test— attempted twice; the full suite exceeded local timeouts after 180s and 360s respectively, with no test failures observed before timeout (second run reached 466/509 test files and 3847 passing tests before timeout).Why
Agent Canvas currently used the Cloud user ID as the PostHog identity. That could change the effective PostHog distinct ID when users switch between local and Cloud backends in the same browser session, making cross-backend journey analysis harder.
Summary
cloud_user_id,cloud_user_email) and clear it for local/loading/no-user states.Issue Number
OSS-5734
How to Test
npm ciif dependencies are not installed.npx vitest run __tests__/services/telemetry.test.ts __tests__/hooks/use-telemetry-identity.test.ts.npm run typecheck.npm run build.cloud_user_id/cloud_user_email, while local events should carry those properties asnull.Video/Screenshots
N/A — telemetry behavior change with no visible UI.
Type
Notes
cloud_user_emailis included because existing telemetry already attachesuser_email; the new property scopes the Cloud email context explicitly to Cloud backend events.@malhotra5 can click here to continue refining the PR
🐳 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.37.0-pythonopenhands-automation==1.2.0d405315720efb37d06b80b49fea71674f9074b23Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-d405315Run
All tags pushed for this build
About Multi-Architecture Support
sha-d405315) is a multi-arch manifest supporting both amd64 and arm64sha-d405315-amd64) are also available if needed