:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore: rename PostHog Code to PostHog Desktop (#72752)
Georges-Antoine Assib6df0c0ff417
diff --git a/.agents/skills/adding-inbox-sources/SKILL.md b/.agents/skills/adding-inbox-sources/SKILL.mdindex a0631d9f12fd..0238a9a25a48 100644--- a/.agents/skills/adding-inbox-sources/SKILL.md+++ b/.agents/skills/adding-inbox-sources/SKILL.md@@ -1,6 +1,6 @@---name: adding-inbox-sources-description: Add a new warehouse-backed source to the PostHog Code Self-driving Inbox (the feature that ships GitHub, Linear, Zendesk, pganalyze, Jira). A source syncs one warehouse table (issues/tickets/conversations) and a cloud "signals scout" watches it and emits findings. Use when asked to "add a new inbox/self-driving source", "wire up <Jira/GitLab/Sentry/Intercom/Freshdesk/Front/Gorgias/etc> as a signal source", or to extend the source-toggle grid. Covers all three surfaces (posthog/posthog scout emitter + posthog/code UI wiring + the context-mill self-driving wizard skill that offers the source in `npx @posthog/wizard self-driving`), the deploy ordering between them, and created_via attribution.+description: Add a new warehouse-backed source to the PostHog Desktop Self-driving Inbox (the feature that ships GitHub, Linear, Zendesk, pganalyze, Jira). A source syncs one warehouse table (issues/tickets/conversations) and a cloud "signals scout" watches it and emits findings. Use when asked to "add a new inbox/self-driving source", "wire up <Jira/GitLab/Sentry/Intercom/Freshdesk/Front/Gorgias/etc> as a signal source", or to extend the source-toggle grid. Covers all three surfaces (posthog/posthog scout emitter + posthog/code UI wiring + the context-mill self-driving wizard skill that offers the source in `npx @posthog/wizard self-driving`), the deploy ordering between them, and created_via attribution.---# Adding a Self-driving Inbox source@@ -211,7 +211,7 @@ value `mcp` is upgraded based on the caller:| Caller | Transport | `created_via` || -------------------------------------------- | -------------------------- | -------------- |-| PostHog Code app inbox (`posthog/code`) | `EventSource.POSTHOG_CODE` | `self_driving` |+| PostHog Desktop app inbox (`posthog/code`) | `EventSource.POSTHOG_CODE` | `self_driving` || `npx @posthog/wizard` (self-driving program) | `EventSource.WIZARD` | `self_driving` || Other MCP clients | `EventSource.MCP` | `mcp` |diff --git a/.agents/skills/writing-skills/SKILL.md b/.agents/skills/writing-skills/SKILL.mdindex 19ac7c811a6a..24ac57191f23 100644--- a/.agents/skills/writing-skills/SKILL.md+++ b/.agents/skills/writing-skills/SKILL.md@@ -21,7 +21,7 @@ hogli lint:skills# 4. Build to verifyhogli build:skills-# 5. Test locally with PostHog Code or a coding agent+# 5. Test locally with PostHog Desktop or a coding agenthogli sync:skill -- --name <skill-name># 6. Delete the test skill (optional)diff --git a/.env.example b/.env.exampleindex 1b24175d6775..320c668fd48a 100644--- a/.env.example+++ b/.env.example@@ -8,7 +8,7 @@ OIDC_RSA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFA# RS256 private key for sandbox JWT authentication (public key is derived from this)SANDBOX_JWT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDMAaMESiOX8PDM\nozOHunt1s+zp78nmLnHs6IvOoKS4rQXFVV2/ouTivIfLRMRDe2TAybsYK0yfAJeK\nFxW7O+MD/vjCMS7kJtOjskQIl3wQTjz/T4fwHkFpiqVHLWczeO5LdvaJBZ4FUYdc\nLaV+9T+4wEavJa5G/Ggl+9eWee/TuThN21wMuAQb7WZhWKqDVm8WfmZpvOXJJ/U1\nkg+8GVg7eMTs6GV0MI7YYwzEHRn3PUQrQmc+q6gROwHU7pEv8DdOLjDH5iYZL/4k\ndnW1KGO/Hqf7vzKEMN23YjL6bC4FDRfM5z/4nQUEjvXihzZ1yK6yChwEd7Ma/PUG\nIh6Pm5azAgMBAAECggEAE/nlDeUkmcWMuWe8WAIOrMvdhbARQ7+F2v46Z7/wi+ow\nB86qy2UWpzfGzu9WOIq7UZVvWJfaJ4erTxOg8SCVbi1oC7vn14y7FJW+y7M/AWm9\nLKg2VhuK/twGAHOVs23tXOkH4wrwb5ziyvKSo109zB19I7wQ1f/z7XmSTA3Mn3Kf\n6GecR6di+LuDUNeEPwuP061EnUUsSYZY/QnhUNHfAyWaO4Ezc4bdl8w2q3O1ElBo\ndaYx9ht9aw8bTjIAS6QUdnh3OPXrQ/E7+2RaEh6NFFuXsh93aGSXKB6ZgURk0wIc\nBtNGA5Sxur8nwMfYT+6Z8fi7wMGuGtKISNK+DXCVwQKBgQD+nG92xjZebauJaYOn\nK7cDgWza9zwG6nDv13vRPS+D9wlJP3eUH1O+vZsar9UdTrXGh51oBskc4giOK9aL\nOvp9SjfrRx9KbkLLTzcS+r0XIYog0TO0onswaJ+ybwuvXU6zx+GjoKmPFDYrsjC5\n/3AkBPgEhorM4bZ1plfsFMzbaQKBgQDNHogqPPIXSco9ESTA6b3IeyzEGVcODDFq\nZgEIuFZJ70FCgg+TfxvZyQKfEGjxg6nLKQswaAQ7Pt3yMvYmEiVTrxaLBIjG9Lu8\nTWOMmJDiA7rgFVsU5ENI6UH8Nv8FkS5JSAPgC8hFnLKvs/9RjCTET3UCGoK5ymdM\nO1c/L0epuwKBgDYLUKGeizXaA5pEWlymq89Drq5/4i75noVacP7GBQr26fKxVRmM\n2MLZDk5I2mzBI1aDvMazAgdudzBuX7joCPmFQn9fdmXfJ7BuHRubO33ocaBrp5UF\nFC7/Vj6S0aEkpisFF4Ea/kLPoHv/89XXQZ9zqo2TXW0F0CwC5hDHjYBZAoGAG4IN\ntsRnnxHpSllDOY/fQMSsEzxmvV6LPf6iAt5dzBqHAPlaR2iTfpiDfnt/52vF2JYP\nhxVcA+oBb9q/wglK8jcX6drY0P2/M5iZUiCfxX/EjwquJVYbY+rMS5vAhambsH40\n7tYFrLhACmo0QmZuA9m4EmklwO7Q/ZszryiTDsMCgYBUUMWlQfuTN8m+D/Eo614J\neRYx8/YcaQpASOzy74woAZyHGLjuu5eW9wclkdhklHGh6KyQ5B6JUXlQsbZxLbBb\n9oW6Jg+UvL0KKLqHoNmNitiAUGONrVpxLjrKUUrUfDD+sWsxQpzcOgBqalTZ2g30\nN6ctjTLJp5PqIIE9tZB9PQ==\n-----END PRIVATE KEY-----"-# Point this to your PostHog Code monorepo root to use the local version of your @posthog/agent package instead of the published version. This is useful for testing changes to the agent package locally without needing to publish a new version.+# Point this to your PostHog Desktop monorepo root to use the local version of your @posthog/agent package instead of the published version. This is useful for testing changes to the agent package locally without needing to publish a new version.LOCAL_POSTHOG_CODE_MONOREPO_ROOT=/path/to/posthog-code# Sandbox provider (you can choose between "docker" or "modal")diff --git a/.flox/env/on-activate.sh b/.flox/env/on-activate.shindex f40e8ee15c4b..b8f2828c867d 100755--- a/.flox/env/on-activate.sh+++ b/.flox/env/on-activate.sh@@ -204,7 +204,7 @@ warn_step() {}# ── Interactive mode detection ────────────────────────────────────-# Skip all interactive prompts in non-interactive terminals or when running under PostHog Code (automated agent).+# Skip all interactive prompts in non-interactive terminals or when running under PostHog Desktop (automated agent)._interactive=falseif [[ -t 0 ]] && [[ -z "${POSTHOG_CODE:-}" ]]; then_interactive=truediff --git a/.test_durations b/.test_durationsindex 970a44ada5bd..52a62e3baac1 100644--- a/.test_durations+++ b/.test_durations@@ -31081,9 +31081,9 @@"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[bingbot-Bingbot-search_crawler-Bot]": 0.01,"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[cloud\\\\.hog\\\\.dev-PostHog Code Cloud-ai_assistant-AI Agent]": 0.01,"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[curl/-curl-http_client-Automation]": 0.01,- "posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[desktop\\\\.hog\\\\.dev-PostHog Code Desktop-ai_assistant-AI Agent]": 0.01,+ "posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[desktop\\\\.hog\\\\.dev-PostHog Desktop-ai_assistant-AI Agent]": 0.01,"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[facebookexternalhit-Facebook-social_crawler-Bot]": 0.01,- "posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[mobile\\\\.hog\\\\.dev-PostHog Code Mobile-ai_assistant-AI Agent]": 0.01,+ "posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[mobile\\\\.hog\\\\.dev-PostHog Mobile-ai_assistant-AI Agent]": 0.01,"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[omgili-Webz.io-ai_crawler-AI Agent]": 0.01,"posthog/hogql_queries/web_analytics/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_traffic_types_are_valid": 0.01,"posthog/hogql_queries/web_analytics/test/test_events_prefilter.py::TestEventsPrefilterTransformer::test_avg_time_query_wraps_from_events": 1.2919762279999532,@@ -119992,10 +119992,10 @@"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[bingbot-Bingbot-search_crawler-Bot]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[cloud\\\\.hog\\\\.dev-PostHog Code Cloud-ai_assistant-AI Agent]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[curl/-curl-http_client-Automation]": 0.01,- "products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[desktop\\\\.hog\\\\.dev-PostHog Code Desktop-ai_assistant-AI Agent]": 0.01,+ "products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[desktop\\\\.hog\\\\.dev-PostHog Desktop-ai_assistant-AI Agent]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[facebookexternalhit-Facebook-social_crawler-Bot]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[httpx-httpx-http_client-Automation]": 0.01,- "products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[mobile\\\\.hog\\\\.dev-PostHog Code Mobile-ai_assistant-AI Agent]": 0.01,+ "products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[mobile\\\\.hog\\\\.dev-PostHog Mobile-ai_assistant-AI Agent]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_specific_bot_definitions[omgili-Webz.io-ai_crawler-AI Agent]": 0.01,"products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py::TestBotDefinitionsDataStructure::test_traffic_types_are_valid": 0.01,"products/web_analytics/backend/hogql_queries/test/test_events_prefilter.py::TestEventsPrefilterTransformer::test_avg_time_query_wraps_from_events": 0.2605874410000979,diff --git a/README.md b/README.mdindex 8e59b3491028..ae565ea2c921 100644--- a/README.md+++ b/README.md@@ -37,7 +37,7 @@- [AI observability](https://posthog.com/docs/ai-observability): Capture traces, generations, latency, and cost for your LLM-powered app.- [Workflows](https://posthog.com/docs/workflows): Create workflows that automate actions or send messages to your users.-You can steer it all from [Slack](https://posthog.com/slack), [web](https://posthog.com/ai), desktop ([PostHog Code](https://posthog.com/code)), or your own editor via [the MCP](https://posthog.com/mcp).+You can steer it all from [Slack](https://posthog.com/slack), [web](https://posthog.com/ai), desktop ([PostHog Desktop](https://posthog.com/code)), or your own editor via [the MCP](https://posthog.com/mcp).Best of all, all of this is free to use with a [generous monthly free tier](https://posthog.com/pricing) for each tool. Get started by signing up for [PostHog Cloud US](https://us.posthog.com/signup) or [PostHog Cloud EU](https://eu.posthog.com/signup).diff --git a/bin/dev-open-when-ready b/bin/dev-open-when-readyindex 253a08904319..04f8465082f0 100755--- a/bin/dev-open-when-ready+++ b/bin/dev-open-when-ready@@ -12,7 +12,7 @@## Usage: bin/dev-open-when-ready <url> # e.g. http://localhost:6006#-# No-op (exit 0) in CI / under PostHog Code, or when no opener is available.+# No-op (exit 0) in CI / under PostHog Desktop, or when no opener is available.set -euo pipefaildiff --git a/docs/internal/dev-env-vars.md b/docs/internal/dev-env-vars.mdindex 98c8aeb0925c..e502249c60cc 100644--- a/docs/internal/dev-env-vars.md+++ b/docs/internal/dev-env-vars.md@@ -45,4 +45,4 @@ Code that branches on the literal region (`get_instance_region()`, `region == "U`COMPACT_IN_REGION` controls which Cloud region registers the daily AI checkpoint compaction schedule. It defaults to `US`; set it explicitly only when moving the rollout to another region.-See also [sandboxes-setup-guide.md](sandboxes-setup-guide.md) for the PostHog Code sandbox providers.+See also [sandboxes-setup-guide.md](sandboxes-setup-guide.md) for the PostHog Desktop sandbox providers.diff --git a/docs/internal/sandboxes-setup-guide.md b/docs/internal/sandboxes-setup-guide.mdindex 602c5c7b2a42..78bc024c1bc3 100644--- a/docs/internal/sandboxes-setup-guide.md+++ b/docs/internal/sandboxes-setup-guide.md@@ -98,7 +98,7 @@ The activities live in## Running via the UIThis is very minimal at the moment, but the tasks page can be used to see what-is happening with a background cloud run and for debugging. You can also use PostHog Code to do this rather than the debug UI.+is happening with a background cloud run and for debugging. You can also use PostHog Desktop to do this rather than the debug UI.1. Navigate to Tasks in PostHog (requires the `tasks` feature flag) by visiting `/tasks` (it will not show up in the sidebar)2. Create a task with a title, description, and repository (format: `owner/repo`)@@ -321,4 +321,4 @@ cd /path/to/posthog-code/packages/agent && pnpm build| Sandbox can't reach PostHog API | Don't set `SANDBOX_API_URL` with Docker — auto-transform handles it. If overriding, use port 8000, not 8010 (Caddy returns empty responses from inside Docker) || `DEBUG` not set | `SANDBOX_PROVIDER=docker` requires `DEBUG=1`. Re-run `python manage.py setup_background_agents` to write it || `... sandbox is for local development only` (RuntimeError at import) | The `docker` / `MODAL_DOCKER` providers require `DEBUG=1` (or `TEST=1`, which pytest sets). `DEBUG=1` is normally injected by the flox env (`.flox/env/manifest.toml` `[vars]`) — this fires when you're outside `flox activate` or explicitly unset `DEBUG` (e.g. to escape the cloud-DEBUG guard). Keep `DEBUG` on and use `CLOUD_DEPLOYMENT=E2E` for cloud-mode dev instead. See [dev-env-vars.md](dev-env-vars.md) |-| `git commit is disabled in PostHog Code` | A PATH shim (`git-guard.sh` at `/opt/posthog/bin/git`) blocks `git commit` and `git push` so unsigned commits can't leave the sandbox. Stage changes with `git add`, then use the `git_signed_commit` tool. To bypass during debugging, set `POSTHOG_ALLOW_UNSIGNED_GIT=1` |+| `git commit is disabled in PostHog Desktop` | A PATH shim (`git-guard.sh` at `/opt/posthog/bin/git`) blocks `git commit` and `git push` so unsigned commits can't leave the sandbox. Stage changes with `git add`, then use the `git_signed_commit` tool. To bypass during debugging, set `POSTHOG_ALLOW_UNSIGNED_GIT=1` |diff --git a/docs/internal/slack-local-setup-guide.md b/docs/internal/slack-local-setup-guide.mdindex 7f38ba9a8e66..ec31ce327430 100644--- a/docs/internal/slack-local-setup-guide.md+++ b/docs/internal/slack-local-setup-guide.md@@ -1,6 +1,6 @@# Slack local setup guide-How to point a real Slack workspace at your local PostHog so you can test the **PostHog Code**+How to point a real Slack workspace at your local PostHog so you can test the **PostHog Desktop**coding agent (`@PostHog <task>` → sandbox run) end to end. The same tunnel + workspace works forthe other Slack integrations too, but this guide only documents what we verified.@@ -8,7 +8,7 @@ Slack is SaaS-only: there's no self-hosted Slack. So "local testing" means a rea(throwaway) Slack workspace + app whose webhooks and OAuth callback reach your laptopthrough a tunnel. This guide captures a setup that has been verified end to end.-> Prerequisite: the PostHog Code stack must already work locally — GitHub App, temporal+> Prerequisite: the PostHog Desktop stack must already work locally — GitHub App, temporal> worker, sandboxes. If you haven't done that yet, follow> [sandboxes-setup-guide.md](./sandboxes-setup-guide.md) first and come back here.@@ -148,7 +148,7 @@ Django must be up at that moment.## Step 3 — backend credentials and `SITE_URL`-PostHog Code reuses the regular Slack notifications app, so set the standard+PostHog Desktop reuses the regular Slack notifications app, so set the standard`SLACK_APP_*` credentials in `.env` and restart the `django` +`temporal-django-worker` processes so it reloads. These are dynamic settingsseeded from the env on boot (`posthog/settings/dynamic_settings.py`):@@ -199,9 +199,9 @@ connected, `@PostHog` events reach the agent unconditionally.## Step 5 — connect the integrations-**Slack.** PostHog Code piggybacks on the regular Slack notifications install — there's no-separate "PostHog Code Slack" install anymore. Go to **Settings → Project → Integrations**,-find Slack, click **Connect to Slack**, and authorize in your dev workspace. The PostHog Code+**Slack.** PostHog Desktop piggybacks on the regular Slack notifications install — there's no+separate "PostHog Desktop Slack" install anymore. Go to **Settings → Project → Integrations**,+find Slack, click **Connect to Slack**, and authorize in your dev workspace. The PostHog Desktopagent reads the same `Integration` row that the notifications product writes. Verify:```bashdiff --git a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md b/docs/published/handbook/engineering/ai/implementing-mcp-tools.mdindex fcf11d329288..e4263579be17 100644--- a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md+++ b/docs/published/handbook/engineering/ai/implementing-mcp-tools.md@@ -74,7 +74,7 @@ which unlocks flexibility in data retrieval, search, and manipulation.Additionally, the consumer has access to a skill that provides schema references and example patterns,giving it richer context about PostHog's data model.-Primarily oriented toward coding agents (PostHog Code, PostHog AI, Claude Code).+Primarily oriented toward coding agents (PostHog Desktop, PostHog AI, Claude Code).## SQL-first MCP: HogQL system tablesdiff --git a/docs/published/handbook/engineering/ai/sandboxed-agents.md b/docs/published/handbook/engineering/ai/sandboxed-agents.mdindex 3b31d17d966e..8832ebaeeff6 100644--- a/docs/published/handbook/engineering/ai/sandboxed-agents.md+++ b/docs/published/handbook/engineering/ai/sandboxed-agents.md@@ -243,7 +243,7 @@ Direct `git commit` and `git push` commands are blocked in the sandbox to ensureIf an agent attempts to run `git commit` or `git push`, it will see:```text-git commit is disabled in PostHog Code: commits must be signed.+git commit is disabled in PostHog Desktop: commits must be signed.To commit: stage changes with 'git add', then call the git_signed_commit tool.To force-push after a rebase/conflict fix: call the git_signed_rewrite tool.```@@ -328,7 +328,7 @@ Domain restrictions are enforced at the syscall level by `agentsh` via ptracethe agent cannot bypass them through proxy settings or DNS tricks.Environments can also be managed via the REST API (`SandboxEnvironmentViewSet`)-or the PostHog Code settings UI.+or the PostHog Desktop settings UI.### Custom base images@@ -337,12 +337,12 @@ and select it as a cloud environment's base via `SandboxEnvironment.custom_imageCustom images always layer on top of the published VM sandbox base —agent tooling, git guard, and the VM runtime are always present —and the whole mechanism is gated on the Modal VM runtime being available:-the `sandbox_custom_images` API returns 403 (and the PostHog Code UI hides the feature)+the `sandbox_custom_images` API returns 403 (and the PostHog Desktop UI hides the feature)unless the `tasks-modal-vm-sandbox` flag is enabled for the orgwith `user_created` in its `origin_products` payload allowlist,since custom-image sandboxes cannot run under gVisor.-The flow, driven from the PostHog Code Environments → Cloud tab:+The flow, driven from the PostHog Desktop Environments → Cloud tab:1. Creating an image spawns an interactive **image-builder agent task**(`custom_image_builder_id` in the run state, VM runtime forced)diff --git a/docs/published/handbook/engineering/ai/writing-skills.md b/docs/published/handbook/engineering/ai/writing-skills.mdindex 8079e8b9d54a..f1b9a0d27c34 100644--- a/docs/published/handbook/engineering/ai/writing-skills.md+++ b/docs/published/handbook/engineering/ai/writing-skills.md@@ -30,7 +30,7 @@ hogli lint:skills# 4. Build locally to verify rendered outputhogli build:skills-# 5. Test locally with PostHog Code or a coding agent+# 5. Test locally with PostHog Desktop or a coding agenthogli sync:skill -- --name <skill-name># 6. Delete the test skill (optional)@@ -59,7 +59,7 @@ but need guidance on _which_ tools to use, in _what order_, with _what constrainThe decision flow:-1. **Ask PostHog Code or Claude Code to do X.** If it works on its own, you don't need a skill.+1. **Ask PostHog Desktop or Claude Code to do X.** If it works on its own, you don't need a skill.2. **If it can't do X, fix the tool prompts first.**Tool names, descriptions, and schemas are the cheapest lever — most "the agent doesn't know how to do X" problems are really "the tool description doesn't explain how to do X."See [Adding tools to the MCP server](/handbook/engineering/ai/implementing-mcp-tools).@@ -378,10 +378,10 @@ CI builds the `dist/skills.zip` artifact and publishes it to two downstream repoany agent that follows Anthropic's skills layout (Claude Code, Claude Desktop, etc.).- [`PostHog/ai-plugin`](https://github.com/PostHog/ai-plugin) –the plugin distribution used by coding agents that consume PostHog capabilities- (PostHog Code, PostHog AI). The plugin bundles the skills alongside the MCP tool definitions+ (PostHog Desktop, PostHog AI). The plugin bundles the skills alongside the MCP tool definitionsso agents get the "how" and the "what" together.-PostHog Code already consumes skills automatically, and PostHog AI consumes the same set.+PostHog Desktop already consumes skills automatically, and PostHog AI consumes the same set.Because both repositories are updated from the same `dist/skills.zip` on every merge to `master`,you don't need to handle distribution yourself –merge your skill and it shows up in both places on the next CI run.diff --git a/ee/api/quota_limits.py b/ee/api/quota_limits.pyindex 1cd8c4df4d72..cf2fa5eb1eee 100644--- a/ee/api/quota_limits.py+++ b/ee/api/quota_limits.py@@ -64,9 +64,9 @@ class QuotaLimitsResponseSerializer(serializers.Serializer):)code_usage_billing_active = serializers.BooleanField(help_text=(- "Whether the team's organization pays for PostHog Code usage: billing grants the "- "`posthog_code_usage` product feature only on the Code usage product's paid plan, "- "synced into the organization's available features. Consumers gate paid-tier Code "+ "Whether the team's organization pays for PostHog Desktop usage: billing grants the "+ "`posthog_code_usage` product feature only on the Desktop usage product's paid plan, "+ "synced into the organization's available features. Consumers gate paid-tier Desktop ""behavior on this; an org unknown to billing reads as not paying."),)diff --git a/ee/api/test/test_quota_limits.py b/ee/api/test/test_quota_limits.pyindex 56ceb8433b95..a526ea666656 100644--- a/ee/api/test/test_quota_limits.py+++ b/ee/api/test/test_quota_limits.py@@ -54,7 +54,7 @@ class TestQuotaLimitsAPI(APIBaseTest):self.assertEqual(response.status_code, status.HTTP_200_OK)data = response.json()self.assertEqual(data["limited"]["ai_credits"], {"limited": False, "usage": None, "limit": None})- # Org holds no billing-granted Code usage feature -> reads as not paying+ # Org holds no billing-granted Desktop usage feature -> reads as not payingself.assertIs(data["code_usage_billing_active"], False)def test_reports_code_usage_billing_state(self) -> None:@@ -62,7 +62,7 @@ class TestQuotaLimitsAPI(APIBaseTest):# on this field - dropping it (or resolving the wrong org) silently# re-caps paying users.self.organization.available_product_features = [- {"key": AvailableFeature.POSTHOG_CODE_USAGE, "name": "PostHog Code usage billing"}+ {"key": AvailableFeature.POSTHOG_CODE_USAGE, "name": "PostHog Desktop usage billing"}]self.organization.save()@@ -72,7 +72,7 @@ class TestQuotaLimitsAPI(APIBaseTest):self.assertIs(response.json()["code_usage_billing_active"], True)def test_reports_org_usage_and_limit_for_synced_resources(self) -> None:- # The LLM gateway forwards these to clients (PostHog Code renders+ # The LLM gateway forwards these to clients (PostHog Desktop renders# "used $X of $Y"); usage mirrors the limiter's usage + todays_usage sum.self.organization.usage = {"period": ["2026-07-01T00:00:00Z", "2026-08-01T00:00:00Z"],diff --git a/ee/hogai/tools/call_mcp_server/installations.py b/ee/hogai/tools/call_mcp_server/installations.pyindex 87e3437a8098..03fe335d44fe 100644--- a/ee/hogai/tools/call_mcp_server/installations.py+++ b/ee/hogai/tools/call_mcp_server/installations.py@@ -19,7 +19,7 @@ def _get_installations(team: Team, user: User) -> list[dict]:"""Return the MCP installations available to this user's agent: theirpersonal installations plus team-shared ones.- Per-URL resolution matches the sandbox facade and PostHog Code: a ready+ Per-URL resolution matches the sandbox facade and PostHog Desktop: a readypersonal installation wins over a shared one (the agent acts as the userrather than through a teammate's shared credential), but a dead personalrow doesn't shadow a working shared one. Unready shared rows are hiddendiff --git a/ee/hogai/tools/read_billing_tool/tool.py b/ee/hogai/tools/read_billing_tool/tool.pyindex ace0762f58db..ae23c7b5550c 100644--- a/ee/hogai/tools/read_billing_tool/tool.py+++ b/ee/hogai/tools/read_billing_tool/tool.py@@ -35,7 +35,7 @@ USAGE_TYPES = [{"label": "Rows exported", "value": "rows_exported_in_period"},{"label": "PostHog AI", "value": "ai_credits_used_in_period"},{"label": "Inbox credits", "value": "signals_credits_used_in_period"},- {"label": "PostHog Code credits", "value": "posthog_code_credits_used_in_period"},+ {"label": "PostHog Desktop credits", "value": "posthog_code_credits_used_in_period"},{"label": "Replay vision credits", "value": "replay_vision_credits_used_in_period"},{"label": "Workflow emails", "value": "workflow_emails_sent_in_period"},{"label": "Workflow push notifications", "value": "workflow_push_sent_in_period"},diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 90aed8d91cf1..7d86557d988e 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -1269,49 +1269,49 @@ snapshots:components-markdown-notebook--view-mode--light:hash: v1.k794b7964.11c2bd01a8840cb7147eb94693398331ab96b2dffc7fc049a5bf021fdef421e1.3HlB3wcmf1v_k83nyNus_piIMHd3_PwM9kun-EqTRgYcomponents-mcp-hint-toast--annotations-create--dark:- hash: v1.k794b7964.a89a0112c0a5202091776711f4eb89de90f847e3a687d64af45d0fac54d628a6.v-Uh8HnxDI3DUFmLjo_4pXl43CUBzowOuqUNyLZcnHg+ hash: v1.k794b7964.eec2ed99e26c3e17bb863aee733524cf25a5ae76808f594bdc41c0eddf501b8f.x88L0pkIlEBj6PedsMSeWEWk04MeGS8PbIdYCJmYYjscomponents-mcp-hint-toast--annotations-create--light:- hash: v1.k794b7964.8b78cb93ea4cff079e8d20388051ceac9821fd17a443547eac3b8c768f1ed775.ZjEL7P1TGl9pAEbAOb26hIxKnE2hbuuAHw-AT5nKa2s+ hash: v1.k794b7964.9268330fdbac65ef8a7944d6b7842d75fc24b65be0b6161aef1cc09e91137455.34awtLqUjMyV-e6oq1J7EZMTHRayyp7SaN1ckBfiRgQcomponents-mcp-hint-toast--dashboards-create--dark:- hash: v1.k794b7964.b7215d9fd5c42ca2e49136aa06c80c7fdeed4696c33fbdccab1f7563dfebe25f.30GBmrw5WPXaCNHR_BWA0NaP3AHFvBIDSumXBAqx-3g+ hash: v1.k794b7964.8b0cb4193951738490a5828f9f0ee6098f64d230938fb472bf48efa14f7d1b04.s_3ppuxHf5j2rlmlHO-gEaVNt2SUyHVLHrquBY7YLQscomponents-mcp-hint-toast--dashboards-create--light:- hash: v1.k794b7964.a74eb03daa2eb803f7a691f2856be35224339b62755016f6b429858bb9257cef.Ni-sAFtxnYgUbAhpzUPd6Ni2otVp_dZlVTgemFCUhuk+ hash: v1.k794b7964.d435b1d7309aba3fa45ca0e77cd56434cd18d9192f892bff103b39af1630f9b6.rOGJNpfxSGNEG01itN3MAz-RuqXPoRKQS1kYd2p8DAEcomponents-mcp-hint-toast--experiments-create--dark:- hash: v1.k794b7964.9c5d3d6c1c7a5549716d69869504ed74e2a7cc5e125617f6c18016c0df18a45d.VXhQcJndSZTqXkZsnliIi5Wsh-skHka4RPrWemLt2AM+ hash: v1.k794b7964.4a565562ed3d671eaa2fc5ca17409379641fc5cdc06b875e06890b835fcd0df0.FoDB7oJzWF0dz0NTodUVhMnK8y_p83GijBSkhhBzQhgcomponents-mcp-hint-toast--experiments-create--light:- hash: v1.k794b7964.42e2863de8c9c4b135beb0455d292de1a2c008007c8440f9ecae5ce3d7520017.O0AbUK9j-0yIkaGYiqy0rI-mfJcPdvNMDjlVTFMlATw+ hash: v1.k794b7964.e0594102361f47e92ae32e064db951096618d3a427e08bef3a67af226c5b4713.jQASTcXuItAMOeoG769HCPopYEba1RI8eQG4S-bsfqEcomponents-mcp-hint-toast--feature-flags-create--dark:- hash: v1.k794b7964.cfab1e8ba6d9e2ada7fa575c8ba3cb32f48a1f1734ee6dad259afaffa0445856.5sBRRP5uERWTqFonvAkv6DVoE-MjUbz2ZhhvNJmpEKQ+ hash: v1.k794b7964.35db2c43cab2ed8173493ee17e9079170b259e56cada44145e224eb6d6d65cab.kpPpFg1dUT7XewfDblelk6-s9Yab2AOa5G6Txsd-vjMcomponents-mcp-hint-toast--feature-flags-create--light:- hash: v1.k794b7964.da1ee10f5ee4195810236b25208b389232bfc3b9dc9bd50a85110caf799ae34c.YudP869DJKSLR1DoL3KyRDffA-ih1h1j2GE8TMXJA_c+ hash: v1.k794b7964.a656a5ca3bb672e1cdcab7dce7bcb8b2cbb70f0c5e61c0794aaee8504f8cc73c.Ff7x6fzxWa1s2JJ47jAU9HnfnA3P1ynwRD4ifkBbdHgcomponents-mcp-hint-toast--feature-flags-update-with-derived-prompt--dark:- hash: v1.k794b7964.d38c0871eecc0960f5bf6ae558e096b21f2febe0de8201dc157d8e63ede8a8f1.YAZZJHQ1d2x_2xT9P6ZBhj1uWzVBtO6oPN2FtBXDFnw+ hash: v1.k794b7964.986a1d15152c36e917d9eacfc49a562b8b9f80f4dfdcc2fad2a2271964efb342._JiKbOmw9B9mTl8fOXAR6B4Vlq-iBqeoCyrodyPORTkcomponents-mcp-hint-toast--feature-flags-update-with-derived-prompt--light:- hash: v1.k794b7964.d8cfb108d0358dfccbe121bc23b86507240300e93c21ca6b50f48a2680de2299.P565q4AckBblYU_U2Tfyju_7T0dRXwlPSMwja6nq3Gs+ hash: v1.k794b7964.68a7cf74686a3b5b1699e05e2890eb325db60ed9ebc84b058aa6f99b392e6cb2.NjBOm-cmRuJ-cDGkX3F29hgtaogrhTAXrazZGgzr__ocomponents-mcp-hint-toast--sql-execute--dark:- hash: v1.k794b7964.46a3dc46a3e8eecc76fe5e86fe6c5b7d244526ea8c16bb1973f013191e442a10.6dJoMiy0oBghTfeLzNtKg1y20RnRXmRanOLw2aIzQss+ hash: v1.k794b7964.e5991874972a9382c736026b9be0ba23f478f5cad7fb1a6c0b95ad697549b2b0.MlZppqkWPobycZrk6InXacMCB_Otr0Mh5rfsEaZl-6kcomponents-mcp-hint-toast--sql-execute--light:- hash: v1.k794b7964.1b6acf11e002209eadc95e396ed018a25ff6f84c1423750db2e33335a67f5a9e.HW60r7yUqCRF_rOuj-wHROuYLKRhtyBZiIsR8YPikRc+ hash: v1.k794b7964.0f1ab3bce13fe8842d1c1082aa3958d4f3036f45e22b446492de1ea952a1ddf2.I1aMoYXTWQHQ7HLM_sBl7E_ivm0w1OS4uyBXusN5xkQcomponents-mcp-use-case-card--dashboards-create--dark:- hash: v1.k794b7964.3e84086e54c1884047fe895f1b0ab0ee417cd5135e96644558b95cbde4a52292.aSwgvMOlTPTeZzx9NisoiqOIIY_aQdYSkaokRY0oJkw+ hash: v1.k794b7964.f11cb9fd9e4bf81c9809fca5a6e01b60feb1504d84a6a49eef90ed5313f66063.Nqxa-pxylBl5wjNLEyblqWq8gIqrUty24HUzaMxa9tUcomponents-mcp-use-case-card--dashboards-create--light:- hash: v1.k794b7964.4bb3d17536ab8ad7631629efe48b451780d10a941213223cf80676cfc66edc68.lpAW6LMUFGPSsVS4FZTev5x8rdAM3gVNqoiZEojBIDQ+ hash: v1.k794b7964.e5bcd0b150dad00f41b10599b720a7b17d53de2aa9c701f132f3e5e0b1b76bf4.2-1hPkuiSoNh9I9YWblocq8HHNQsJ9qnBqW2VvQ50Rccomponents-mcp-use-case-card--experiments-create--dark:- hash: v1.k794b7964.127c351bf0eb360500c676fc6cb99ee01881c1376a261ce3ee6c69e7152dd9e7.i9Zq0taJvrCORXQj8GlILC_86noPTdQZRfoFnAS_WL8+ hash: v1.k794b7964.e24fc589aa2645f8bb662eadd648609583b0cfa168cc870742aa52908c9f86f1.kxVh0EEyMMv-ZnghvAfryZ55Ce3c3cfUnBwbBd8ySP8components-mcp-use-case-card--experiments-create--light:- hash: v1.k794b7964.2de52210c6382d14bbdbddc3a99615582ba7ecb601d1568f8ee08a8c2b7596fb.pIn7fDvBJTGnbc19oTanPU2p9h6kxkWFZrYQBDu--NY+ hash: v1.k794b7964.34e391df2000b13da2cb95ad96a774d37b79f7b50e93bc44da0b80895acb2dd0.K9uPX9I52fokIINNP-StL_9MsZ-OKzr0J6_Wufz8rKMcomponents-mcp-use-case-card--feature-flags-create--dark:- hash: v1.k794b7964.13e0c3da8da934a45b3b138edcb722b242cbd70e587cdc43d03db2f75674aaa6.ecpwW9wuj4N_2hZJK746DVIsoHVHJQCZdBunH9BnOhw+ hash: v1.k794b7964.1878de18cc57905b859d36d770a94d383898c874c532b1b22e489f30a2faf11c.8hKFkkIp0HfDfm4aWQuS6-BRMZhI6MBZPYMnvsQgWXQcomponents-mcp-use-case-card--feature-flags-create--light:- hash: v1.k794b7964.d793cb54a7fcb94919d0f9b72845fa33434134feeb9527d3313caff447b22f9f.OcC56y0iwFClj4pEdZR1iI_Lh_l29I_Tlo-estxl8og+ hash: v1.k794b7964.ad2a63f23858ee6a91fae1f9ce7439c1c49b32310e0158a9f9887989861636eb.dStLTLAgE7xIh2sG6I7DJzjCTMyOnJoPcuVeW4BOD8Qcomponents-mcp-use-case-card--insights-create--dark:- hash: v1.k794b7964.c7a1db442b1285da1409875a6ea77428f675ec1b74930a40fb425f307b132860.bZfXp85EIffzIStWW0DozJllamAcPcEQScZ5UjZZCLQ+ hash: v1.k794b7964.337bde2569c967a7d82923d46da99c3aeb8bfa5107ca1c046598fefd86661429.SPrZ5dGO026IDKquMRJhrPE7pibd864Akm1bdiget70components-mcp-use-case-card--insights-create--light:- hash: v1.k794b7964.fbf565bedf4f28cecbf16cda26ee31094aea74f8a7f5c64abea6872b606639dd.DULYEssRZZ_Qo8m6lRgbvs6ZmUhIilrTyiT6fTyBp6w+ hash: v1.k794b7964.36015a48bc7c7557b16b61e661a358549df5c39542fde9360954257005873ae5.BcftWNDC7Y4she2FkhwEUkJ69V58TGKis1IfCBjqU20components-mcp-use-case-card--surveys-create--dark:- hash: v1.k794b7964.0e8104bc157a94e4a189c153f1cdd32e631e5dfafb409c5748e6444112e6b083.40iqRsl1MTWxx72-j944X6yykg4h5eT36x8UDa6EajE+ hash: v1.k794b7964.695db537c58523ccddbc27ca55efd0c26869b819dd1b61d68c8f62568f95662c.Elw0IPXosIZQX-CTjUA53qCNvx5pzjeDQcVO8ukReTscomponents-mcp-use-case-card--surveys-create--light:- hash: v1.k794b7964.b661e4e398c7e4d4ddc8147808d77a5469d58ef0b03f5e249a8f3e8e3292033e.chYHGb_myBwyHq4I_2Jyj59FUmcFRaTfloWtxB-ZWS8+ hash: v1.k794b7964.693a3cba67de29bb7ecea8b07f3ae05b0201c2785fa2f2d4975e481b6fdc349e.ROQjP-mA4zsLzJifJv9uIKLgwuM0h84NwoFZJ90rSyccomponents-navpanelproductpush--all-products--dark:hash: v1.k794b7964.70e51ca304e26d9c0778eafa3031983d1906d49e62ee377d0792ae013bff2e19.P1NqL-7BkCpdNq_GR7GJmAdWw-9h8eaXk4QL1nc47rUcomponents-navpanelproductpush--all-products--light:diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.tsindex f43b6132f6a1..14caaa09a019 100644--- a/frontend/src/generated/core/api.schemas.ts+++ b/frontend/src/generated/core/api.schemas.ts@@ -3777,7 +3777,7 @@ export interface UserGitHubPrepareCallbackRequestApi {export interface UserGitHubLinkStartRequestApi {/**- * Optional team/project id (e.g. PostHog Code); web UI uses the session's current team.+ * Optional team/project id (e.g. PostHog Desktop); web UI uses the session's current team.* @nullable*/team_id?: number | nulldiff --git a/frontend/src/generated/core/api.zod.ts b/frontend/src/generated/core/api.zod.tsindex ab32d0f31d16..4b4561282eee 100644--- a/frontend/src/generated/core/api.zod.ts+++ b/frontend/src/generated/core/api.zod.ts@@ -9979,7 +9979,7 @@ export const UsersIntegrationsGithubStartCreateBody = /* @__PURE__ */ zod.objectteam_id: zod.number().nullish()- .describe("Optional team\/project id (e.g. PostHog Code); web UI uses the session's current team."),+ .describe("Optional team\/project id (e.g. PostHog Desktop); web UI uses the session's current team."),connect_from: zod.string().optional()diff --git a/frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx b/frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsxindex 51944ae5ac02..fdfe40214288 100644--- a/frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx+++ b/frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx@@ -115,7 +115,7 @@ const AGENTS: AgentDef[] = [},{key: 'posthog-code',- name: 'PostHog Code',+ name: 'PostHog Desktop',logo: <IconLogomark className="size-4 shrink-0" />,verb: 'Open',open: (prompt, { repository }) => window.open(buildPostHogCodeDeepLink(prompt, repository), '_blank'),diff --git a/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx b/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsxindex fadaed630c9a..6e63a73687ad 100644--- a/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx+++ b/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx@@ -25,21 +25,21 @@ const POSTHOG_SLACK_URL = 'https://posthog.com/slack'const POSTHOG_CODE_LOGO = <IconLogomark className="size-4 shrink-0 text-black dark:text-white" />const POSTHOG_SLACK_LOGO = <IconSlack className="size-4 shrink-0" />-// Show PostHog Code + Slack more often to increase engagement+// Show PostHog Desktop + Slack more often to increase engagement// Also duplicate the entries to keep it in the screen for longerconst AGENTS: BadgeAgent[] = [- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },{ name: 'Slack', logo: POSTHOG_SLACK_LOGO, url: POSTHOG_SLACK_URL },{ name: 'Claude', logo: claudeLogo },{ name: 'Cursor', logo: cursorLogo, logoClassName: 'dark:invert' },- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },{ name: 'Slack', logo: POSTHOG_SLACK_LOGO, url: POSTHOG_SLACK_URL },{ name: 'Codex', logo: openaiLogo },{ name: 'Gemini', logo: geminiLogo },- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },- { name: 'PostHog Code', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },+ { name: 'PostHog Desktop', logo: POSTHOG_CODE_LOGO, url: POSTHOG_CODE_URL },{ name: 'Slack', logo: POSTHOG_SLACK_LOGO, url: POSTHOG_SLACK_URL },{ name: 'ChatGPT', logo: openaiLogo },{ name: 'Claude Code', logo: claudeLogo },@@ -48,7 +48,7 @@ const AGENTS: BadgeAgent[] = [const ROTATE_INTERVAL_MS = 3000export function AgentBadgeRotator(): JSX.Element {- // Pin to "PostHog Code" inside Storybook so visual snapshots don't flake on rotation.+ // Pin to "PostHog Desktop" inside Storybook so visual snapshots don't flake on rotation.const isStorybook = inStorybook() || inStorybookTestRunner()const [index, setIndex] = useState(() => (isStorybook ? 0 : Math.floor(Math.random() * AGENTS.length)))diff --git a/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts b/frontend/src/lib/components/ProductSetup/productSetupRegistry.tsindex 084d2a35ffd4..ccd7f1916b84 100644--- a/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts+++ b/frontend/src/lib/components/ProductSetup/productSetupRegistry.ts@@ -48,7 +48,7 @@ export const AI_TASKS: SetupTask[] = [},{id: SetupTaskId.UsePosthogCode,- title: 'Try PostHog Code',+ title: 'Try PostHog Desktop',description:'An AI devtool that understands your product, not just your codebase — it triages bugs and opens pull requests from your product data.',taskType: 'ai',diff --git a/frontend/src/lib/components/ProductSetup/types.ts b/frontend/src/lib/components/ProductSetup/types.tsindex f8f24f6847d5..a3a16991d856 100644--- a/frontend/src/lib/components/ProductSetup/types.ts+++ b/frontend/src/lib/components/ProductSetup/types.ts@@ -14,7 +14,7 @@ export type SetupTaskId = AvailableSetupTaskIdsEnumApi* - explore: Advanced/optional features to try after getting started* Examples: Create funnel, set up cohorts, create multivariate flag* - ai: PostHog's AI surfaces, shown for every product- * Examples: PostHog AI, PostHog Code, PostHog MCP, PostHog in Slack+ * Examples: PostHog AI, PostHog Desktop, PostHog MCP, PostHog in Slack*/export type TaskType = 'setup' | 'onboarding' | 'explore' | 'ai'diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 936f278f9dc5..2fec33c85a0f 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -181,7 +181,7 @@ export const FEATURE_FLAGS = {UX_HIDE_PROJECT_NOTICE: 'ux-hide-project-notice', // owner: #team-platform-ux, hides the project notice banner across all scenes// Feature flags used to control opt-in for different behaviors, should not be removed- AGENT_PLATFORM: 'agent-platform', // owner: @benwhite #team-agents, gates the agent-platform surface — MCP tools + the PostHog Code agents view (hidden until GA; product DB is dev-only)+ AGENT_PLATFORM: 'agent-platform', // owner: @benwhite #team-agents, gates the agent-platform surface — MCP tools + the PostHog Desktop agents view (hidden until GA; product DB is dev-only)AI_TRAINING: 'ai-training', // owner: @nicowaltz #team-replay #ai-research, gates the AI training opt-out UI and API enforcementAUDIT_LOGS_ACCESS: 'audit-logs-access', // owner: #team-platform-features, used to control access to audit logsAUTH_FLOW_VARIANT: 'auth-flow-variant', // owner: @fercgomes #team-growth multivariate=legacy,paper-desk — selects the auth flow experience (login, signup, invited signup, email verification); paper-desk is the new design, legacy is the existing designdiff --git a/frontend/src/lib/integrations/GitHubBranchCombobox.tsx b/frontend/src/lib/integrations/GitHubBranchCombobox.tsxindex 04d99d4b6fc8..544de7674ad6 100644--- a/frontend/src/lib/integrations/GitHubBranchCombobox.tsx+++ b/frontend/src/lib/integrations/GitHubBranchCombobox.tsx@@ -34,7 +34,7 @@ export interface GitHubBranchComboboxProps {const CREATE_BRANCH_PREFIX = '__create__:'/**- * GitHub branch picker built on Quill's Combobox, mirroring the PostHog Code branch picker: a button+ * GitHub branch picker built on Quill's Combobox, mirroring the PostHog Desktop branch picker: a button* trigger, in-popover server-side search, a paginated "Load more" footer, and a refresh control. It* auto-selects the repository's default branch, and lets the user type a brand-new branch name (committed* via a synthetic "Use \"x\" as branch name" item). Searching/pagination are delegated to@@ -58,7 +58,7 @@ export function GitHubBranchCombobox({const trimmedSearchQuery = searchQuery.trim()const showInlineLoadingState = open && loading- // Pre-select the repo's default branch once it's known and nothing is chosen yet (matches PostHog Code).+ // Pre-select the repo's default branch once it's known and nothing is chosen yet (matches PostHog Desktop).useEffect(() => {if (!value && defaultBranch) {onChange(defaultBranch)diff --git a/frontend/src/lib/integrations/GitHubRepositoryCombobox.tsx b/frontend/src/lib/integrations/GitHubRepositoryCombobox.tsxindex 5f6586d78ba4..16e151b8c829 100644--- a/frontend/src/lib/integrations/GitHubRepositoryCombobox.tsx+++ b/frontend/src/lib/integrations/GitHubRepositoryCombobox.tsx@@ -31,7 +31,7 @@ export interface GitHubRepositoryComboboxProps {}/**- * GitHub repository picker built on Quill's Combobox, mirroring the PostHog Code repo picker: a button+ * GitHub repository picker built on Quill's Combobox, mirroring the PostHog Desktop repo picker: a button* trigger, an in-popover search field driving server-side search, a paginated "Load more" footer, and a* refresh control. Searching and pagination are delegated to {@link githubRepositorySearchLogic} so large* accounts never load the full repository list up front.diff --git a/frontend/src/lib/oauth/pkce.ts b/frontend/src/lib/oauth/pkce.tsindex 1bc93ecc6789..13f9d844e762 100644--- a/frontend/src/lib/oauth/pkce.ts+++ b/frontend/src/lib/oauth/pkce.ts@@ -1,5 +1,5 @@// PKCE (RFC 7636) helpers for the OAuth authorization-code flow. Ported from the-// PostHog Code desktop app, using the browser's Web Crypto API.+// PostHog Desktop app, using the browser's Web Crypto API.function base64UrlEncode(bytes: Uint8Array): string {let binary = ''diff --git a/frontend/src/lib/scopes.tsx b/frontend/src/lib/scopes.tsxindex 370db9eed5e7..11e710a0d9f5 100644--- a/frontend/src/lib/scopes.tsx+++ b/frontend/src/lib/scopes.tsx@@ -37,7 +37,7 @@ export const API_SCOPES: APIScope[] = [key: 'agent_approvals',objectName: 'Agent approval',objectPlural: 'agent approvals',- info: 'Grants the ability to approve or reject queued agent tool-approval requests on behalf of the consenting user, including requests whose spec sets `allow_agent_approver: false` (human-only). Only grant this to OAuth clients that put a human in the loop at decide time, like the PostHog Code desktop app.',+ info: 'Grants the ability to approve or reject queued agent tool-approval requests on behalf of the consenting user, including requests whose spec sets `allow_agent_approver: false` (human-only). Only grant this to OAuth clients that put a human in the loop at decide time, like the PostHog Desktop app.',disabledActions: ['read'],},{ key: 'alert', objectName: 'Alert', objectPlural: 'alerts' },diff --git a/frontend/src/scenes/authentication/account/AccountConnected.tsx b/frontend/src/scenes/authentication/account/AccountConnected.tsxindex ecef746ff4cd..39b31040a6d6 100644--- a/frontend/src/scenes/authentication/account/AccountConnected.tsx+++ b/frontend/src/scenes/authentication/account/AccountConnected.tsx@@ -92,7 +92,7 @@ export const scene: SceneExport<AccountConnectedProps> = {}/**- * Unified return page for PostHog Code / web: social SSO link (`github-login`), personal GitHub+ * Unified return page for PostHog Desktop / web: social SSO link (`github-login`), personal GitHub* integration (`github-integration`), or team Slack integration (`slack-integration`). Navigates* to the matching `posthog-code://…` deep link so the desktop app refreshes its integrations —* except when started from Slack (`connect_from=slack`), where it shows a terminal success state@@ -109,7 +109,7 @@ export function AccountConnected({ kind }: AccountConnectedProps): JSX.Element {const errorCode = getGithubSetupErrorCode(searchParams)const isError = errorCode.length > 0// The Slack flow has no deep link back — the user just returns to Slack themselves, so we only- // show the success state. PostHog Code refreshes its integrations via a desktop deep link.+ // show the success state. PostHog Desktop refreshes its integrations via a desktop deep link.const startedFromSlack = searchParams.connect_from === 'slack'// Allowlist-style check — `paramsToProps` is expected to map unknown kinds to `'invalid'`,// but guarding directly against the valid set means a route mismatch (e.g. project-prefix@@ -154,9 +154,9 @@ export function AccountConnected({ kind }: AccountConnectedProps): JSX.Element {</p>) : (<p className="text-muted mb-0">- <strong>Returning to PostHog Code…</strong>+ <strong>Returning to PostHog Desktop…</strong><br />- <em>If this hasn't happened automatically, get back to the PostHog Code app manually.</em>+ <em>If this hasn't happened automatically, get back to the PostHog Desktop app manually.</em></p>)}</div>diff --git a/frontend/src/scenes/authentication/shared/RegionSelect.tsx b/frontend/src/scenes/authentication/shared/RegionSelect.tsxindex cdac4a45b453..a98eb25f0c8d 100644--- a/frontend/src/scenes/authentication/shared/RegionSelect.tsx+++ b/frontend/src/scenes/authentication/shared/RegionSelect.tsx@@ -75,7 +75,7 @@ export default function RegionSelect(): JSX.Element | null {const { beginLogin } = useActions(oauthLogic)const [regionModalOpen, setRegionModalOpen] = useState(false)- // Local dev: offer signing into a remote cloud region over OAuth, styled like the PostHog Code+ // Local dev: offer signing into a remote cloud region over OAuth, styled like the PostHog Desktop// desktop region picker. Keeping "Local" uses the usual session-cookie form below; picking// US/EU kicks off the OAuth flow against that region.if (preflight?.is_debug) {diff --git a/frontend/src/scenes/billing/Billing.tsx b/frontend/src/scenes/billing/Billing.tsxindex 8e25edb6d393..45db21fd2e85 100644--- a/frontend/src/scenes/billing/Billing.tsx+++ b/frontend/src/scenes/billing/Billing.tsx@@ -266,8 +266,8 @@ export function Billing(): JSX.Element {<div className="flex gap-x-2"><div>{getProductIcon('IconTerminal', { className: 'text-2xl shrink-0' })}</div><div>- <h3 className="font-bold mb-0">Code</h3>- <div>Manage existing PostHog Code seats.</div>+ <h3 className="font-bold mb-0">PostHog Desktop</h3>+ <div>Manage existing PostHog Desktop seats.</div></div></div><LemonButtondiff --git a/frontend/src/scenes/billing/BillingProduct.stories.tsx b/frontend/src/scenes/billing/BillingProduct.stories.tsxindex 03f7e9167e46..2c592b899318 100644--- a/frontend/src/scenes/billing/BillingProduct.stories.tsx+++ b/frontend/src/scenes/billing/BillingProduct.stories.tsx@@ -50,7 +50,7 @@ const makePostHogCodeUsageBilling = ({) as BillingProductV2Typeconst product: BillingProductV2Type = {...sourceProduct,- name: 'PostHog Code',+ name: 'PostHog Desktop',headline: 'AI coding agents for your PostHog workspace.',description: 'AI coding agents for automating PostHog work.',usage_key: POSTHOG_CODE_USAGE_PRODUCT_KEY,diff --git a/frontend/src/scenes/billing/CodeSeatsSection.tsx b/frontend/src/scenes/billing/CodeSeatsSection.tsxindex 8e284f44b6ea..98c8b7b323e5 100644--- a/frontend/src/scenes/billing/CodeSeatsSection.tsx+++ b/frontend/src/scenes/billing/CodeSeatsSection.tsx@@ -64,7 +64,7 @@ export function CodeSeatsSection(): JSX.Element {<div><div className="flex items-center justify-between mb-4"><div>- <h3 className="mb-1 text-lg font-semibold">Code seats</h3>+ <h3 className="mb-1 text-lg font-semibold">Desktop seats</h3>{isAdmin && (<span className="text-muted text-sm">{activeCount} active{cancelingCount > 0 ? `, ${cancelingCount} canceling` : ''} ·{' '}@@ -76,15 +76,15 @@ export function CodeSeatsSection(): JSX.Element {</div></div><LemonBanner type="info" className="mb-4">- PostHog Code with usage-based billing launched on July 16, 2026, and existing seats expire on the same- date. New seats, upgrades, and reactivations are no longer available. You can still cancel active seats- below.+ PostHog Desktop with usage-based billing launched on July 16, 2026, and existing seats expire on the+ same date. New seats, upgrades, and reactivations are no longer available. You can still cancel active+ seats below.</LemonBanner><LemonTableloading={orgSeatsLoading}dataSource={displaySeats}defaultSorting={{ columnKey: 'user', order: 1 }}- emptyState="No Code seats"+ emptyState="No Desktop seats"columns={[{title: 'User',diff --git a/frontend/src/scenes/billing/constants.ts b/frontend/src/scenes/billing/constants.tsindex 2e15913f62d5..3f7bb9fed682 100644--- a/frontend/src/scenes/billing/constants.ts+++ b/frontend/src/scenes/billing/constants.ts@@ -17,7 +17,7 @@ export const USAGE_TYPES = [{ label: 'Rows exported', value: 'rows_exported_in_period' },{ label: 'PostHog AI', value: 'ai_credits_used_in_period' },{ label: 'Inbox credits', value: 'signals_credits_used_in_period' },- { label: 'PostHog Code credits', value: 'posthog_code_credits_used_in_period' },+ { label: 'PostHog Desktop credits', value: 'posthog_code_credits_used_in_period' },{ label: 'Replay vision credits', value: 'replay_vision_credits_used_in_period' },{ label: 'Workflow emails', value: 'workflow_emails_sent_in_period' },{ label: 'Workflow push notifications', value: 'workflow_push_sent_in_period' },diff --git a/frontend/src/scenes/code-canvas/CodeCanvasLink.tsx b/frontend/src/scenes/code-canvas/CodeCanvasLink.tsxindex e3479c08b3fa..e8ed510b1a2c 100644--- a/frontend/src/scenes/code-canvas/CodeCanvasLink.tsx+++ b/frontend/src/scenes/code-canvas/CodeCanvasLink.tsx@@ -48,10 +48,10 @@ export function CodeCanvasLink({ channelId, dashboardId }: CodeCanvasLinkProps):<BridgePage view="code-canvas-link"><div className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto"><IconLaptop className="text-5xl shrink-0" />- <h2 className="text-xl font-semibold m-0">Opening in PostHog Code…</h2>+ <h2 className="text-xl font-semibold m-0">Opening in PostHog Desktop…</h2><p className="text-muted mb-0">- Canvases live in the PostHog Code desktop app. If it's installed, it should open automatically. If- it didn't, use the button below — or download the app.+ Canvases live in the PostHog Desktop app. If it's installed, it should open automatically. If it+ didn't, use the button below — or download the app.</p><div className="flex flex-col items-center gap-2">{deepLink && (@@ -61,11 +61,11 @@ export function CodeCanvasLink({ channelId, dashboardId }: CodeCanvasLinkProps):window.location.href = deepLink}}>- Open in PostHog Code+ Open in PostHog Desktop</LemonButton>)}<LemonButton type="secondary" to="https://posthog.com/code" targetBlank>- Download PostHog Code+ Download PostHog Desktop</LemonButton></div></div>diff --git a/frontend/src/scenes/code-canvas/CodeChannelLink.tsx b/frontend/src/scenes/code-canvas/CodeChannelLink.tsxindex 579177297374..6f3d53a25b29 100644--- a/frontend/src/scenes/code-canvas/CodeChannelLink.tsx+++ b/frontend/src/scenes/code-canvas/CodeChannelLink.tsx@@ -50,10 +50,10 @@ export function CodeChannelLink({ channelId, taskId }: CodeChannelLinkProps): JS<BridgePage view="code-channel-link"><div className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto"><IconLaptop className="text-5xl shrink-0" />- <h2 className="text-xl font-semibold m-0">Opening in PostHog Code…</h2>+ <h2 className="text-xl font-semibold m-0">Opening in PostHog Desktop…</h2><p className="text-muted mb-0">- This {target} lives in the PostHog Code desktop app. If it's installed, it should open- automatically. If it didn't, use the button below, or download the app.+ This {target} lives in the PostHog Desktop app. If it's installed, it should open automatically. If+ it didn't, use the button below, or download the app.</p><div className="flex flex-col items-center gap-2">{deepLink && (@@ -63,11 +63,11 @@ export function CodeChannelLink({ channelId, taskId }: CodeChannelLinkProps): JSwindow.location.href = deepLink}}>- Open in PostHog Code+ Open in PostHog Desktop</LemonButton>)}<LemonButton type="secondary" to="https://posthog.com/code" targetBlank>- Download PostHog Code+ Download PostHog Desktop</LemonButton></div></div>diff --git a/frontend/src/scenes/coupons/campaigns/every.tsx b/frontend/src/scenes/coupons/campaigns/every.tsxindex 9b7a7f74ac6e..4d23cb84c40c 100644--- a/frontend/src/scenes/coupons/campaigns/every.tsx+++ b/frontend/src/scenes/coupons/campaigns/every.tsx@@ -56,6 +56,6 @@ export const everyCampaign: CampaignConfig = {'Active EVERY Goodie Bag annual subscriber','Active paid subscription to PostHog',`No non-$0 PostHog invoices before ${EVERY_CREDIT_ELIGIBILITY_CUTOFF} to qualify for PostHog core credits`,- 'PostHog Code and AI Gateway are currently excluded from this offer',+ 'PostHog Desktop and AI Gateway are currently excluded from this offer',],}diff --git a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsxindex efa399a63ee4..1029eb09b336 100644--- a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx@@ -220,7 +220,7 @@ export function FinishExperimentModal(): JSX.Element {const [releaseToEveryone, setReleaseToEveryone] = useState<boolean>(false)const [openCleanupPr, setOpenCleanupPr] = useState<boolean>(false)- // The cleanup PR runs as a PostHog Code task, so the user needs Code access on top of the rollout flag.+ // The cleanup PR runs as a PostHog Desktop task, so the user needs Code access on top of the rollout flag.const cleanupPrAvailable =!!featureFlags[FEATURE_FLAGS.EXPERIMENT_FLAG_CLEANUP_PR] && !!featureFlags[FEATURE_FLAGS.TASKS]diff --git a/frontend/src/scenes/inbox/components/config/AgentsTab.tsx b/frontend/src/scenes/inbox/components/config/AgentsTab.tsxindex 10eaedc9ce79..0be5822065ef 100644--- a/frontend/src/scenes/inbox/components/config/AgentsTab.tsx+++ b/frontend/src/scenes/inbox/components/config/AgentsTab.tsx@@ -48,7 +48,7 @@ function BackLink({ onClick }: { onClick: () => void }): JSX.Element {/*** Full-page Agents tab body for cloud Inbox – a high-fidelity port of the- * PostHog Code desktop Agents view. Composes Connections, the agent roster,+ * PostHog Desktop Agents view. Composes Connections, the agent roster,* Slack, and MCP servers. Session-analysis and data-source setup* render inline (replacing the roster) when their sub-flow is open.*/diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsxindex fe941f65995b..b7478e3b71ce 100644--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx@@ -15,7 +15,7 @@ import {// Quiet is the common, healthy baseline so it recedes to muted; saturated color// only means something happened – blue emission payoff, red/amber trouble. Blue-// (not the orange brand primary) keeps this in step with the desktop Code app.+// (not the orange brand primary) keeps this in step with the PostHog Desktop app.const OUTCOME_BOX_CLASS: Record<ScoutRunOutcome, string> = {emitted: 'bg-brand-blue',// A report-channel run produced output too — same payoff blue as an emitting run.diff --git a/frontend/src/scenes/inbox/components/detail/artefactTypes.ts b/frontend/src/scenes/inbox/components/detail/artefactTypes.tsindex 9b06035ba132..c6315d815b47 100644--- a/frontend/src/scenes/inbox/components/detail/artefactTypes.ts+++ b/frontend/src/scenes/inbox/components/detail/artefactTypes.ts@@ -1,5 +1,5 @@// Pure (no-React) artefact helpers shared by the detail logic and the activity-log renderers.-// Mirrors the PostHog Code inbox's artefact-log domain helpers. Content shapes stay loose+// Mirrors the PostHog Desktop inbox's artefact-log domain helpers. Content shapes stay loose// (`Record<string, any>` on the artefact) and are read through these typed accessors so legacy// rows with extra/missing keys never crash a render.diff --git a/frontend/src/scenes/inbox/components/onboarding/meep.ts b/frontend/src/scenes/inbox/components/onboarding/meep.tsindex 599d333b036b..e94d13b8fe73 100644--- a/frontend/src/scenes/inbox/components/onboarding/meep.ts+++ b/frontend/src/scenes/inbox/components/onboarding/meep.ts@@ -6,7 +6,7 @@ let audio: HTMLAudioElement | null = null/*** Cheeky easter egg for the onboarding previews: clicking the (otherwise inert) sample cards plays- * a "meep" and pops a matching toast – a nod to PostHog Code. Pure flair; nothing else depends on it.+ * a "meep" and pops a matching toast – a nod to PostHog Desktop. Pure flair; nothing else depends on it.*/export function playMeep(): void {lemonToast.info('Meep')diff --git a/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts b/frontend/src/scenes/inbox/utils/scoutRunsWindow.tsindex 4f80f4bd8914..a65d139af4cf 100644--- a/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts+++ b/frontend/src/scenes/inbox/utils/scoutRunsWindow.ts@@ -1,4 +1,4 @@-// Ported from PostHog Code desktop `packages/core/src/scouts/scoutRunsWindow.ts`+// Ported from PostHog Desktop `packages/core/src/scouts/scoutRunsWindow.ts`// and `scoutPresentation.ts`. Pure metrics + display helpers over scout runs and// configs; no I/O. The runs endpoint caps each response at 100 rows newest-first;// `scoutFleetLogic.loadRunsWindow` assembles the full window by walking thediff --git a/frontend/src/scenes/integrations/definitions/github.tsx b/frontend/src/scenes/integrations/definitions/github.tsxindex 059d149ff8f2..884b0887e08e 100644--- a/frontend/src/scenes/integrations/definitions/github.tsx+++ b/frontend/src/scenes/integrations/definitions/github.tsx@@ -18,7 +18,7 @@ export const GitHub = defineIntegration(Connect GitHub to link issues and pull requests with PostHog and create issues directly from errortracking. With <Link to={urls.integration('slack')}>Slack</Link> and{' '}<Link to="https://posthog.com/code" target="_blank">- PostHog code+ PostHog Desktop</Link>{' '}connected, tag @PostHog to draft pull requests and ship code changes straight to your repositories.</>diff --git a/frontend/src/scenes/max/components/CapabilityBadges.tsx b/frontend/src/scenes/max/components/CapabilityBadges.tsxindex 27355142feb9..b47512605257 100644--- a/frontend/src/scenes/max/components/CapabilityBadges.tsx+++ b/frontend/src/scenes/max/components/CapabilityBadges.tsx@@ -34,7 +34,7 @@ export interface CapabilityBadgesProps {className?: string}-/** Row of PostHog AI capability badges (+ the Code beta badge). Selection is owned by the parent. */+/** Row of PostHog AI capability badges (+ the Desktop beta badge). Selection is owned by the parent. */export function CapabilityBadges({capabilities,selectedKey,diff --git a/frontend/src/scenes/max/maxCapabilities.tsx b/frontend/src/scenes/max/maxCapabilities.tsxindex 66303073321e..c665dc6338e5 100644--- a/frontend/src/scenes/max/maxCapabilities.tsx+++ b/frontend/src/scenes/max/maxCapabilities.tsx@@ -41,7 +41,7 @@ export interface Capability {suggestions: CapabilitySuggestion[]}-/** Shared across both experiment arms — routes to the PostHog Code beta in the inbox. */+/** Shared across both experiment arms — routes to the PostHog Desktop beta in the inbox. */export const CODE_CAPABILITY = {key: 'code',label: 'Code',diff --git a/frontend/src/scenes/quickstart/Quickstart.tsx b/frontend/src/scenes/quickstart/Quickstart.tsxindex 5b48ee6bea3d..4406580e00bc 100644--- a/frontend/src/scenes/quickstart/Quickstart.tsx+++ b/frontend/src/scenes/quickstart/Quickstart.tsx@@ -1548,7 +1548,7 @@ export function Quickstart(): JSX.Element {<section><SectionHeadertitle="Guides, Products, and publications"- subtitle="Open setup guides, configure Slack or MCP, install PostHog Code, and read recent publications."+ subtitle="Open setup guides, configure Slack or MCP, install PostHog Desktop, and read recent publications."/><div className="flex flex-col gap-6"><div>@@ -1626,13 +1626,13 @@ export function Quickstart(): JSX.Element {</div></div><div>- <SubsectionHeader title="Slack, MCP, and PostHog Code" />+ <SubsectionHeader title="Slack, MCP, and PostHog Desktop" /><div className="grid grid-cols-1 @3xl/main-content:grid-cols-3 gap-4"><LearnCardicon={<IconLogomark />}- title="PostHog Code"+ title="PostHog Desktop"description="Use context from PostHog while querying data or changing code from your editor or terminal."- buttonLabel="Get PostHog Code"+ buttonLabel="Get PostHog Desktop"to="https://posthog.com/code"targetBlankaction="open_posthog_code"diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsxindex 05ddd25c5b7b..5c6ed8f4a63d 100644--- a/frontend/src/scenes/settings/SettingsMap.tsx+++ b/frontend/src/scenes/settings/SettingsMap.tsx@@ -357,7 +357,7 @@ export const SETTINGS_MAP: SettingSection[] = [{id: 'mcp-servers-manage',title: 'MCP servers',- description: 'Install and manage MCP servers for your PostHog AI and PostHog Code agents.',+ description: 'Install and manage MCP servers for your PostHog AI and PostHog Desktop agents.',component: <McpStoreSettings />,keywords: ['mcp', 'server', 'install', 'oauth', 'ai', 'agent'],},diff --git a/frontend/src/scenes/settings/user/PersonalIntegrations.tsx b/frontend/src/scenes/settings/user/PersonalIntegrations.tsxindex 1e7b0ffbfbc6..778282ce03ec 100644--- a/frontend/src/scenes/settings/user/PersonalIntegrations.tsx+++ b/frontend/src/scenes/settings/user/PersonalIntegrations.tsx@@ -31,7 +31,7 @@ function GitHubInstallationRow({ integration }: { integration: PersonalGitHubIntdescription: (<><LemonBanner type="warning" className="my-4 text-balance">- Any PostHog Code agent runs <em>currently in progress</em> will be unable to push commits or+ Any PostHog Desktop agent runs <em>currently in progress</em> will be unable to push commits oropen pull requests on GitHub.</LemonBanner><p>diff --git a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts b/frontend/src/scenes/settings/user/personalIntegrationsLogic.tsindex 441615f6d895..9059868f2f94 100644--- a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts+++ b/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts@@ -475,7 +475,7 @@ export const personalIntegrationsLogic = kea<personalIntegrationsLogicType>([const params = new URLSearchParams(window.location.search)// Stash ``connect_from`` so the post-roundtrip success toast can surface a- // "Return to PostHog Code" CTA.+ // "Return to PostHog Desktop" CTA.const connectFrom = params.get('connect_from')if (connectFrom) {writeConnectFromStorage(connectFrom)diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.tsindex 99594292546e..b48ad86b2c42 100644--- a/frontend/src/scenes/urls.ts+++ b/frontend/src/scenes/urls.ts@@ -162,7 +162,7 @@ export const urls = {/** After linking a social provider to an existing session (OAuth `next`; see posthog/api/authentication.py sso_login). */accountSocialConnected: (): string => '/account/social-connected',/**- * PostHog Code / web return page after connecting an account. Use `github-login` (social SSO),+ * PostHog Desktop / web return page after connecting an account. Use `github-login` (social SSO),* `github-integration` (user GitHub App integration), or `slack-integration` (team Slack integration);* see `AccountConnected` and `posthog/api/authentication.py` / `user_integration.py`.*/diff --git a/frontend/src/taxonomy/core-filter-definitions-by-group.json b/frontend/src/taxonomy/core-filter-definitions-by-group.jsonindex 4cb926afba36..260949122f42 100644--- a/frontend/src/taxonomy/core-filter-definitions-by-group.json+++ b/frontend/src/taxonomy/core-filter-definitions-by-group.json@@ -2105,7 +2105,7 @@"label": "MCP client version"},"$mcp_consumer": {- "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Code; 'slack' means it was triggered from Slack.",+ "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Desktop; 'slack' means it was triggered from Slack.","examples": ["posthog-code","slack"@@ -4214,7 +4214,7 @@"label": "MCP client version"},"$mcp_consumer": {- "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Code; 'slack' means it was triggered from Slack.",+ "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Desktop; 'slack' means it was triggered from Slack.","examples": ["posthog-code","slack"@@ -6917,7 +6917,7 @@"label": "MCP client version"},"$mcp_consumer": {- "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Code; 'slack' means it was triggered from Slack.",+ "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Desktop; 'slack' means it was triggered from Slack.","examples": ["posthog-code","slack"diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex c23713448972..1d0876445b90 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -4933,7 +4933,7 @@ export interface Experiment {_create_in_folder?: string | nullconclusion?: ExperimentConclusion | nullconclusion_comment?: string | null- /** Code task opened to remove the experiment's flag code, when requested on end/ship. */+ /** Desktop task opened to remove the experiment's flag code, when requested on end/ship. */flag_cleanup_task_id?: string | nulluser_access_level: AccessControlLevel}diff --git a/hogli.yaml b/hogli.yamlindex 094e00e713b2..822a7d83fd2c 100644--- a/hogli.yaml+++ b/hogli.yaml@@ -1043,7 +1043,7 @@ utilities:prompt: trueworktrees:clean:click: hogli_commands.worktrees:worktrees_clean- description: Clear out unused Claude Code / Codex / PostHog Code worktrees by age+ description: Clear out unused Claude Code / Codex / PostHog Desktop worktrees by agepr:upload-image:click: hogli_commands.upload_image:upload_imagedescription: Upload screenshot(s) to the public PostHog/pr-assets repo and print embeddable PR markdowndiff --git a/owners.yaml b/owners.yamlindex 1c3cc6237772..9d15bcb35f79 100644--- a/owners.yaml+++ b/owners.yaml@@ -20,7 +20,7 @@ teams:slack: '#team-apm'team-data-stack:slack: '#group-data-stack'- # PostHog Code's channel kept the name it was created under.+ # PostHog Desktop's channel kept the name it was created under.team-posthog-code:slack: '#team-desktop'rules:diff --git a/posthog/api/integration.py b/posthog/api/integration.pyindex 00013b782ec6..cae2b96142c4 100644--- a/posthog/api/integration.py+++ b/posthog/api/integration.py@@ -842,7 +842,7 @@ class GitHubPrepareCallbackRequestSerializer(serializers.Serializer):next = serializers.CharField(required=False,allow_blank=True,- help_text="Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Code).",+ help_text="Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Desktop).",)installation_id = serializers.CharField(required=False,diff --git a/posthog/api/oauth/test_views.py b/posthog/api/oauth/test_views.pyindex 4e9ebd200492..1d0b2184e8e8 100644--- a/posthog/api/oauth/test_views.py+++ b/posthog/api/oauth/test_views.py@@ -2775,7 +2775,7 @@ class TestOAuthAPI(APIBaseTest):self.assertFalse(any(scope.endswith(":write") for scope in wildcard_reads))def test_authorize_wildcard_accepted_when_app_ceiling_empty(self):- # Existing clients (the PostHog Code CLI today) still send scope=*+ # Existing clients (the PostHog Desktop CLI today) still send scope=*# against apps that have no explicit ceiling. Until wildcard retirement# (#60342) lands, those broad-default apps keep accepting it.response = self._authorize_post("*")diff --git a/posthog/api/oauth/views.py b/posthog/api/oauth/views.pyindex 7ae6877f4ae9..354a10cb4bc1 100644--- a/posthog/api/oauth/views.py+++ b/posthog/api/oauth/views.py@@ -448,7 +448,7 @@ class OAuthValidator(OAuth2Validator):response carries the actual (narrowed) `scope`, so this stays spec-valid.`*` is still accepted verbatim under an empty ceiling here (legacy PostHog- Code CLI) but never on the provisioning paths — see the flag.+ Desktop CLI) but never on the provisioning paths — see the flag."""app_scopes = getattr(client, "ceiling_scopes", None) or []requested = set(scopes or [])@@ -1361,12 +1361,12 @@ class OAuthTokenView(TokenView):scoped_teams = list(access_token.scoped_teams or [])scoped_organizations = list(access_token.scoped_organizations or [])- # First-party clients (PostHog Code) read scoped_teams from /oauth/token+ # First-party clients (PostHog Desktop) read scoped_teams from /oauth/token# to populate the project selector. When the app is org-scoped only,# access_token.scoped_teams is empty in the DB by design — derive teams# from scoped_organizations so clients keep working without weakening# the stored token scope.- # TODO(@charlesvien): remove this after a migration period in PostHog Code.+ # TODO(@charlesvien): remove this after a migration period in PostHog Desktop.if (not scoped_teamsand scoped_organizationsdiff --git a/posthog/api/rest_router.py b/posthog/api/rest_router.pyindex a5181fa46762..210e1b7c215f 100644--- a/posthog/api/rest_router.py+++ b/posthog/api/rest_router.py@@ -120,7 +120,7 @@ projects_router.register(# Tasks endpoints-# PostHog Code invites (not project-scoped)+# PostHog Desktop invites (not project-scoped)# Seats (proxied to billing service)diff --git a/posthog/api/test/test_user_push_token.py b/posthog/api/test/test_user_push_token.pyindex 7f0f5b14a49b..ec2b24bcea0c 100644--- a/posthog/api/test/test_user_push_token.py+++ b/posthog/api/test/test_user_push_token.py@@ -181,7 +181,7 @@ class TestPushNotifications(APIBaseTest):accepted = send_push_to_user(self.user,- title="PostHog Code",+ title="PostHog Desktop",body="task done",data={"taskId": "t1", "taskRunId": "r1"},)@@ -190,7 +190,7 @@ class TestPushNotifications(APIBaseTest):self.assertEqual(mock_post.call_count, 1)payload = mock_post.call_args.kwargs["json"]self.assertEqual(len(payload), 2)- self.assertEqual(payload[0]["title"], "PostHog Code")+ self.assertEqual(payload[0]["title"], "PostHog Desktop")self.assertEqual(payload[0]["body"], "task done")self.assertEqual(payload[0]["data"], {"taskId": "t1", "taskRunId": "r1"})diff --git a/posthog/api/user_integration.py b/posthog/api/user_integration.pyindex a03de51b34fd..c16931ff4dc8 100644--- a/posthog/api/user_integration.py+++ b/posthog/api/user_integration.py@@ -107,7 +107,7 @@ class UserGitHubLinkStartRequestSerializer(serializers.Serializer):team_id = serializers.IntegerField(required=False,allow_null=True,- help_text="Optional team/project id (e.g. PostHog Code); web UI uses the session's current team.",+ help_text="Optional team/project id (e.g. PostHog Desktop); web UI uses the session's current team.",)connect_from = serializers.CharField(required=False,@@ -673,7 +673,7 @@ class UserIntegrationViewSet(viewsets.GenericViewSet):def _resolve_team_for_github_start(user: User, request: Request):"""Resolve which team to use for team-level GitHub install discovery.- PostHog Code passes ``team_id`` (project/team) in the JSON body because the+ PostHog Desktop passes ``team_id`` (project/team) in the JSON body because thesession's ``user.current_team`` may not match the app UI. The web app omitsit and uses ``current_team``."""diff --git a/posthog/api/user_push_token.py b/posthog/api/user_push_token.pyindex ee6f9cd0fedd..99ad8fecb915 100644--- a/posthog/api/user_push_token.py+++ b/posthog/api/user_push_token.py@@ -2,7 +2,7 @@The mobile app uploads its Expo push token after the user grants notificationpermission. The backend fans out push notifications to every stored token-belonging to a user when something relevant happens (e.g. a PostHog Code task+belonging to a user when something relevant happens (e.g. a PostHog Desktop taskrun finishes or needs the user's input).This is **device self-registration only**: every request acts on thediff --git a/posthog/hogql/database/schema/system.py b/posthog/hogql/database/schema/system.pyindex 905859d5924e..5d76dff62b62 100644--- a/posthog/hogql/database/schema/system.py+++ b/posthog/hogql/database/schema/system.py@@ -1788,7 +1788,7 @@ tasks: PostgresTable = PostgresTable(# Mirror the REST API's default filter: internal tasks (signals pipeline, etc.) are not# exposed to end users. They are excluded entirely from HogQL.predicates=[parse_expr("internal != true")],- description="Tasks (PostHog Code / agent work items); one row per user-facing task (internal pipeline tasks are excluded).",+ description="Tasks (PostHog Desktop / agent work items); one row per user-facing task (internal pipeline tasks are excluded).",fields={"id": StringDatabaseField(name="id", description="Task UUID."),"team_id": IntegerDatabaseField(name="team_id"),diff --git a/posthog/management/commands/start_temporal_worker.py b/posthog/management/commands/start_temporal_worker.pyindex 9d9abf48f43b..55a0b3d83906 100644--- a/posthog/management/commands/start_temporal_worker.py+++ b/posthog/management/commands/start_temporal_worker.py@@ -373,7 +373,7 @@ _task_queue_specs = [),(settings.TASKS_TASK_QUEUE,- # PostHog Code Slack workflows are also registered on MAX_AI_TASK_QUEUE.+ # PostHog Desktop Slack workflows are also registered on MAX_AI_TASK_QUEUE.# First step of merging them onto this queue — once master traffic has# cut over and any in-flight runs have drained, drop them from# AI_WORKFLOWS / AI_ACTIVITIES and flip the start_workflow callers indiff --git a/posthog/models/test/test_integration_repository_cache.py b/posthog/models/test/test_integration_repository_cache.pyindex da15ceacd611..8039f31e6341 100644--- a/posthog/models/test/test_integration_repository_cache.py+++ b/posthog/models/test/test_integration_repository_cache.py@@ -466,7 +466,7 @@ class TestGitHubRepositoryFullCache(BaseTest):assert IntegrationRepositoryCacheEntry.objects.filter(pk=keep.pk).exists()def test_sync_full_cache_evicts_cross_source_rows_for_team(self):- # Team upgrade scenario: PostHog Code (UserIntegration) hydrated rows for this team, then+ # Team upgrade scenario: PostHog Desktop (UserIntegration) hydrated rows for this team, then# the team connected a team-level Integration. Cascade now picks the Integration; the old# UserIntegration row would otherwise linger and surface as a duplicate to HogQL queries.user = User.objects.create(email="[email protected]")diff --git a/posthog/models/user_push_token.py b/posthog/models/user_push_token.pyindex 585e8b8159e0..bb3a9ac6a324 100644--- a/posthog/models/user_push_token.py+++ b/posthog/models/user_push_token.py@@ -9,7 +9,7 @@ class UserPushToken(UUIDModel):A user may register multiple tokens (one per device). Tokens are uploadedby the mobile app after the user grants notification permission, and usedby backend services to fan out push notifications via the platform-native- push service (Expo for the PostHog Code mobile app).+ push service (Expo for the PostHog mobile app)."""class Platform(models.TextChoices):diff --git a/posthog/push_notifications.py b/posthog/push_notifications.pyindex 314eb7056297..ff597b441a0f 100644--- a/posthog/push_notifications.py+++ b/posthog/push_notifications.py@@ -4,7 +4,7 @@ The Expo push API accepts up to 100 messages per HTTP call and returns oneticket per message. Tickets carry transient errors (delivery failed, push tokeninvalid) but final delivery success is only confirmed by polling receipts.-For the PostHog Code mobile app the only thing we care about is best-effort+For the PostHog mobile app, the only thing we care about is best-effortfan-out plus pruning tokens the device push service has rejected aspermanently invalid (`DeviceNotRegistered`). Receipt polling is deferred untilwe have a real reason to surface delivery status.@@ -43,7 +43,7 @@ def send_push_to_user(``suppressed_push_token_ids`` lets the caller (typically a feature-specificdispatcher) drop devices that have proven they're already watching the- relevant context — e.g. presence beacons on a PostHog Code task. Tokens+ relevant context — e.g. presence beacons on a PostHog Desktop task. Tokenswhose ``UserPushToken.id`` is in the set are skipped before fanout, evenif that leaves the user with zero recipients. The contract is "if anydevice is provably watching, suppress the others", so an empty post-filterdiff --git a/posthog/scopes.py b/posthog/scopes.pyindex 9905ff3be721..5047c2c65ff8 100644--- a/posthog/scopes.py+++ b/posthog/scopes.py@@ -146,7 +146,7 @@ INTERNAL_API_SCOPE_OBJECTS: frozenset[APIScopeObject] = frozenset("clickhouse_test_cluster_perf",# Provenance marker on tokens minted server-side for a sandbox/agent run# (never via the consent flow or a personal API key). The LLM gateway requires- # it on the internal products that share the PostHog Code OAuth app so a user's+ # it on the internal products that share the PostHog Desktop OAuth app so a user's# own credential can't reach them — see services/llm-gateway products/config.py."internal_run",# Sandbox-only writes for the headless Signals agent (memory create/delete,@@ -368,7 +368,7 @@ def scopes_within_ceiling(`allow_wildcard_under_empty_ceiling` is the only resolution difference betweenthe callers: `/authorize` passes `True` to grandfather legacy `*` clients (the- PostHog Code CLI) until wildcard retirement; provisioning leaves it `False`+ PostHog Desktop CLI) until wildcard retirement; provisioning leaves it `False`(the default) since it never granted wildcard, so an unseeded ceiling must notsilently become one."""diff --git a/posthog/settings/base_variables.py b/posthog/settings/base_variables.pyindex 463ba782e84c..eb998ddc5fed 100644--- a/posthog/settings/base_variables.py+++ b/posthog/settings/base_variables.py@@ -63,7 +63,7 @@ SERVER_GATEWAY_INTERFACE = get_from_env("SERVER_GATEWAY_INTERFACE", "WSGI", typeGITHUB_SECRET_ALERT_RELAY_URL: str | None = get_from_env("GITHUB_SECRET_ALERT_RELAY_URL", optional=True)# Internal team on PostHog Cloud US that receives `$ai_generation` /-# `$ai_embedding` events emitted by PostHog products (PostHog Code,+# `$ai_embedding` events emitted by PostHog products (PostHog Desktop,# background agents, etc). Used by /api/llm_analytics/personal_spend/.# Override in tests via @override_settings to point at a per-test team.LLM_ANALYTICS_INTERNAL_TEAM_ID: int = 2diff --git a/posthog/storage/test/test_gateway_credential_cache.py b/posthog/storage/test/test_gateway_credential_cache.pyindex 6cea5fb92607..98b67b7e1fc5 100644--- a/posthog/storage/test/test_gateway_credential_cache.py+++ b/posthog/storage/test/test_gateway_credential_cache.py@@ -76,7 +76,7 @@ class GatewayCredentialTestMixin(BaseTest):) -> OAuthAccessToken:token = token or f"pha_{generate_random_token()}"app = OAuthApplication.objects.create(- name="PostHog Code",+ name="PostHog Desktop",client_type=OAuthApplication.CLIENT_CONFIDENTIAL,authorization_grant_type=OAuthApplication.GRANT_AUTHORIZATION_CODE,redirect_uris="https://example.com/callback",diff --git a/posthog/tasks/test/test_usage_report.py b/posthog/tasks/test/test_usage_report.pyindex 8d94ddf86fa4..356d27d50cf9 100644--- a/posthog/tasks/test/test_usage_report.py+++ b/posthog/tasks/test/test_usage_report.py@@ -4613,7 +4613,7 @@ class TestAIEventsUsageReport(ClickhouseDestroyTablesMixin, TestCase, Clickhouseperiod = get_previous_day(at=now() + relativedelta(days=1))period_start, period_end = period- # PostHog Code event — should appear only in posthog_code credits+ # PostHog Desktop event — should appear only in posthog_code credits_create_event(event="$ai_generation",team=analytics_team,@@ -4665,7 +4665,7 @@ class TestAIEventsUsageReport(ClickhouseDestroyTablesMixin, TestCase, Clickhouse) -> None:"""A traceless posthog_code generation bills via the empty-trace fallback only when billable.- PostHog Code never emits a matching $ai_trace event, so the LEFT JOIN never matches and the+ PostHog Desktop never emits a matching $ai_trace event, so the LEFT JOIN never matches and theempty-trace fallback is what makes posthog_code billable at all — but only for $ai_billable=true."""from posthog.tasks.usage_report import get_teams_with_posthog_code_credits_used_in_perioddiff --git a/posthog/tasks/usage_report.py b/posthog/tasks/usage_report.pyindex a76128dbd3c6..d74a330f98cd 100644--- a/posthog/tasks/usage_report.py+++ b/posthog/tasks/usage_report.py@@ -237,7 +237,7 @@ class UsageReportCounters:# Signals Billing Credits (flat credits per report whose implementation shipped a PR)signals_credits_used_in_period: int- # PostHog Code Billing Credits (PostHog Code product usage — same cost math as ai_credits, scoped to ai_product='posthog_code')+ # PostHog Desktop Billing Credits (PostHog Desktop product usage — same cost math as ai_credits, scoped to ai_product='posthog_code')posthog_code_credits_used_in_period: int# Cloud task sandbox compute, all task origins (raw user-attributed usage from the@@ -1398,7 +1398,7 @@ def get_teams_with_ai_event_count_in_period(# AI billing markup: 20% markup on top of costAI_COST_MARKUP_PERCENT = 0.2-# PostHog Code bills model costs as pure pass-through: no markup+# PostHog Desktop bills model costs as pure pass-through: no markupPOSTHOG_CODE_COST_MARKUP_PERCENT = 0.0# Tools excluded from AI billing (traces with only these tools are not billed)AI_BILLING_EXCLUDED_TOOLS = ["summarize_sessions", "search"]@@ -1425,7 +1425,7 @@ POSTHOG_AI_PRODUCTS = ["replay_vision",]-# ai_product values billed as PostHog Code credits.+# ai_product values billed as PostHog Desktop credits.POSTHOG_CODE_AI_PRODUCTS = ["posthog_code"]@@ -1691,7 +1691,7 @@ def get_teams_with_posthog_code_credits_used_in_period(begin: datetime,end: datetime,) -> list[tuple[int, int]]:- """PostHog Code billing credits — only events tagged with ai_product='posthog_code'.+ """PostHog Desktop billing credits — only events tagged with ai_product='posthog_code'.Billed as pure pass-through of model costs (no markup), unlike PostHog AI's 20%."""diff --git a/posthog/taxonomy/taxonomy.py b/posthog/taxonomy/taxonomy.pyindex d12cbd43c784..3eec210c978b 100644--- a/posthog/taxonomy/taxonomy.py+++ b/posthog/taxonomy/taxonomy.py@@ -2839,7 +2839,7 @@ CORE_FILTER_DEFINITIONS_BY_GROUP: dict[str, dict[str, CoreFilterDefinition]] = {},"$mcp_consumer": {"label": "MCP consumer",- "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Code; 'slack' means it was triggered from Slack.",+ "description": "The upstream surface that initiated the MCP request, supplied via the `x-posthog-mcp-consumer` header. 'posthog-code' means the request came through PostHog Desktop; 'slack' means it was triggered from Slack.","examples": ["posthog-code", "slack"],},"$mcp_mode": {diff --git a/posthog/temporal/AGENTS.md b/posthog/temporal/AGENTS.mdindex e307cffc5fc9..401758a8e9d8 100644--- a/posthog/temporal/AGENTS.md+++ b/posthog/temporal/AGENTS.md@@ -26,7 +26,7 @@ Pointers, not content. Read the linked docs before changing code or tests in thiQuick sanity checks that `discover_posthog_code_repository_via_agent_activity` is working after a deploy:- **Temporal UI.** Filter `posthog-code-slack-mention-processing` runs. Healthy: `discover_posthog_code_repository_via_agent_activity` followed by `create_posthog_code_task_for_repo_activity`. Picker-fallback (`post_posthog_code_repo_picker_activity` after the agent) is fine occasionally, alarming if dominant.-- **Slack smoke test.** In a channel with the app and >1 connected repo, `@PostHog Code` a message that doesn't name a repo (e.g. "investigate the failing checkout test"). A 🔍 reaction within ~10–60s means the agent ran; the task starting on a real repo means it picked one. A picker on a clear request = something's off.+- **Slack smoke test.** In a channel with the app and >1 connected repo, `@PostHog Desktop` a message that doesn't name a repo (e.g. "investigate the failing checkout test"). A 🔍 reaction within ~10–60s means the agent ran; the task starting on a real repo means it picked one. A picker on a clear request = something's off.## Running tests locallydiff --git a/posthog/temporal/ai/__init__.py b/posthog/temporal/ai/__init__.pyindex 45f107b263a1..05e1ee168f62 100644--- a/posthog/temporal/ai/__init__.py+++ b/posthog/temporal/ai/__init__.py@@ -30,7 +30,7 @@ from .sync_vectors import (get_approximate_actions_count,)-# PostHog Code Slack workflows live on TASKS_TASK_QUEUE alongside ProcessTaskWorkflow,+# PostHog Desktop Slack workflows live on TASKS_TASK_QUEUE alongside ProcessTaskWorkflow,# the worker they hand off to once a repo is picked. The subset is kept exported so# start_temporal_worker can register it on that queue without pulling in unrelated AI# workflows.diff --git a/posthog/temporal/ai/slack_app/activities/task_creation.py b/posthog/temporal/ai/slack_app/activities/task_creation.pyindex ecbd6b4b024f..0ef465096a9e 100644--- a/posthog/temporal/ai/slack_app/activities/task_creation.py+++ b/posthog/temporal/ai/slack_app/activities/task_creation.py@@ -575,7 +575,7 @@ def create_posthog_code_task_for_repo_activity(from products.slack_app.backend.services.slack_user_info import get_slack_user_info # noqa: PLC0415user_text = decode_slack_event_text(slack, integration, event.get("text", ""))- # Title is shown in PostHog Code's UI (task lists, PR titles) where the+ # Title is shown in PostHog Desktop's UI (task lists, PR titles) where the# labeled `<@U…|name>` form would render as literal noise; the description# keeps the labeled form so the agent can echo tokens back as real pings.title_text = labeled_mentions_to_display_names(user_text)diff --git a/posthog/temporal/oauth.py b/posthog/temporal/oauth.pyindex 07374930b24a..c92cd4650793 100644--- a/posthog/temporal/oauth.py+++ b/posthog/temporal/oauth.py@@ -40,7 +40,7 @@ INTERNAL_SCOPES: list[str] = [# Provenance marker: proves a token was minted here (server-side), not obtained by a# user via the consent flow or a personal API key. `internal_run` is an internal scope,# so it's rejected by every user-facing scope validator and can't be forged. The LLM- # gateway requires it on the internal products that share the PostHog Code OAuth app+ # gateway requires it on the internal products that share the PostHog Desktop OAuth app# (background_agents, signals, slack_app, conversations) so a user's own OAuth token# can't route around the posthog_code free-tier model gate through those."internal_run:read",diff --git a/posthog/urls.py b/posthog/urls.pyindex 423fd3ce01f3..d8d7eafae097 100644--- a/posthog/urls.py+++ b/posthog/urls.py@@ -756,7 +756,7 @@ frontend_unauthenticated_routes = ["organization/confirm-creation","login","unsubscribe",- # Public bridge for desktop-app canvas share links — deep-links into PostHog Code.+ # Public bridge for desktop-app canvas share links — deep-links into PostHog Desktop.r"code/canvas/[^/]+/[^/]+","verify_email",r"agentic/account-mismatch",diff --git a/products/agent_platform/backend/kernel_skills/auditing-the-fleet/SKILL.md b/products/agent_platform/backend/kernel_skills/auditing-the-fleet/SKILL.mdindex 1775f882e18c..d44be4c52bd9 100644--- a/products/agent_platform/backend/kernel_skills/auditing-the-fleet/SKILL.md+++ b/products/agent_platform/backend/kernel_skills/auditing-the-fleet/SKILL.md@@ -29,8 +29,8 @@ single-agent flow:1. **A human is reachable.** Ask a clarifying question if the scope isambiguous (whole fleet vs a subset, time window). The `focus_*` /- `toast` client tools work when the user is in PostHog Code — use- them to follow along as you sweep; outside PostHog Code they degrade+ `toast` client tools work when the user is in PostHog Desktop — use+ them to follow along as you sweep; outside PostHog Desktop they degradeto text. Don't use `set_secret` mid-sweep — credential fixes arerecommendations for the user to action after (see step 4).2. **No promotes, ever — propose, don't dispose.** Even with the userdiff --git a/products/agent_platform/backend/kernel_skills/safety-and-boundaries/SKILL.md b/products/agent_platform/backend/kernel_skills/safety-and-boundaries/SKILL.mdindex b2536b8577fe..1f595406207a 100644--- a/products/agent_platform/backend/kernel_skills/safety-and-boundaries/SKILL.md+++ b/products/agent_platform/backend/kernel_skills/safety-and-boundaries/SKILL.md@@ -120,7 +120,7 @@ You **never** add public auth without:agent — those verify shared secrets / signing headersindependently of the per-trigger `auth.modes` and **do notneed public auth** to work.- - The user wants PostHog Code + MCP access — that's+ - The user wants PostHog Desktop + MCP access — that's`posthog_internal` + `posthog`, not public.- The user wants the chat trigger to work from inside thePostHog app — `posthog` covers it.@@ -166,7 +166,7 @@ injection could have steered it). You then pick **who** decides via- **`principal`** (the default) — the person who drove the session decides,in-place: a Slack **Approve / Reject** button in the thread, or the- approval card in PostHog Code. This is a _generic identity match_ (the+ approval card in PostHog Desktop. This is a _generic identity match_ (thedecider must be the session's own principal) — it works for a Slack orembedded-app user with no PostHog account. Use it for the common case:an in-the-loop confirmation of a reversible-ish, driver-authoritativediff --git a/products/agent_platform/backend/kernel_skills/using-the-console-ui/SKILL.md b/products/agent_platform/backend/kernel_skills/using-the-console-ui/SKILL.mdindex 4a5aed087bd9..196abdc0bbb0 100644--- a/products/agent_platform/backend/kernel_skills/using-the-console-ui/SKILL.md+++ b/products/agent_platform/backend/kernel_skills/using-the-console-ui/SKILL.md@@ -1,13 +1,13 @@---name: using-the-console-ui-description: How to drive PostHog Code's read panel as the user works with you — focus_* etiquette, when to call toast, how to handle 'follow mode' being off. Load when the session client kind is `posthog-code`.+description: How to drive PostHog Desktop's read panel as the user works with you — focus_* etiquette, when to call toast, how to handle 'follow mode' being off. Load when the session client kind is `posthog-code`.agents:- agent-builder----# Skill — using the PostHog Code UI+# Skill — using the PostHog Desktop UI-How to drive PostHog Code's read panel while you work, so+How to drive PostHog Desktop's read panel while you work, sothe user always sees what you're working on. Load when`client.kind` is `posthog-code`.@@ -20,15 +20,15 @@ the user always sees what you're working on. Load when| `focus_revision` | Open one revision in the configuration panel | About to inspect / diff a specific revision || `focus_session` | Open one session in the sessions panel | About to fetch a session's conversation or event log || `focus_spec_section` | Jump to a section of the spec (`tools` / `skills` / `triggers` / `secrets` / `limits`) | Discussing one part of the spec specifically |-| `toast` | Surfaces a transient status notification in PostHog Code | Sparingly — for long-running tool calls, or to flag something the user should look at |+| `toast` | Surfaces a transient status notification in PostHog Desktop | Sparingly — for long-running tool calls, or to flag something the user should look at || `set_secret` | Render an inline form for the user to enter a secret value, scoped to one key on one agent | Whenever you need a credential set or rotated. See `secrets-and-integrations` for the loop |All are no-ops if the client doesn't handle them; the runner hides-them from your tool surface. If they're in your tool list, PostHog Code+them from your tool surface. If they're in your tool list, PostHog Desktopis on the other end.`set_secret` is the first **render-style, interactive** client tool — instead-of running a synchronous handler, PostHog Code mounts a UI inside+of running a synchronous handler, PostHog Desktop mounts a UI insidethe tool-call card and the runner parks the session while the userfills it in. Your call returns a synthetic `{queued:true, interactive:true, call_id}`envelope immediately; end the turn cleanly and the real outcome@@ -122,7 +122,7 @@ a tool result you should react to.## When the user steers via the read panel-PostHog Code lets the user click around the read panel+PostHog Desktop lets the user click around the read panelindependently. If the user says "I just opened revisions, canyou compare r_old and r_new?", they have navigated themselves —you can pick up from there without focusing first. But still@@ -150,17 +150,17 @@ The user's experience: text appears, panel transitions to therevision view, a moment later the chat shows the summary. Threebeats, all in one turn.-## Deep links PostHog Code understands+## Deep links PostHog Desktop understands-PostHog Code reads its full view state from URL params, so you can hand+PostHog Desktop reads its full view state from URL params, so you can handthe user a link to a specific surface and trust they'll land where youwant them to. The two patterns that are load-bearing today:-| Goal | URL | Notes |-| --------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |-| Open the agent's connections / secrets | `/agents/<slug>/connections` | Just lands on the tab. Use as a fallback when there's no specific key yet. |-| Open the secret editor for one key | `/agents/<slug>/connections?edit_secret=<KEY>` | Opens the modal pre-targeted. Don't `focus_tab` to the connections tab and _also_ tell them to edit — pick one channel. |-| Same, with a callback into THIS session | `/agents/<slug>/connections?edit_secret=<KEY>&callback_session=<session_id>` | PostHog Code fires a synthetic `[system]` user turn back to `<session_id>` after they save. You wait silently. See `secrets-and-integrations`. |+| Goal | URL | Notes |+| --------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |+| Open the agent's connections / secrets | `/agents/<slug>/connections` | Just lands on the tab. Use as a fallback when there's no specific key yet. |+| Open the secret editor for one key | `/agents/<slug>/connections?edit_secret=<KEY>` | Opens the modal pre-targeted. Don't `focus_tab` to the connections tab and _also_ tell them to edit — pick one channel. |+| Same, with a callback into THIS session | `/agents/<slug>/connections?edit_secret=<KEY>&callback_session=<session_id>` | PostHog Desktop fires a synthetic `[system]` user turn back to `<session_id>` after they save. You wait silently. See `secrets-and-integrations`. |Get `<session_id>` from `get_context` — it's the `session_id`field on the envelope. Don't try to derive it any other way; you@@ -184,7 +184,7 @@ wall of text.If a `focus_*` call returns `client_tool_unsupported` (unexpected— should have been hidden from your surface), behave as if yougot `focused: false`. Don't crash; fall back to text narration.-This shouldn't happen, but a buggy PostHog Code version might.+This shouldn't happen, but a buggy PostHog Desktop version might.## The "screen-sharing" mental modeldiff --git a/products/agent_platform/backend/kernel_skills/working-outside-the-console/SKILL.md b/products/agent_platform/backend/kernel_skills/working-outside-the-console/SKILL.mdindex 0c3e95366b17..3368f710d78b 100644--- a/products/agent_platform/backend/kernel_skills/working-outside-the-console/SKILL.md+++ b/products/agent_platform/backend/kernel_skills/working-outside-the-console/SKILL.md@@ -5,17 +5,17 @@ agents:- agent-builder----# Skill — working outside PostHog Code+# Skill — working outside PostHog DesktopHow to be useful when there is no UI — load when the session-reports a non-PostHog-Code client kind (Claude Code, Cursor, MCP+reports a non-PostHog-Desktop client kind (Claude Code, Cursor, MCPInspector, or any unknown shape) or when none of the `focus_*` /`toast` client tools are in your tool surface. Without clienttools, every navigation has to happen in text.-## What changes vs PostHog Code+## What changes vs PostHog Desktop-| Capability | PostHog Code | MCP / IDE |+| Capability | PostHog Desktop | MCP / IDE || ---------------------------------------- | ------------------------------------- | ------------------------------------------- || User sees the artifact you're working on | Yes — `focus_*` tools drive the panel | No — the user sees only your text || User can context-switch by clicking | Yes — they can wander | No — the conversation IS the navigation |@@ -26,7 +26,7 @@ tools, every navigation has to happen in text.The biggest shift: **the user has zero visibility into theartifacts you call MCP tools against unless you put them intext.** A `posthog__agent-applications-revisions-bundle-retrieve` that-returns 5 files in PostHog Code can be opened in the panel; over+returns 5 files in PostHog Desktop can be opened in the panel; overMCP, you have to summarize.## Compensating moves@@ -40,7 +40,7 @@ browser at app.posthog.com, a curl) if they want to verify.> Reading `weekly-digest` (id `app_abc123`), live revision> `r_xyz789`, file `agent.md` (87 lines, last edited 2026-05-12).-vs the PostHog Code-friendly equivalent:+vs the PostHog Desktop-friendly equivalent:> Opening weekly-digest's live revision in the panel.@@ -69,7 +69,7 @@ Don't dump the file unprompted — offer to.### 3. Tighter sequencing-In PostHog Code, you can fire multiple MCP calls in one turn+In PostHog Desktop, you can fire multiple MCP calls in one turnbecause the user is watching the panel transitions. Over MCP, asingle turn that fires 5 tool calls produces a single text replythat has to summarize all 5. Prefer:@@ -79,26 +79,26 @@ that has to summarize all 5. Prefer:- "Want me to also pull X?" as a question, not as another toolcall-## Detecting that you're outside PostHog Code+## Detecting that you're outside PostHog DesktopLook at the session-start info event — it reports the clientkind. Treat it as a hint, not a contract:-- A PostHog Code client (web app, dock) → PostHog Code+- A PostHog Desktop client (web app, dock) → PostHog Desktop- An IDE / MCP client (Claude Code, Cursor, MCP Inspector, etc.)→ text-only mode- A Slack client → Slack (use the slack flow instead, not thisskill — but slack isn't in v0 spec, so this won't fire today)-- Unknown or missing → assume non-PostHog-Code / MCP, since text-only+- Unknown or missing → assume non-PostHog-Desktop / MCP, since text-onlyis the safer defaultThe reliable signal is your own tool surface: if the `focus_*`-and `toast` client tools are present you're in PostHog Code; if+and `toast` client tools are present you're in PostHog Desktop; ifthey're absent, you're not.## MCP-specific affordances you DO have-The MCP transport exposes things PostHog Code doesn't always:+The MCP transport exposes things PostHog Desktop doesn't always:- **The `Mcp-Session-Id` header** — the connecting MCP client'ssession id. Multiple chat-trigger sessions from the same MCP@@ -114,12 +114,12 @@ The MCP transport exposes things PostHog Code doesn't always:have a "stop generating" button. The runner gets the cancelsignal cleanly.-## When the user asks for something only PostHog Code can do+## When the user asks for something only PostHog Desktop can doE.g. "show me the file tree visually" or "click that button". Bedirect:-> The file tree view is a PostHog Code-only thing — you're connected+> The file tree view is a PostHog Desktop-only thing — you're connected> via MCP. I can list the file paths in text instead:>> - agent.md@@ -127,7 +127,7 @@ direct:> - skills/slack-thread-protocol.md> - tests/happy-path.json>-> Or, if you want the visual view, open PostHog Code+> Or, if you want the visual view, open PostHog Desktop> → weekly-digest → bundle.Don't pretend you can drive a UI that isn't there.@@ -155,6 +155,6 @@ mostly apply (text-only) but with Slack-specific formatting:- Stay terse — channel signal-to-noise matters- Always thread your replies under the triggering message- Don't paste long bundle contents in channel — link to- PostHog Code / DM instead+ PostHog Desktop / DM insteadUntil the slack trigger lands, you won't see this client kind.diff --git a/products/agent_platform/backend/presentation/views.py b/products/agent_platform/backend/presentation/views.pyindex 5c9d9ece58e3..8febb94916f0 100644--- a/products/agent_platform/backend/presentation/views.py+++ b/products/agent_platform/backend/presentation/views.py@@ -2036,7 +2036,7 @@ class AgentApplicationViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):if approval_type != "agent":raise NotFound("Approval not found")# A human acting interactively only: SessionAuthentication, or a bearer- # from a first-party PostHog OAuth app (e.g. PostHog Code, where a human+ # from a first-party PostHog OAuth app (e.g. PostHog Desktop, where a human# approves in-app) — `is_first_party` is staff-set on the app, so a# third-party OAuth app or a personal API key can't decide an owner# approval.diff --git a/products/agent_platform/backend/tests/test_approvals_api.py b/products/agent_platform/backend/tests/test_approvals_api.pyindex 43232ec83430..6cc9eea641e1 100644--- a/products/agent_platform/backend/tests/test_approvals_api.py+++ b/products/agent_platform/backend/tests/test_approvals_api.py@@ -232,7 +232,7 @@ class TestApprovalEndpointsAuth(APIBaseTest):)# An `agent` (owner) decision requires a human acting interactively. Only a- # first-party PostHog OAuth app (e.g. PostHog Code, where a human approves+ # first-party PostHog OAuth app (e.g. PostHog Desktop, where a human approves# in-app) qualifies; a third-party OAuth app is rejected even with a broad# `*` scope — the gate keys off the app's staff-set `is_first_party` flag,# not the token scope.diff --git a/products/agent_platform/services/agent-ingress/src/routing/server.ts b/products/agent_platform/services/agent-ingress/src/routing/server.tsindex 3ecb02545ab3..99c19582decf 100644--- a/products/agent_platform/services/agent-ingress/src/routing/server.ts+++ b/products/agent_platform/services/agent-ingress/src/routing/server.ts@@ -431,7 +431,7 @@ export function buildApp(opts: BuildAppOpts): Express {}// Principal tool-approval decisions — the lightweight, identity-matched- // counterpart to the Slack interactivity handler, for posthog (PostHog Code)+ // counterpart to the Slack interactivity handler, for posthog (PostHog Desktop)// and jwt principals. Authenticated by the same verifier the agent's// chat/mcp trigger uses, then required to BE the session principal — a// generic identity match, NOT a PostHog-authority check. `agent`-type@@ -442,7 +442,7 @@ export function buildApp(opts: BuildAppOpts): Express {edited_args: z.record(z.string(), z.unknown()).optional(),})// Mount-relative (like the trigger routes) so a client appends it to the- // same per-agent ingress base it uses for `/send` (PostHog Code does). The+ // same per-agent ingress base it uses for `/send` (PostHog Desktop does). The// `:slug` is unused — the row is resolved from the approval id, not the// slug — but keeping the path under the mount matches how clients address// the ingress. In domain mode the root mount makes it `/approvals/:id/decide`.diff --git a/products/agent_platform/services/agent-runner/src/config.ts b/products/agent_platform/services/agent-runner/src/config.tsindex a8ec75640deb..0da782c51256 100644--- a/products/agent_platform/services/agent-runner/src/config.ts+++ b/products/agent_platform/services/agent-runner/src/config.ts@@ -113,7 +113,7 @@ export const AgentRunnerConfigSchema = PlatformConfigSchema.extend({.string().default(isDev() ? 'posthog-code-dev' : 'posthog-code').describe(- 'Custom-protocol scheme that PostHog Code registers for deep links (the agent console now lives in the PostHog Code app). Used to build clickable approval links (`<scheme>://approval/<id>`) surfaced to the model on a gated tool call so non-PostHog-Code clients (Slack, MCP) can open the approval in the desktop app. Dev → `posthog-code-dev`, prod → `posthog-code`.'+ 'Custom-protocol scheme that PostHog Desktop registers for deep links (the agent console now lives in the PostHog Desktop app). Used to build clickable approval links (`<scheme>://approval/<id>`) surfaced to the model on a gated tool call so non-PostHog-Desktop clients (Slack, MCP) can open the approval in the desktop app. Dev → `posthog-code-dev`, prod → `posthog-code`.'),memoryS3Endpoint: requiredInProd(DEV_S3_ENDPOINT, 'AGENT_MEMORY_S3_ENDPOINT', { url: true }).describe('S3-compatible endpoint for agent-memory file storage. Required everywhere — runner refuses to start without it (fail closed at config-load in prod). Dev defaults to local SeaweedFS.'diff --git a/products/agent_platform/services/agent-runner/src/index.ts b/products/agent_platform/services/agent-runner/src/index.tsindex 885358d32035..64ff128b17c5 100644--- a/products/agent_platform/services/agent-runner/src/index.ts+++ b/products/agent_platform/services/agent-runner/src/index.ts@@ -317,13 +317,13 @@ async function main(): Promise<void> {broker: new SecretBroker(),credentialBroker,approvals,- // Clickable deep link that opens the approval in PostHog Code (the agent+ // Clickable deep link that opens the approval in PostHog Desktop (the agent// console now lives in the desktop/web app). Surfaced to the model on a// gated tool call and whatever it posts to chat / Slack. Carries the// agent slug (`?agent=<slug>`) so the approval modal can address the// slug-routed ingress directly and decide under the user's own auth — no// project-scoped lookup. Handled by the `approval` deep-link key in- // PostHog Code (posthog-code://approval/<id>?agent=<slug>).+ // PostHog Desktop (posthog-code://approval/<id>?agent=<slug>).buildApprovalUrl: (requestId, slug) =>`${config.approvalLinkScheme}://approval/${requestId}${slug ? `?agent=${encodeURIComponent(slug)}` : ''}`,bus,diff --git a/products/agent_platform/services/agent-shared/src/persistence/approval-decision.ts b/products/agent_platform/services/agent-shared/src/persistence/approval-decision.tsindex 1c10d352f7c0..727d530b131c 100644--- a/products/agent_platform/services/agent-shared/src/persistence/approval-decision.ts+++ b/products/agent_platform/services/agent-shared/src/persistence/approval-decision.ts@@ -2,7 +2,7 @@* Shared "decide a queued approval + wake its session" logic, so every decision* surface drives the same transition without one depending on another:* - the ingress principal-decision API (a Slack button / client tool / the- * PostHog Code card — the session principal clears their own gate),+ * PostHog Desktop card — the session principal clears their own gate),* - the janitor's `/approvals/:id/decide` RPC (Django forwards `agent`/owner* decisions here),* - the janitor expiry sweep (a timed-out queue, via `markRejected`/expire).diff --git a/products/agent_platform/services/agent-shared/src/runtime/identity-credential-store.ts b/products/agent_platform/services/agent-shared/src/runtime/identity-credential-store.tsindex aed290dcdf7c..91efe3e3ef1c 100644--- a/products/agent_platform/services/agent-shared/src/runtime/identity-credential-store.ts+++ b/products/agent_platform/services/agent-shared/src/runtime/identity-credential-store.ts@@ -6,7 +6,7 @@** This is the SOURCE of truth (long-lived, revocable). At tool-call time the* runner resolves the current asker's link from here via `ctx.identity.resolve`- * (see `createToolIdentity`); a trigger-edge bearer (e.g. PostHog Code passing a+ * (see `createToolIdentity`); a trigger-edge bearer (e.g. PostHog Desktop passing a* posthog token) is the alternative source, held in the per-session* `CredentialBroker` and consulted first by the resolver. Tokens never leave* the runner process beyond the outbound API call.diff --git a/products/agent_platform/services/agent-shared/src/runtime/identity-gate.test.ts b/products/agent_platform/services/agent-shared/src/runtime/identity-gate.test.tsindex a46bf97e40e8..f54b206f61bc 100644--- a/products/agent_platform/services/agent-shared/src/runtime/identity-gate.test.ts+++ b/products/agent_platform/services/agent-shared/src/runtime/identity-gate.test.ts@@ -81,7 +81,7 @@ describe('buildIdentityRegistry', () => {})describe('createToolIdentity.resolve', () => {- it('returns the trigger-edge seed without touching the store or initiating a link (PostHog Code passthrough)', async () => {+ it('returns the trigger-edge seed without touching the store or initiating a link (PostHog Desktop passthrough)', async () => {const provider = fakeProvider()const seed = { resolve: vi.fn(async (t: string) => (t === 'posthog_api' ? OK_CRED : null)) }const { toolIdentity } = deps({ provider, seed })diff --git a/products/agent_platform/services/agent-shared/src/runtime/identity-gate.ts b/products/agent_platform/services/agent-shared/src/runtime/identity-gate.tsindex 7754f2e048da..50bc3a9609cf 100644--- a/products/agent_platform/services/agent-shared/src/runtime/identity-gate.ts+++ b/products/agent_platform/services/agent-shared/src/runtime/identity-gate.ts@@ -174,7 +174,7 @@ export interface ToolIdentityDeps {/*** Trigger-edge credential source — the per-session broker, narrowed to a* single `resolve(target)`. Consulted (by `provider.credentialTarget`)- * BEFORE the persistent linked store: this is the PostHog Code passthrough+ * BEFORE the persistent linked store: this is the PostHog Desktop passthrough* (a `posthog` principal's bearer seeded at /run) and any other auth that* was established at the trigger edge rather than via an OAuth link.*/@@ -249,7 +249,7 @@ export function createToolIdentity(deps: ToolIdentityDeps): {if (!provider) {return emit({ kind: 'unavailable', provider: providerId, reason: 'unknown_provider' }, 'unavailable')}- // Trigger-edge seed (PostHog Code passthrough), keyed by target.+ // Trigger-edge seed (PostHog Desktop passthrough), keyed by target.if (deps.seed) {const seeded = await deps.seed.resolve(provider.credentialTarget)if (seeded) {@@ -344,7 +344,7 @@ export interface BuildAskerIdentityDeps {* same edge-seed wiring).** Always registers an implicit seed-only PostHog provider when no- * `{kind:posthog}` provider is declared, so a PostHog Code session resolves the+ * `{kind:posthog}` provider is declared, so a PostHog Desktop session resolves the* trigger-edge bearer for `posthog` without the agent having to declare/provision* an OAuthApplication it never links against.*/diff --git a/products/agent_platform/services/agent-shared/src/runtime/mcp-connection-store.test.ts b/products/agent_platform/services/agent-shared/src/runtime/mcp-connection-store.test.tsindex 44fda9fd3a7f..82cc302f7b98 100644--- a/products/agent_platform/services/agent-shared/src/runtime/mcp-connection-store.test.ts+++ b/products/agent_platform/services/agent-shared/src/runtime/mcp-connection-store.test.ts@@ -177,7 +177,7 @@ describe('PgMcpConnectionStore', () => {expect(String(http.calls[0].init?.body)).toContain('grant_type=refresh_token')expect(String(http.calls[0].init?.body)).toContain('client_id=client-1')- // Wrote back, in the per-leaf-encrypted format Django/PostHog Code reads.+ // Wrote back, in the per-leaf-encrypted format Django/PostHog Desktop reads.expect(writes).toHaveLength(1)const written = enc.decryptJsonFieldValue(JSON.parse(writes[0].values[0] as string)) as Record<string, unknown>expect(written.access_token).toBe('tok-2')diff --git a/products/agent_platform/services/agent-shared/src/runtime/posthog-identity-provider.ts b/products/agent_platform/services/agent-shared/src/runtime/posthog-identity-provider.tsindex 7d3811cde977..9c9ba1aeb6a2 100644--- a/products/agent_platform/services/agent-shared/src/runtime/posthog-identity-provider.ts+++ b/products/agent_platform/services/agent-shared/src/runtime/posthog-identity-provider.ts@@ -9,7 +9,7 @@* resolves the PostHog user behind a Slack principal from that subject.* 3. `credentialTarget = 'posthog_api'` — the broker key the native* `@posthog/*` tools resolve under, and the key `createToolIdentity`- * consults for the trigger-edge seed (PostHog Code passthrough). The+ * consults for the trigger-edge seed (PostHog Desktop passthrough). The* linked-credential store stays keyed by the provider `id` (default* `posthog`); both axes resolve to the same logical PostHog bearer.*@@ -59,7 +59,7 @@ export class PostHogAuthProvider extends Oauth2AuthProvider {// (read by the inherited `fetchSubject`) as the credential subject.override readonly establishesIdentity = true- // The edge seed (PostHog Code's posthog bearer) and the native `@posthog/*`+ // The edge seed (PostHog Desktop's posthog bearer) and the native `@posthog/*`// tools both key off `posthog_api`; the linked store stays keyed by `id`.override get credentialTarget(): string {return 'posthog_api'@@ -71,7 +71,7 @@ export class PostHogAuthProvider extends Oauth2AuthProvider {}/**- * Surfaces the trigger-edge PostHog bearer (PostHog Code passthrough) but can't+ * Surfaces the trigger-edge PostHog bearer (PostHog Desktop passthrough) but can't* link. Registered implicitly when no `{kind:posthog}` provider is declared, so a* posthog-principal session resolves `posthog` without provisioning an* OAuthApplication. With no seed and no link, `resolve()` is null and `initiate()`diff --git a/products/agent_platform/services/agent-shared/src/spec/spec.ts b/products/agent_platform/services/agent-shared/src/spec/spec.tsindex 5290db81b33c..cf76dd75eac9 100644--- a/products/agent_platform/services/agent-shared/src/spec/spec.ts+++ b/products/agent_platform/services/agent-shared/src/spec/spec.ts@@ -358,7 +358,7 @@ export const TriggerSchema = z.discriminatedUnion('type', [* uuid == the session principal), NOT a PostHog-authority check, so it works* for a Slack or embedded-app asker with no PostHog account. Decided via the* lightweight ingress decision API (a Slack button, a client tool, or the- * PostHog Code approval card).+ * PostHog Desktop approval card).* - `agent` — the agent's owning-team admins (org-membership ADMIN level on* the owning team; see Django `_require_team_admin`). The one intrinsically-* PostHog authority; decided only in the authenticated console / approvalsdiff --git a/products/agent_platform/services/agent-tests/src/cases/example-agent-builder.test.ts b/products/agent_platform/services/agent-tests/src/cases/example-agent-builder.test.tsindex 8a8e78c79b82..eaefb6144599 100644--- a/products/agent_platform/services/agent-tests/src/cases/example-agent-builder.test.ts+++ b/products/agent_platform/services/agent-tests/src/cases/example-agent-builder.test.ts@@ -4,7 +4,7 @@* The Agent Builder authors + operates other agents through the PostHog MCP* (one `spec.mcps[]` entry authed by the trigger-edge PostHog bearer), acting* as the asking user. It keeps only its own runtime natives (`@posthog/memory-*`- * plus `@posthog/web-search`) and the PostHog Code client/UI tools. Destructive authoring ops+ * plus `@posthog/web-search`) and the PostHog Desktop client/UI tools. Destructive authoring ops* (`promote` / `archive` / `destroy`) are approval-gated on the MCP `tools[]`* via `level: 'approve'` + `approval_policy`, so the platform — not* just the prompt — holds them. This case pins that wiring net; drift here@@ -110,7 +110,7 @@ describe('example: agent-builder bundle', () => {it('uses trigger-edge PostHog auth without provisioning a second OAuth connection', async () => {const { spec, files } = await loadBundle()const parsed = AgentSpecSchema.parse(spec)- // PostHog Code already seeds `posthog_api` from trigger auth. An empty+ // PostHog Desktop already seeds `posthog_api` from trigger auth. An empty// list selects the implicit seed-only provider instead of offering a// redundant OAuth connection that cannot improve the session identity.expect(parsed.identity_providers).toEqual([])diff --git a/products/agent_platform/services/agent-tests/src/cases/posthog-tool-auth.test.ts b/products/agent_platform/services/agent-tests/src/cases/posthog-tool-auth.test.tsindex 83dd6d4cc274..468741e600ed 100644--- a/products/agent_platform/services/agent-tests/src/cases/posthog-tool-auth.test.ts+++ b/products/agent_platform/services/agent-tests/src/cases/posthog-tool-auth.test.ts@@ -140,7 +140,7 @@ describe('PostHog tools: act as the calling user, not the agent team', () => {{kind: 'client',id: 'get_context',- description: 'Read the current PostHog Code context.',+ description: 'Read the current PostHog Desktop context.',args_schema: { type: 'object', properties: {}, additionalProperties: false },},],diff --git a/products/agent_platform/services/agent-tests/src/examples/agent-approval-demo/README.md b/products/agent_platform/services/agent-tests/src/examples/agent-approval-demo/README.mdindex 3915d978b6bb..764672376b8e 100644--- a/products/agent_platform/services/agent-tests/src/examples/agent-approval-demo/README.md+++ b/products/agent_platform/services/agent-tests/src/examples/agent-approval-demo/README.md@@ -53,8 +53,8 @@ authoring API the same way the Agent Builder fixture does.## Driving the demo-1. Open PostHog Code and go to the agents view (the agent console now- lives in the PostHog Code app).+1. Open PostHog Desktop and go to the agents view (the agent console now+ lives in the PostHog Desktop app).2. Open the playground for `agent-approval-demo`.3. Send: `save this note: hello world`.4. The agent should propose `memory-write` → the dispatcher gates →diff --git a/products/agent_platform/services/agent-tests/src/examples/agent-builder/README.md b/products/agent_platform/services/agent-tests/src/examples/agent-builder/README.mdindex 9ef8ffd3a5be..a1da0025dd83 100644--- a/products/agent_platform/services/agent-tests/src/examples/agent-builder/README.md+++ b/products/agent_platform/services/agent-tests/src/examples/agent-builder/README.md@@ -1,7 +1,7 @@# Agent Builder — the meta-agent for the platformThe "explain, debug, edit" assistant for every agent on the-PostHog agent platform. One deployment, two surfaces (PostHog Code+PostHog agent platform. One deployment, two surfaces (PostHog Desktopchat dock, MCP from Claude Code / Cursor),all acting under the user's PostHog OAuth principal.@@ -84,7 +84,7 @@ agent-builder/| MCP (authoring) | `agent-applications-*` (list, retrieve, revisions, sessions, logs + the draft edit + validate verbs) | The bulk of its work — read + write agent state as the connected user, via the one `spec.mcps` entry (PostHog MCP, `posthog` identity provider). Curated `tools[]` allow-list; `promote` / `archive` / `destroy` are approval-gated. || MCP (telemetry) | `execute-sql`, `insight-query`, `get-llm-total-costs-for-project` | HogQL / insights over the agent's LLM-observability events (`$ai_generation` / `$ai_span` / `$ai_trace`) the runner captured into the team's project. Powers debug + improve evidence. || Native (runtime) | `@posthog/memory-search`, `@posthog/memory-read`, `@posthog/memory-write`, `@posthog/web-search` | The agent's own runtime tools — durable memory (persist a fleet-audit report) and web search. |-| Client | `focus_tab`, `focus_file`, `focus_revision`, `focus_session`, `focus_spec_section`, `toast`, `get_context`, `set_secret`, `connect_mcp` | Drive PostHog Code's read panel + read the user's current view. No-op outside PostHog Code. |+| Client | `focus_tab`, `focus_file`, `focus_revision`, `focus_session`, `focus_spec_section`, `toast`, `get_context`, `set_secret`, `connect_mcp` | Drive PostHog Desktop's read panel + read the user's current view. No-op outside PostHog Desktop. |## Auth model@@ -92,7 +92,7 @@ Auth is configured **per trigger** — there is no top-level`spec.auth`. Both Agent Builder entrypoints require the user-scoped`posthog` mode:-1. **PostHog Code** — user signs into the PostHog Code app via+1. **PostHog Desktop** — user signs into the PostHog Desktop app viaPostHog OAuth. The app sends that OAuth access token to the chattrigger. Every tool call runs as the user without a separate MCPsign-in.@@ -103,7 +103,7 @@ Auth is configured **per trigger** — there is no top-levelThe Agent Builder holds no fallback credential.The Agent Builder accepts only `posthog` auth on both chat and MCP entrypoints.-For chat, PostHog Code sends the signed-in user's OAuth bearer on `/run` and+For chat, PostHog Desktop sends the signed-in user's OAuth bearer on `/run` and`/send`; ingress validates it and stores it as the session's `posthog_api`credential. The runner forwards that same bearer to the first-party MCP, sothere is no second interactive OAuth flow. A browser session cookie cannot be@@ -119,7 +119,7 @@ platform's seed-only PostHog provider, so there is no account-linking path and nsecond OAuth flow.The Agent Builder chat therefore does not use the ingress OAuth callback route.-PostHog Code supplies the signed-in user's OAuth access token at the trigger+PostHog Desktop supplies the signed-in user's OAuth access token at the triggeredge, and the runner passes that credential to the first-party MCP. The`/link/<provider>/callback` flow exists for agents that intentionally supportconnecting an additional identity.@@ -182,7 +182,7 @@ agent-applications-revisions-promote-create revision_id=<rid>The Agent Builder lives in **PostHog's primary org** so it'savailable to every team via the standard MCP / chat ingress. Eachtrigger's `auth.modes: [posthog]` means every request must carry a-verified user credential. PostHog Code supplies the user's OAuth+verified user credential. PostHog Desktop supplies the user's OAuthaccess token to chat; standalone MCP clients supply a user PAT.## Regression testdiff --git a/products/agent_platform/services/agent-tests/src/examples/agent-builder/agent.md b/products/agent_platform/services/agent-tests/src/examples/agent-builder/agent.mdindex fce108188ce3..2ff029849991 100644--- a/products/agent_platform/services/agent-tests/src/examples/agent-builder/agent.md+++ b/products/agent_platform/services/agent-tests/src/examples/agent-builder/agent.md@@ -8,22 +8,22 @@ expert who helps build them.## Who you talk to-| Surface | Detect via | Capabilities |-| ---------------- | --------------------------------------------- | ------------------------------------------ |-| **PostHog Code** | `client.kind` is `posthog-code` | `focus_*`, `toast`, `set_secret` punch-out |-| **MCP / IDE** | trigger is `mcp`, or `client.kind` is `mcp:*` | text only — no UI |+| Surface | Detect via | Capabilities |+| ------------------- | --------------------------------------------- | ------------------------------------------ |+| **PostHog Desktop** | `client.kind` is `posthog-code` | `focus_*`, `toast`, `set_secret` punch-out |+| **MCP / IDE** | trigger is `mcp`, or `client.kind` is `mcp:*` | text only — no UI |-If you can call `focus_tab`, you are in PostHog Code. If calling it+If you can call `focus_tab`, you are in PostHog Desktop. If calling itreturns `client_tool_unsupported`, you are not — fall back tospelling out paths in text.-Load `skills/using-the-console-ui` when in PostHog Code. Load+Load `skills/using-the-console-ui` when in PostHog Desktop. Load`skills/working-outside-the-console` otherwise. Do this on thefirst turn.## The context envelope-When the user is in PostHog Code, their **first** message of+When the user is in PostHog Desktop, their **first** message ofeach session is prefixed with a small JSON envelope describing whatthey're currently looking at:@@ -39,7 +39,7 @@ Use it to resolve deictic references — "this agent", "this session","the one I'm looking at" — without asking. The envelope is **not**part of the user's message; do not echo it back, do not quote it,do not treat its absence as an error. It only appears on the first-turn of PostHog Code-originated sessions.+turn of PostHog Desktop-originated sessions.If the envelope is missing (MCP / IDE clients, or follow-up turns)and the user uses a deictic reference, ask which agent / session@@ -117,7 +117,7 @@ one, refuse and explain why.1. **Act as the asking user — never as PostHog.** Every PostHog MCPcall runs with the asking user's PostHog identity. You hold- no fallback credential. In PostHog Code / MCP the bearer passes+ no fallback credential. In PostHog Desktop / MCP the bearer passesthrough from the trigger (see "Acting as the user").Never ask the user to connect or reconnect PostHog for the Builder'sown MCP. If its tools are absent, report that the authoring capability failed to@@ -150,7 +150,7 @@ one, refuse and explain why.and act in whatever project the user is working in, never a fixedone. Get the target from `get_context` (the host reports the user'scurrent `project_id`), then set it with `posthog__switch-project`.- If `get_context` returns none (non-PostHog-Code clients) or the user+ If `get_context` returns none (non-PostHog-Desktop clients) or the usermight mean a different project, call `posthog__projects-get`, showthe options, and ask which to use before switching. Never guess.@@ -162,9 +162,9 @@ slightly nudges at one of these.You act on PostHog **as the person talking to you** — never a serviceaccount. Every `posthog__*` MCP call is signed with that user's PostHogidentity, so what you can see and change is exactly what they can.-On both of your surfaces (PostHog Code and MCP / IDE) the user's PostHog+On both of your surfaces (PostHog Desktop and MCP / IDE) the user's PostHogbearer passes through from the trigger — they're already authenticated,-nothing to link. Never tell a PostHog Code user to connect the PostHog MCP;+nothing to link. Never tell a PostHog Desktop user to connect the PostHog MCP;if the PostHog MCP reports an auth failure there, explain that the builder'sauth passthrough is broken rather than presenting connection as expected setup.The PostHog MCP is your first-party authoring transport, not a connection the@@ -185,7 +185,7 @@ Every user turn starts with **one short line** that says what youare about to do, before any tool call. The user should never waitsilently while you're working.-- In PostHog Code: combine the line with the matching `focus_*`+- In PostHog Desktop: combine the line with the matching `focus_*`call (`focus_session`, `focus_file`, `focus_revision`,`focus_tab`, `focus_spec_section`) to the resource you're aboutto operate on, so the read panel loads alongside your message.@@ -237,7 +237,7 @@ tools) are also called directly.| PostHog MCP (telemetry) | `posthog__execute-sql`, `posthog__insight-query`, `posthog__get-llm-total-costs-for-project`, `posthog__projects-get`, `posthog__switch-project` | HogQL / insights over the agent's LLM-observability events (`$ai_generation` / `$ai_span` / `$ai_trace`) the runner captured into the team's project, plus project resolution. Use when debugging or improving an agent — fetch the `querying-ai-observability` playbook. || PostHog MCP (authoring aids) | `posthog__agent-applications-spec-schema`, `posthog__agent-native-tools-list`, `posthog__agent-applications-models`, `posthog__agent-resolve-resource` | Ground truth for building/editing: `agent-applications-spec-schema` returns the canonical spec JSON Schema (pass `section`, e.g. `models`, for one slice) — read it before hand-writing any `spec`; `agent-native-tools-list` is the catalog of valid native tool ids; `agent-applications-models` is the served-model catalog for `spec.models`; `agent-resolve-resource` is **the** source for builder playbooks — pass a playbook id and it returns the doc plus the live, scope-aware tool surface. These playbooks are not in your bundle; fetch them rather than recalling tool names. || Native (memory) | `@posthog/memory-search`, `@posthog/memory-read`, `@posthog/memory-write`, `@posthog/memory-update`, `@posthog/memory-delete` | Your own durable memory — persist a fleet-audit report, correct or remove notes the live sources have proven stale. Used by `skills/auditing-the-fleet` when a user asks for a fleet-wide sweep. |-| Client | `focus_tab`, `focus_file`, `focus_revision`, `focus_session`, `focus_spec_section`, `toast`, `get_context`, `set_secret` | Driving the PostHog Code host UI, reading the user's current view, and the secure `set_secret` punch-out. Implementation lives in the connecting client; absent (returns `unhandled_client_tool`) outside PostHog Code. |+| Client | `focus_tab`, `focus_file`, `focus_revision`, `focus_session`, `focus_spec_section`, `toast`, `get_context`, `set_secret` | Driving the PostHog Desktop host UI, reading the user's current view, and the secure `set_secret` punch-out. Implementation lives in the connecting client; absent (returns `unhandled_client_tool`) outside PostHog Desktop. |### The agent-management tools@@ -320,7 +320,7 @@ manipulated by tool (never by re-reading a list into the model's context):The win over prose memory: membership + append are O(1) on the model's contextregardless of table size, and the bytes never round-trip through inference (nolossy read-rewrite of a growing list). Reach for markdown memory for _narrative_-notes; reach for tables for _structured_ state. PostHog Code's memory tab+notes; reach for tables for _structured_ state. PostHog Desktop's memory tabsurfaces these tables read-only under a Tables view.**Wiring it into an agent you author.** Two steps when you create or edit an@@ -347,7 +347,7 @@ expect a full dump; keep one table to one purpose (a `seen` set, an### The client tools-These run in the connecting client, not on the runner. The runner emits the call, the client (the PostHog Code dock when present) executes it and posts a result back.+These run in the connecting client, not on the runner. The runner emits the call, the client (the PostHog Desktop dock when present) executes it and posts a result back.| Tool | Use it when || -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |diff --git a/products/agent_platform/services/agent-tests/src/examples/agent-builder/spec.json b/products/agent_platform/services/agent-tests/src/examples/agent-builder/spec.jsonindex 13350dcda44a..82c8e3a272a2 100644--- a/products/agent_platform/services/agent-tests/src/examples/agent-builder/spec.json+++ b/products/agent_platform/services/agent-tests/src/examples/agent-builder/spec.json@@ -62,7 +62,7 @@{"kind": "client","id": "focus_tab",- "description": "Open one of the agent detail tabs in the read panel: overview, configuration, connections, sessions, memory. Use BEFORE a corresponding read so the user's panel transitions in parallel. ALWAYS pass `slug` \u2014 `focus_*` calls never infer the target agent from the user's current page (the user navigates while you're thinking; relying on URL state silently misroutes). Returns { focused: true } or { focused: false, reason } if follow-mode is off; `unhandled_client_tool` / `client_tool_timeout` outside PostHog Code \u2014 degrade to text.",+ "description": "Open one of the agent detail tabs in the read panel: overview, configuration, connections, sessions, memory. Use BEFORE a corresponding read so the user's panel transitions in parallel. ALWAYS pass `slug` \u2014 `focus_*` calls never infer the target agent from the user's current page (the user navigates while you're thinking; relying on URL state silently misroutes). Returns { focused: true } or { focused: false, reason } if follow-mode is off; `unhandled_client_tool` / `client_tool_timeout` outside PostHog Desktop \u2014 degrade to text.","args_schema": {"type": "object","properties": {@@ -185,7 +185,7 @@"kind": "client","id": "set_secret","interactive": true,- "description": "Punch out to the user to set one secret on an agent. INTERACTIVE: this call returns a synthetic `{queued:true, interactive:true, call_id}` envelope immediately \u2014 that is NOT the user's answer. End your turn after a brief acknowledgement. The session parks; the user fills out the inline form on their own time. On a fresh turn you receive a wake message `{call_id, ok, result|error}` carrying the real outcome (`{key, action: 'set'}` on success, `user_cancelled` if they cancel). Match by `call_id`. Use this whenever an agent needs a credential set or rotated; check `agent-applications-env-keys-get` first to decide between `set` and `rotate`. The value never reaches your tool-call history \u2014 `purpose` is the only string you see. On non-PostHog-Code clients this tool returns `unhandled_client_tool` immediately \u2014 fall back to the URL handoff documented in `secrets-and-integrations`.",+ "description": "Punch out to the user to set one secret on an agent. INTERACTIVE: this call returns a synthetic `{queued:true, interactive:true, call_id}` envelope immediately \u2014 that is NOT the user's answer. End your turn after a brief acknowledgement. The session parks; the user fills out the inline form on their own time. On a fresh turn you receive a wake message `{call_id, ok, result|error}` carrying the real outcome (`{key, action: 'set'}` on success, `user_cancelled` if they cancel). Match by `call_id`. Use this whenever an agent needs a credential set or rotated; check `agent-applications-env-keys-get` first to decide between `set` and `rotate`. The value never reaches your tool-call history \u2014 `purpose` is the only string you see. On non-PostHog-Desktop clients this tool returns `unhandled_client_tool` immediately \u2014 fall back to the URL handoff documented in `secrets-and-integrations`.","args_schema": {"type": "object","properties": {@@ -213,7 +213,7 @@"kind": "client","id": "connect_mcp","interactive": true,- "description": "Punch out to the user to connect an MCP server to an agent, then reference it from the agent's spec. INTERACTIVE: returns a synthetic `{queued:true, interactive:true, call_id}` envelope immediately — that is NOT the result. End your turn after a brief acknowledgement. The session parks; the user reviews the PREFILLED connect form (you supply `name`/`url`) and completes the auth themselves — OAuth consent or an API key. You NEVER see tokens or secrets. On a fresh turn you receive a wake message `{call_id, ok, result|error}`: on success `{connected:true, connection_id, mcp_id, url}` (the agent's spec now has an `mcps[]` entry with `connection: connection_id` — one shared credential for every asker of that agent), or `user_cancelled`. Match by `call_id`. Use this whenever the user wants the agent to use a third-party MCP server (e.g. incident.io, Linear). Prefill `url` with the server's MCP endpoint when you know it. Only offered where the client can render the form (declared in the session's `supported_client_tools`, e.g. PostHog Code); on other surfaces it isn't exposed.",+ "description": "Punch out to the user to connect an MCP server to an agent, then reference it from the agent's spec. INTERACTIVE: returns a synthetic `{queued:true, interactive:true, call_id}` envelope immediately — that is NOT the result. End your turn after a brief acknowledgement. The session parks; the user reviews the PREFILLED connect form (you supply `name`/`url`) and completes the auth themselves — OAuth consent or an API key. You NEVER see tokens or secrets. On a fresh turn you receive a wake message `{call_id, ok, result|error}`: on success `{connected:true, connection_id, mcp_id, url}` (the agent's spec now has an `mcps[]` entry with `connection: connection_id` — one shared credential for every asker of that agent), or `user_cancelled`. Match by `call_id`. Use this whenever the user wants the agent to use a third-party MCP server (e.g. incident.io, Linear). Prefill `url` with the server's MCP endpoint when you know it. Only offered where the client can render the form (declared in the session's `supported_client_tools`, e.g. PostHog Desktop); on other surfaces it isn't exposed.","args_schema": {"type": "object","properties": {diff --git a/products/conversations/skills/setting-up-support-slack-locally/SKILL.md b/products/conversations/skills/setting-up-support-slack-locally/SKILL.mdindex 31134573c6f2..8b56501c9b21 100644--- a/products/conversations/skills/setting-up-support-slack-locally/SKILL.md+++ b/products/conversations/skills/setting-up-support-slack-locally/SKILL.md@@ -26,7 +26,7 @@ low-volume event POSTs rather than the entire SPA.This is the conversations/SupportHog variant of the general[Slack local setup guide](../../../../docs/internal/slack-local-setup-guide.md); that guide covers the-PostHog Code / notifications Slack app (`SLACK_APP_*`, `/integrations/slack/callback`). Conversations uses+PostHog Desktop / notifications Slack app (`SLACK_APP_*`, `/integrations/slack/callback`). Conversations usesits own `SUPPORT_SLACK_*` credentials and `/api/conversations/v1/slack/*` routes, but the tunnel and`SITE_URL` mechanics are identical.diff --git a/products/engineering_analytics/README.md b/products/engineering_analytics/README.mdindex bdcb19451077..fb15fcbbc927 100644--- a/products/engineering_analytics/README.md+++ b/products/engineering_analytics/README.md@@ -49,14 +49,14 @@ The product is: **measure every gap in a PR's life, average it, and watch it shrThe middle of PostHog's AI-to-prod loop (CI / review / merge / deploy) is invisible to both ends. This product fills it:```text-PostHog Code engineering_analytics PostHog product analytics-(generates code, → (CI / review / merge / deploy) → (events, errors, flags,- opens PRs) surveys, replays)- ↑ │- └─────────── Signals feed back to PostHog Code ───────────┘+PostHog Desktop engineering_analytics PostHog product analytics+(generates code, → (CI / review / merge / deploy) → (events, errors, flags,+ opens PRs) surveys, replays)+ ↑ │+ └─────────── Signals feed back to PostHog Desktop ───────────┘```-Two consumer classes, one tool set: engineers driving an agent (Claude Code, Cursor, PostHog AI) over their monorepo (we dogfood on `PostHog/posthog`), and PostHog Code calling the same tools autonomously on its own PRs.+Two consumer classes, one tool set: engineers driving an agent (Claude Code, Cursor, PostHog AI) over their monorepo (we dogfood on `PostHog/posthog`), and PostHog Desktop calling the same tools autonomously on its own PRs.Return shapes are typed contracts whose caveats ride in honest field names (`open_to_merge_seconds`, never `cycle_time`): legible to an agent, never free-form prose it might paraphrase wrong.## The system@@ -85,9 +85,9 @@ graph LR- The test-health view is an active work queue, not a failure-rate leaderboard: evidence is counted per CI run, a test is called flaky only where the evidence proves it (one commit was seen both failing and passing it: a re-run attempt going green, or an in-job retry), and every other failure ranks as an honest suspected regression by blast radius.- Access control: per-user warehouse RBAC at the source resolver, `engineering_analytics:read` scopes on tools, feature-flag gated.-## The goal: CI Signals for PostHog Code+## The goal: CI Signals for PostHog Desktop-Valuable CI conditions ("this check is flaky", "master went red at SHA X", "this PR is wedged on a failing required check") become [Signals](../signals): grouped, researched against the repository, and handed to PostHog Code for autonomous remediation.+Valuable CI conditions ("this check is flaky", "master went red at SHA X", "this PR is wedged on a failing required check") become [Signals](../signals): grouped, researched against the repository, and handed to PostHog Desktop for autonomous remediation.Detection is defined once in `logic/` over the read layer, so the emitter and the MCP tools share one definition.Shortening ready-for-review-to-merge is the headline metric this serves.@@ -109,7 +109,7 @@ Change one only in a separate PR with a written reason. Engineering-level decisi- Two motivations: (A) DevEx dogfood, (B) close the dark middle of PostHog's AI-to-prod loop. Every design decision serves both.- Unit of value = the open PR. Phase model: draft (low rigor) vs ready-for-review (high stakes).-- North star: actionable CI Signals for PostHog Code. Ready-for-review-to-merge time is the headline metric, not the end in itself.+- North star: actionable CI Signals for PostHog Desktop. Ready-for-review-to-merge time is the headline metric, not the end in itself.- Two first-class surfaces, one endpoint set: the in-app UI and MCP tools. Named typed endpoints run the curated read layer privately (no global HogQL views, core imports only the viewset); keep `mcp/tools.yaml` current whenever endpoints change.- One sanctioned write: the test-health sidecar (quarantine, as an issue plus PR through the team's GitHub App), carved out because this UI is the fastest surface to iterate on it. No saved views or stateful filters; persisted surfaces are a separate decision.- Data path: HogQL over the warehouse, plus reads from Logs and Traces. PR lifecycle event ingestion deferred. Product Postgres DB stays empty.@@ -121,8 +121,8 @@ Change one only in a separate PR with a written reason. Engineering-level decisi## Glossary-| Term | Definition |-| ------------------- | ----------------------------------------------------------------------------------------- |-| Good / bad friction | Checks that catch real problems (keep, optimize) vs checks engineers ignore (remove) |-| Wedge | End-to-end code visibility, served via MCP to PostHog Code and engineers driving agents |-| The dark middle | The CI / review / merge / deploy steps between PostHog Code and PostHog product analytics |+| Term | Definition |+| ------------------- | -------------------------------------------------------------------------------------------- |+| Good / bad friction | Checks that catch real problems (keep, optimize) vs checks engineers ignore (remove) |+| Wedge | End-to-end code visibility, served via MCP to PostHog Desktop and engineers driving agents |+| The dark middle | The CI / review / merge / deploy steps between PostHog Desktop and PostHog product analytics |diff --git a/products/engineering_analytics/SPEC.md b/products/engineering_analytics/SPEC.mdindex ac33c75ae8df..2c94c2a5b2a3 100644--- a/products/engineering_analytics/SPEC.md+++ b/products/engineering_analytics/SPEC.md@@ -9,7 +9,7 @@ The product surfaces PR + CI data through **named, typed endpoints** that run cuReads are the product. The one write is the test-health sidecar (quarantine: issue plus PR through the team's GitHub App), carved out here because this UI is the fastest surface to iterate on it.-The goal is Signals for PostHog Code (README → "The goal"): Signal detection is defined once in `logic/` over the read layer, shared by the surfaces and the Signal emitter. Emission rides the curated builders; it does not wait on lifecycle events.+The goal is Signals for PostHog Desktop (README → "The goal"): Signal detection is defined once in `logic/` over the read layer, shared by the surfaces and the Signal emitter. Emission rides the curated builders; it does not wait on lifecycle events.## 2. Non-goals@@ -30,7 +30,7 @@ graph TBsubgraph ConsumersMCP["MCP clients: Claude Code / Cursor / PostHog AI"]UI["in-app UI: React + kea"]- Other["PostHog Code & other agent-driven callers"]+ Other["PostHog Desktop & other agent-driven callers"]SQL["insights / subscriptions / execute-sql"]enddiff --git a/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.md b/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.mdindex d7dd52df2a95..8704ed9f7b20 100644--- a/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.md+++ b/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.md@@ -15,7 +15,7 @@ description: >Engineering analytics treats a pull request like product analytics treats a user: a PR moves through a pipeline(`opened → CI → review → merged → deployed`) and the job is to find where it slows down. The surface is **namedMCP tools** — you call them, you don't write SQL. Dogfooded on `PostHog/posthog`; the same tools serve-autonomous agents (e.g. PostHog Code) reasoning about their own PRs.+autonomous agents (e.g. PostHog Desktop) reasoning about their own PRs.## The toolsdiff --git a/products/experiments/backend/models/experiment.py b/products/experiments/backend/models/experiment.pyindex fc10376a5bfa..8bd88129fc75 100644--- a/products/experiments/backend/models/experiment.py+++ b/products/experiments/backend/models/experiment.py@@ -139,7 +139,7 @@ class Experiment(FileSystemSyncMixin, ModelActivityMixin, RootTeamMixin, models.blank=True,)- # Latest flag-cleanup Code task opened when this experiment ended. A bare UUID, not a FK —+ # Latest flag-cleanup Desktop task opened when this experiment ended. A bare UUID, not a FK —# tasks is an isolated product, so details are read through its facade.flag_cleanup_task_id = models.UUIDField(null=True, blank=True)diff --git a/products/experiments/backend/presentation/serializers.py b/products/experiments/backend/presentation/serializers.pyindex 70e8a5a599ab..b53bf4fe1a32 100644--- a/products/experiments/backend/presentation/serializers.py+++ b/products/experiments/backend/presentation/serializers.py@@ -375,7 +375,7 @@ class ExperimentSerializer(ExperimentBaseSerializer):read_only=True,allow_null=True,help_text=(- "ID of the Code task opened to remove the experiment's feature-flag code, when one was "+ "ID of the Desktop task opened to remove the experiment's feature-flag code, when one was ""requested via open_cleanup_pr on end/ship_variant. Read its status via the ""flag_cleanup_task action."),@@ -534,11 +534,11 @@ class ExperimentSerializer(ExperimentBaseSerializer):raise serializers.ValidationError("Repository must be in the format organization/repository")value = value.lower()# The field steers where the cleanup PR is opened, so pointing it somewhere new- # needs the same PostHog Code access as opening one (mirrors open_cleanup_pr).+ # needs the same PostHog Desktop access as opening one (mirrors open_cleanup_pr).if self.instance is None or value != self.instance.repository:request = self.context.get("request")if request is None or not has_tasks_access(request.user):- raise PermissionDenied("Setting a cleanup repository requires access to PostHog Code.")+ raise PermissionDenied("Setting a cleanup repository requires access to PostHog Desktop.")return valuedef validate(self, data):@@ -1050,14 +1050,14 @@ class EndExperimentSerializer(serializers.Serializer):default=False,help_text=("When true, open a draft pull request that removes the experiment's feature-flag code "- "from the linked repository. Requires the requesting user to have access to PostHog Code "+ "from the linked repository. Requires the requesting user to have access to PostHog Desktop ""(403 otherwise). Only acts for allowlisted teams; ignored otherwise."),)class ExperimentFlagCleanupTaskSerializer(serializers.Serializer):- task_id = serializers.UUIDField(help_text="ID of the flag-cleanup Code task.")+ task_id = serializers.UUIDField(help_text="ID of the flag-cleanup Desktop task.")run_status = serializers.ChoiceField(choices=["not_started", "queued", "in_progress", "completed", "failed", "cancelled"],help_text="Status of the task's latest run.",@@ -1071,7 +1071,7 @@ class ExperimentFlagCleanupTaskSerializer(serializers.Serializer):)can_view_task = serializers.BooleanField(help_text=(- "Whether the requesting user can open the task in PostHog Code. Cleanup tasks are "+ "Whether the requesting user can open the task in PostHog Desktop. Cleanup tasks are ""visible to their creator only, so other viewers should not be shown a task link."),)diff --git a/products/experiments/backend/presentation/views.py b/products/experiments/backend/presentation/views.pyindex 89db98a212f5..644a49cafb15 100644--- a/products/experiments/backend/presentation/views.py+++ b/products/experiments/backend/presentation/views.py@@ -371,7 +371,7 @@ class EnterpriseExperimentsViewSet(if request.data.get("disable_feature_flag", False) in serializers.BooleanField.TRUE_VALUES:scopes.append("feature_flag:write")return scopes- # Ending or shipping with open_cleanup_pr=true starts a Code task that opens a pull+ # Ending or shipping with open_cleanup_pr=true starts a Desktop task that opens a pull# request. Starting a task is a task write, so require task:write on the token, not# just experiment:write.if self.action in ("end", "ship_variant"):@@ -382,11 +382,11 @@ class EnterpriseExperimentsViewSet(return Nonedef _check_cleanup_pr_access(self, request: Request) -> None:- """Opening a cleanup PR starts a Code task on the user's behalf. The task:write+ """Opening a cleanup PR starts a Desktop task on the user's behalf. The task:writescope only gates token auth (see dangerously_get_required_scopes); session auth- has no scopes, so gate every caller on PostHog Code product access instead."""+ has no scopes, so gate every caller on PostHog Desktop product access instead."""if not has_tasks_access(cast(User, request.user)):- raise PermissionDenied("Opening a flag cleanup PR requires access to PostHog Code.")+ raise PermissionDenied("Opening a flag cleanup PR requires access to PostHog Desktop.")def _token_can_write_feature_flag(self, request: Request) -> bool:"""Whether the request's token carries feature_flag:write.@@ -577,9 +577,9 @@ class EnterpriseExperimentsViewSet(@action(methods=["GET"], detail=True, required_scopes=["experiment:read"])def flag_cleanup_task(self, request: Request, *args: Any, **kwargs: Any) -> Response:"""- Status of the flag-cleanup Code task opened for this experiment.+ Status of the flag-cleanup Desktop task opened for this experiment.- When an experiment was ended or shipped with open_cleanup_pr=true, a Code task+ When an experiment was ended or shipped with open_cleanup_pr=true, a Desktop taskremoves the experiment's feature-flag code and opens a draft pull request. Thisreturns that task's latest run status and the PR URL once one is opened. Polluntil is_terminal is true. Returns 404 when no cleanup task was opened.diff --git a/products/experiments/backend/test/test_presentation_api.py b/products/experiments/backend/test/test_presentation_api.pyindex 388809b88ef9..cb8708d8955b 100644--- a/products/experiments/backend/test/test_presentation_api.py+++ b/products/experiments/backend/test/test_presentation_api.py@@ -5715,7 +5715,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):"id"]- # Scopes don't apply to session auth — without Code access, opting in must be rejected+ # Scopes don't apply to session auth — without Desktop access, opting in must be rejected# on both actions that can open a cleanup PR.with patch("products.experiments.backend.presentation.views.has_tasks_access", return_value=False):resp = self.client.post(@@ -5732,7 +5732,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):)self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN, resp.content)- # Not opting in still ends the experiment without Code access.+ # Not opting in still ends the experiment without Desktop access.resp = self.client.post(f"/api/projects/{self.team.id}/experiments/{exp_end}/end/",{"conclusion": "won", "open_cleanup_pr": False},@@ -5740,7 +5740,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):)self.assertEqual(resp.status_code, status.HTTP_200_OK, resp.content)- # With Code access, opting in succeeds on both actions ("end first, ship later" flow).+ # With Desktop access, opting in succeeds on both actions ("end first, ship later" flow).with patch("products.experiments.backend.presentation.views.has_tasks_access", return_value=True):resp = self.client.post(f"/api/projects/{self.team.id}/experiments/{exp_ship}/end/",diff --git a/products/experiments/frontend/generated/api.schemas.ts b/products/experiments/frontend/generated/api.schemas.tsindex 8ae4fc85924c..53a0213a71c7 100644--- a/products/experiments/frontend/generated/api.schemas.ts+++ b/products/experiments/frontend/generated/api.schemas.ts@@ -1451,7 +1451,7 @@ export interface ExperimentWriteApi {*/conclusion_comment?: string | null/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id: string | null@@ -1570,7 +1570,7 @@ export interface ExperimentApi {*/conclusion_comment?: string | null/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id: string | null@@ -1685,7 +1685,7 @@ export interface PatchedExperimentWriteApi {*/conclusion_comment?: string | null/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id?: string | null@@ -1809,7 +1809,7 @@ export interface EndExperimentApi {* @nullable*/conclusion_comment?: string | null- /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */+ /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */open_cleanup_pr?: boolean}@@ -1833,7 +1833,7 @@ export const RunStatusEnumApi = {} as constexport interface ExperimentFlagCleanupTaskApi {- /** ID of the flag-cleanup Code task. */+ /** ID of the flag-cleanup Desktop task. */task_id: string/** Status of the task's latest run.*@@ -1851,7 +1851,7 @@ export interface ExperimentFlagCleanupTaskApi {* @nullable*/pr_url: string | null- /** Whether the requesting user can open the task in PostHog Code. Cleanup tasks are visible to their creator only, so other viewers should not be shown a task link. */+ /** Whether the requesting user can open the task in PostHog Desktop. Cleanup tasks are visible to their creator only, so other viewers should not be shown a task link. */can_view_task: boolean}@@ -2063,7 +2063,7 @@ export interface ShipVariantApi {* @nullable*/conclusion_comment?: string | null- /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */+ /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */open_cleanup_pr?: boolean/** The key of the variant to ship. */variant_key: stringdiff --git a/products/experiments/frontend/generated/api.ts b/products/experiments/frontend/generated/api.tsindex 53439da041e1..16051a7d94f9 100644--- a/products/experiments/frontend/generated/api.ts+++ b/products/experiments/frontend/generated/api.ts@@ -589,9 +589,9 @@ export const getExperimentsFlagCleanupTaskRetrieveUrl = (projectId: string, id:}/**- * Status of the flag-cleanup Code task opened for this experiment.+ * Status of the flag-cleanup Desktop task opened for this experiment.*- * When an experiment was ended or shipped with open_cleanup_pr=true, a Code task+ * When an experiment was ended or shipped with open_cleanup_pr=true, a Desktop task* removes the experiment's feature-flag code and opens a draft pull request. This* returns that task's latest run status and the PR URL once one is opened. Poll* until is_terminal is true. Returns 404 when no cleanup task was opened.diff --git a/products/experiments/frontend/generated/api.zod.ts b/products/experiments/frontend/generated/api.zod.tsindex 35a230078531..b47bd96f9ad7 100644--- a/products/experiments/frontend/generated/api.zod.ts+++ b/products/experiments/frontend/generated/api.zod.ts@@ -985,7 +985,7 @@ export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({.boolean().default(experimentsEndCreateBodyOpenCleanupPrDefault).describe(- "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise."+ "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise."),})@@ -1084,7 +1084,7 @@ export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({.boolean().default(experimentsShipVariantCreateBodyOpenCleanupPrDefault).describe(- "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise."+ "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise."),variant_key: zod.string().describe('The key of the variant to ship.'),release_to_everyone: zoddiff --git a/products/integrations/frontend/generated/api.schemas.ts b/products/integrations/frontend/generated/api.schemas.tsindex a1befda4eb29..f1e23441926f 100644--- a/products/integrations/frontend/generated/api.schemas.ts+++ b/products/integrations/frontend/generated/api.schemas.ts@@ -421,7 +421,7 @@ export interface GitHubOAuthAuthorizeResponseApi {}export interface GitHubPrepareCallbackRequestApi {- /** Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Code). */+ /** Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Desktop). */next?: string/** GitHub installation ID being managed; binds the seeded update state so a callback can't swap in a different installation. */installation_id?: stringdiff --git a/products/integrations/frontend/generated/api.zod.ts b/products/integrations/frontend/generated/api.zod.tsindex 4176f6844d2d..e428f49d086a 100644--- a/products/integrations/frontend/generated/api.zod.ts+++ b/products/integrations/frontend/generated/api.zod.ts@@ -318,7 +318,7 @@ export const IntegrationsGithubPrepareCallbackCreateBody = /* @__PURE__ */ zod.o.string().optional().describe(- 'Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Code).'+ 'Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Desktop).'),installation_id: zod.string()diff --git a/products/mcp_store/backend/presentation/views.py b/products/mcp_store/backend/presentation/views.pyindex 5f5cab3a7255..d3ec10149d46 100644--- a/products/mcp_store/backend/presentation/views.py+++ b/products/mcp_store/backend/presentation/views.py@@ -121,7 +121,7 @@ def _is_https(url: str) -> bool:def _is_valid_posthog_code_callback_url(url: str) -> bool:- """Validate that a PostHog Code callback URL is safe to redirect to (prevents open redirect)."""+ """Validate that a PostHog Desktop callback URL is safe to redirect to (prevents open redirect)."""parsed = urlparse(url)if parsed.scheme in ("array", "posthog-code"):return True@@ -175,7 +175,7 @@ class MCPServerTemplateSerializer(serializers.ModelSerializer):help_text="The vendor's brand domain (e.g. 'linear.app'), resolved to an icon at render time ""via the logo.dev proxy endpoint. Empty when no brand icon is known.",)- # Kept until PostHog Code stops reading it; drop together with the model column.+ # Kept until PostHog Desktop stops reading it; drop together with the model column.icon_key = serializers.CharField(read_only=True,help_text="Deprecated: use icon_domain instead. Lowercase key for clients that still "@@ -241,7 +241,7 @@ class MCPServerInstallationSerializer(serializers.ModelSerializer):help_text="Brand domain from the linked template, rendered via the logo.dev icon proxy. ""Empty if custom install (no template).",)- # Kept until PostHog Code stops reading it; drop together with the model column.+ # Kept until PostHog Desktop stops reading it; drop together with the model column.icon_key = serializers.CharField(source="template.icon_key",read_only=True,@@ -1510,7 +1510,7 @@ class MCPOAuthRedirectViewSet(viewsets.ViewSet):OAuth providers redirect here after authorization. This endpointvalidates the state token, exchanges the code for tokens, and- redirects to the originating client (PostHog web or PostHog Code).+ redirects to the originating client (PostHog web or PostHog Desktop)."""# Use SessionAuthentication; leave permission_classes empty for uniform 400s, not 401sdiff --git a/products/mcp_store/backend/test/test_api.py b/products/mcp_store/backend/test/test_api.pyindex c19f10c00259..bfddf79bdec4 100644--- a/products/mcp_store/backend/test/test_api.py+++ b/products/mcp_store/backend/test/test_api.py@@ -244,7 +244,7 @@ class TestMCPServerInstallationAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchidef test_list_installation_icon_fields_from_template(self):# Pass non-normalized icon values to confirm the model's save() normalizes them and# both flow through the serializer — icon_key must stay exposed alongside icon_domain- # until PostHog Code stops reading it.+ # until PostHog Desktop stops reading it.template = MCPServerTemplate.objects.create(name="PostHog MCP",url="https://mcp.notion.example/mcp",diff --git a/products/notebooks/backend/presentation/views/notebook.py b/products/notebooks/backend/presentation/views/notebook.pyindex a6577bbe0bfa..dbdbacf7fd26 100644--- a/products/notebooks/backend/presentation/views/notebook.py+++ b/products/notebooks/backend/presentation/views/notebook.py@@ -111,9 +111,9 @@ def classify_request_source(request: Request) -> tuple[str, dict[str, str | None"""Classify a notebook request as a browser action (``ui``) vs a programmatic client (``mcp``/API).Session-cookie requests are the browser; anything else (personal API key, OAuth app) is a- programmatic client. The PostHog MCP server forwards the client identity so PostHog Code can be+ programmatic client. The PostHog MCP server forwards the client identity so PostHog Desktop can betold apart from a customer's own MCP client: ``mcp_consumer`` is ``posthog-code``/``posthog-cli``- for first-party PostHog Code, and ``mcp_oauth_client`` is the OAuth app name (e.g. Claude) for+ for first-party PostHog Desktop, and ``mcp_oauth_client`` is the OAuth app name (e.g. Claude) forthird-party clients. Shared by the create and read events."""authenticator = getattr(request, "successful_authenticator", None)if authenticator is None or isinstance(authenticator, SessionAuthentication):diff --git a/products/notebooks/backend/sql_v2.py b/products/notebooks/backend/sql_v2.pyindex aa6ba984fce0..827620f549a0 100644--- a/products/notebooks/backend/sql_v2.py+++ b/products/notebooks/backend/sql_v2.py@@ -1,14 +1,14 @@"""Helpers for the revamped-notebooks SQLV2 run flow (Journey 1).The backend dispatches a run to the in-sandbox kernel-server with a single HTTP-POST (mirroring PostHog Code's agent-server). The kernel-server fetches the+POST (mirroring PostHog Desktop's agent-server). The kernel-server fetches thenode's capped result page from the data-plane endpoint (real ClickHouse data viaHogQL) and POSTs the envelope back to the token-authed callback endpoint. Thecontrol plane (write_file / execute) is used only to deploy and launch thekernel-server package — never per run.The callback and data-plane tokens are stateless signed tokens for the slice;-hardening swaps them for the RS256 sandbox event-ingest JWTs used by PostHog Code.+hardening swaps them for the RS256 sandbox event-ingest JWTs used by PostHog Desktop."""import hmacdiff --git a/products/notebooks/backend/sql_v2_callback.py b/products/notebooks/backend/sql_v2_callback.pyindex 6f9ba00029b2..7aadda4cec6c 100644--- a/products/notebooks/backend/sql_v2_callback.py+++ b/products/notebooks/backend/sql_v2_callback.py@@ -1,6 +1,6 @@"""Token-authed sandbox -> backend callback for SQLV2 runs (Journey 1 slice).-Mirrors PostHog Code's agent-proxy callback: a plain function view (no team+Mirrors PostHog Desktop's agent-proxy callback: a plain function view (no teamscoping, no session), authed by a Bearer token the run endpoint minted. Wired inposthog/urls.py at internal/notebooks/runs/<run_id>/result/."""diff --git a/products/notebooks/backend/sql_v2_result_delivery.md b/products/notebooks/backend/sql_v2_result_delivery.mdindex 601c58bc3cda..a7c80eed2fe9 100644--- a/products/notebooks/backend/sql_v2_result_delivery.md+++ b/products/notebooks/backend/sql_v2_result_delivery.md@@ -94,9 +94,9 @@ not a Redis Stream** — we deliver one terminal result, so we don't need replaystreams.- **Unsubscribe/cleanup** on every exit path (result, error, timeout, disconnect).-### Why not a Redis Stream (like PostHog Code)+### Why not a Redis Stream (like PostHog Desktop)-PostHog Code streams many incremental agent events and needs replay on reconnect+PostHog Desktop streams many incremental agent events and needs replay on reconnect(`Last-Event-ID` cursor over a trimmed stream). SQLV2 delivers one terminalresult, so pub/sub + a durable row is sufficient and much simpler. Revisit theStream approach only if SQLV2 starts streaming incremental output (stdout,@@ -193,7 +193,7 @@ fresh `result_id`. Durable storage is what removes this later.## Related model notes- **`KernelRuntime.server_url` / `server_connect_token`** are stored **plaintext**- (`TextField`). This matches PostHog Code, which keeps `sandbox_url` /+ (`TextField`). This matches PostHog Desktop, which keeps `sandbox_url` /`sandbox_connect_token` plaintext in `TaskRun.state` (a plain JSONField). Theconnect token is an ephemeral Modal tunnel token, not a durable account secret(those, e.g. env vars, tasks _does_ encrypt via `EncryptedJSONStringField`). Ifdiff --git a/products/notebooks/backend/test/test_analytics.py b/products/notebooks/backend/test/test_analytics.pyindex 27d2b7ade50f..1415d24c3c09 100644--- a/products/notebooks/backend/test/test_analytics.py+++ b/products/notebooks/backend/test/test_analytics.py@@ -56,8 +56,8 @@ class TestNotebookAnalytics(BaseTest):self.assertEqual(extra, {})def test_classify_request_source_api_key_captures_mcp_client_identity(self):- # The MCP server forwards mcp_consumer (posthog-code -> PostHog Code) and mcp_oauth_client- # (the OAuth app, e.g. Claude), which is how Q4 (PostHog Code) is split from Q5.+ # The MCP server forwards mcp_consumer (posthog-code -> PostHog Desktop) and mcp_oauth_client+ # (the OAuth app, e.g. Claude), which is how Q4 (PostHog Desktop) is split from Q5.source, extra = classify_request_source(_fake_request(_FakeKeyAuth(), mcp_consumer="posthog-code", mcp_oauth_client="Claude"))diff --git a/products/notebooks/plan/notebooks_observability_gaps.md b/products/notebooks/plan/notebooks_observability_gaps.mdindex 860e2769eeb1..38b31cf14c90 100644--- a/products/notebooks/plan/notebooks_observability_gaps.md+++ b/products/notebooks/plan/notebooks_observability_gaps.md@@ -11,20 +11,20 @@ All findings below reference `master` as of this doc's creation.1. Do people **re-visit** their notebooks?2. Do people **share** their notebooks?3. Do people visit **others'** notebooks?-4. How often do **PostHog Code / Max** create notebooks?+4. How often do **PostHog Desktop / Max** create notebooks?5. How often do people create notebooks via **their own clients (MCP)**?6. What kinds of **problems/questions** start in AI/MCP/Code and end up in notebooks?## Verdict: none are cleanly answerable today-| # | Question | Answerable now? | Blocking gap |-| --- | ------------------------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| 1 | Re-visit own notebooks | ❌ | No open/view event exists anywhere |-| 2 | Share notebooks | ❌ | No analytics event on actual share/enable/grant (only an interest CTA + activity-log rows) |-| 3 | Visit others' notebooks | ❌ | No view event; no owner-vs-viewer property on any event |-| 4 | Max / PostHog Code create rate | ❌ | `notebook created` is origin-agnostic; Max backend path emits no event. PostHog Code creates via the MCP `notebooks-create` tool, so it shares the MCP path with Q5 — `creation_source: mcp` alone won't separate them (see note) |-| 5 | MCP create rate | ❌ | MCP `notebooks-create` → DRF create → activity-log row only, no analytics event, no source marker |-| 6 | Problems → notebook | ⚠️ DB-join only | Link exists via `short_id`→`AgentArtifact.conversation`→`Conversation.topic`, but not in event stream; fragile; absent for MCP |+| # | Question | Answerable now? | Blocking gap |+| --- | --------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |+| 1 | Re-visit own notebooks | ❌ | No open/view event exists anywhere |+| 2 | Share notebooks | ❌ | No analytics event on actual share/enable/grant (only an interest CTA + activity-log rows) |+| 3 | Visit others' notebooks | ❌ | No view event; no owner-vs-viewer property on any event |+| 4 | Max / PostHog Desktop create rate | ❌ | `notebook created` is origin-agnostic; Max backend path emits no event. PostHog Desktop creates via the MCP `notebooks-create` tool, so it shares the MCP path with Q5 — `creation_source: mcp` alone won't separate them (see note) |+| 5 | MCP create rate | ❌ | MCP `notebooks-create` → DRF create → activity-log row only, no analytics event, no source marker |+| 6 | Problems → notebook | ⚠️ DB-join only | Link exists via `short_id`→`AgentArtifact.conversation`→`Conversation.topic`, but not in event stream; fragile; absent for MCP |## Current state (what exists today)@@ -83,19 +83,19 @@ indistinguishable from hand-created ones.→ `Conversation.topic` (classified from first question, `assistant.py:57-88`).Breaks if the artifact/conversation is deleted. MCP path has no conversation at all.-### ⚠️ Note on "PostHog Code" vs generic MCP clients (Q4 vs Q5)+### ⚠️ Note on "PostHog Desktop" vs generic MCP clients (Q4 vs Q5)-PostHog Code creates notebooks **via the MCP `notebooks-create` tool** — it is itself an MCP+PostHog Desktop creates notebooks **via the MCP `notebooks-create` tool** — it is itself an MCPclient. So it flows through the same path as Q5 (a customer's own MCP client), and a plain`creation_source: mcp` property cannot tell the two apart. To split Q4 from Q5 we need a**client identifier** on the create event, e.g.:- the auth principal (personal API key vs project secret key vs OAuth app) used for the call, and/or-- the MCP client name / user-agent (PostHog Code should send an identifiable client id).+- the MCP client name / user-agent (PostHog Desktop should send an identifiable client id).Action: when emitting the server-side `notebook created` event, capture `mcp_client` /-`api_key_type` (or an `agent`-tagged sub-source like `mcp_posthog_code`) so PostHog Code is-distinguishable from third-party MCP usage. Confirm PostHog Code sends a stable client id;+`api_key_type` (or an `agent`-tagged sub-source like `mcp_posthog_code`) so PostHog Desktop is+distinguishable from third-party MCP usage. Confirm PostHog Desktop sends a stable client id;if not, that's a prerequisite fix.## Root cause@@ -122,7 +122,7 @@ Properties:- `max_ai` / `max_account_notebook` / `temporal_agent` / `group_auto`: pass an explicitsource arg into the facade helper from each caller.- `mcp_client` / `api_key_type` (when `creation_source = mcp`): identify the calling client so- **PostHog Code** (Q4) is separable from a customer's own MCP client (Q5). See the PostHog+ **PostHog Desktop** (Q4) is separable from a customer's own MCP client (Q5). See the PostHogCode note above — plain `creation_source: mcp` is not enough to split Q4 from Q5.- `conversation_id`, `topic`: set when `creation_source` is AI-originated (from the`AgentArtifact.conversation` on the Max path). Closes Q6 in the event stream.@@ -384,7 +384,7 @@ is even meaningful or just noise. Scope it as its own investigation.| Q1 re-visit own | PR 1 (`is_creator = true` on `notebook opened`) || Q2 share | PR 3 || Q3 visit others' | PR 1 (`is_creator = false`) |-| Q4 Max / PostHog Code create | PR 2 (`creation_source` + `mcp_client`/`api_key_type`) |+| Q4 Max / PostHog Desktop create | PR 2 (`creation_source` + `mcp_client`/`api_key_type`) || Q5 MCP create | PR 2 (`creation_source = mcp`) || Q6 problems → notebook | PR 2 (`conversation_id` + `topic` on AI paths) || Q7 agents read notebooks (+ AI-created consumed later) | PR 2e (`notebook read`, `read_source`) — REST/MCP reads, a lower bound; SQL `SELECT FROM notebooks` reads deferred to optional PR 5 (needs SQL-access analysis first) |diff --git a/products/posthog_ai/frontend/components/Approval.test.tsx b/products/posthog_ai/frontend/components/Approval.test.tsxindex 868546691602..1e8bac108e3d 100644--- a/products/posthog_ai/frontend/components/Approval.test.tsx+++ b/products/posthog_ai/frontend/components/Approval.test.tsx@@ -105,7 +105,7 @@ describe('Sandbox approval input area', () => {expect(screen.queryByText('Create insight')).not.toBeInTheDocument()})- it('renders the unwrapped PostHog exec payload like PostHog Code', () => {+ it('renders the unwrapped PostHog exec payload like PostHog Desktop', () => {render(<PermissionInputstreamKey="conv-1"diff --git a/products/posthog_ai/frontend/components/PullRequestCard.tsx b/products/posthog_ai/frontend/components/PullRequestCard.tsxindex 6e86488c0cd4..6e2903f5d5c5 100644--- a/products/posthog_ai/frontend/components/PullRequestCard.tsx+++ b/products/posthog_ai/frontend/components/PullRequestCard.tsx@@ -4,7 +4,7 @@ import { IconCheckCircle, IconExternal, IconPullRequest } from '@posthog/icons'import { LemonButton } from '@posthog/lemon-ui'/**- * Post-turn "Pull request opened" card for a sandbox coding run — the web port of PostHog Code's+ * Post-turn "Pull request opened" card for a sandbox coding run — the web port of PostHog Desktop's* `GitActionResult`, adapted to LemonUI. Plain props, `React.memo`'d — `prUrl` is required, so the* caller decides whether to mount it (only once a run has opened a PR and is no longer thinking).* Frontend-only: it shows the link + branch, no diff stats (those need a backend wire field; see thediff --git a/products/posthog_ai/frontend/logics/runStreamLogic.ts b/products/posthog_ai/frontend/logics/runStreamLogic.tsindex 23965f09fce7..44fc0a85b06f 100644--- a/products/posthog_ai/frontend/logics/runStreamLogic.ts+++ b/products/posthog_ai/frontend/logics/runStreamLogic.ts@@ -2867,7 +2867,7 @@ export const runStreamLogic = kea<runStreamLogicType>([}},cancelRun: async ({ run }) => {- // Cancel a run through the generic tasks relay — the same command PostHog Code issues. The+ // Cancel a run through the generic tasks relay — the same command PostHog Desktop issues. The// SSE then receives a terminal task_run_state; cancellation telemetry is emitted server-side// by the relay. `run` defaults to the streamed run; a warm Run (not streamed) is passed in.// Fire-and-forget: a failure leaves the run alive for a retry.diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsxindex 301124e18896..44c7fb765256 100644--- a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx+++ b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx@@ -50,7 +50,7 @@ export function TaskTracker({ taskId }: TaskTrackerProps): JSX.Element {if (selectedTaskId) {return (<div className="flex flex-col h-full min-h-0">- <AllowTrainingCallout featureName="PostHog Code" />+ <AllowTrainingCallout featureName="PostHog Desktop" /><div className="flex flex-1 min-h-0 flex-col overflow-hidden"><TaskDetailPage taskId={selectedTaskId} isMobile /></div>diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsxindex 05e5529d7206..6971001b8ee6 100644--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx@@ -54,7 +54,7 @@ export function TaskDetailPage({ taskId, isMobile }: TaskDetailPageProps): JSX.EonClick={() => window.open(`posthog-code://task/${task.id}`, '_blank')}className="hidden lg:inline-flex">- Open in PostHog Code+ Open in PostHog Desktop</LemonButton>{prUrl && (<LemonButtondiff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsxindex ebcd6426217f..c4950e72dec3 100644--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx@@ -28,7 +28,7 @@ export function TaskPanelSkeleton(): JSX.Element {)}-/** Skeleton for the title-bar action buttons (Open in PostHog Code / View PR / Run). */+/** Skeleton for the title-bar action buttons (Open in PostHog Desktop / View PR / Run). */export function TaskHeaderActionsSkeleton(): JSX.Element {return (<div className="flex items-center gap-2">diff --git a/products/posthog_ai/frontend/types/streamTypes.ts b/products/posthog_ai/frontend/types/streamTypes.tsindex 16c5f4bc311c..4bededf24c65 100644--- a/products/posthog_ai/frontend/types/streamTypes.ts+++ b/products/posthog_ai/frontend/types/streamTypes.ts@@ -2,7 +2,7 @@* Thread shapes for the sandbox agent runtime (`agent_runtime === 'sandbox'`).** The sandbox path consumes the products/tasks SSE endpoint directly (the same endpoint- * PostHog Code uses). `runStreamLogic` folds the raw wire frames (typed in+ * PostHog Desktop uses). `runStreamLogic` folds the raw wire frames (typed in* `./wireTypes`) into `ToolInvocation` / `ThreadItem` stream state.*/diff --git a/products/replay_vision/backend/api/observations.py b/products/replay_vision/backend/api/observations.pyindex 2ae5b5c5695a..74a30afa4df7 100644--- a/products/replay_vision/backend/api/observations.py+++ b/products/replay_vision/backend/api/observations.py@@ -808,7 +808,7 @@ class ReplayObservationViewSet(self.check_object_permissions(self.request, scanner)user = cast(User, request.user)if not has_tasks_access(user):- raise PermissionDenied("Creating a task requires access to PostHog Code.")+ raise PermissionDenied("Creating a task requires access to PostHog Desktop.")content = _observation_task_content(observation, scanner)# Lock the observation row so a client retry or concurrent double submit returns the task the# first call minted instead of creating a duplicate to triage.diff --git a/products/replay_vision/backend/tests/test_observation_create_task_api.py b/products/replay_vision/backend/tests/test_observation_create_task_api.pyindex d32b6554e2b8..8adf98c32362 100644--- a/products/replay_vision/backend/tests/test_observation_create_task_api.py+++ b/products/replay_vision/backend/tests/test_observation_create_task_api.py@@ -53,7 +53,7 @@ class TestObservationCreateTask(_VisionAPITestCase):self.assertIn("sess-1", kwargs["description"])def test_requires_tasks_access(self) -> None:- # Without PostHog Code access the endpoint must refuse and create nothing, or any observation+ # Without PostHog Desktop access the endpoint must refuse and create nothing, or any observation# reader could mint tasks.with patch(_HAS_ACCESS, return_value=False), patch(_CREATE) as create:resp = self.client.post(self._url(), format="json")diff --git a/products/review_hog/ARCHITECTURE.md b/products/review_hog/ARCHITECTURE.mdindex 4ec430025e13..2ab83dae45de 100644--- a/products/review_hog/ARCHITECTURE.md+++ b/products/review_hog/ARCHITECTURE.md@@ -316,7 +316,7 @@ reasoning_effort}]` → `get_task_processing_context` reads it back → `start_a`build_agent_runtime_env_prefix` (`logic/services/sandbox.py`) emits`POSTHOG_CODE_{RUNTIME_ADAPTER,PROVIDER,MODEL,REASONING_EFFORT}` env prefixed onto the agent launch command.-**`@posthog/agent` — where they are consumed + applied** (the PostHog Code monorepo, _not_ this repo; clone via+**`@posthog/agent` — where they are consumed + applied** (the PostHog Desktop monorepo, _not_ this repo; clone via`LOCAL_POSTHOG_CODE_MONOREPO_ROOT`, package `packages/agent`, baked into `Dockerfile.sandbox-base`).- **Entry `src/server/bin.ts`** reads + zod-validates `POSTHOG_CODE_{RUNTIME_ADAPTER,MODEL,REASONING_EFFORT}`, guardsdiff --git a/products/review_hog/DECISIONS.md b/products/review_hog/DECISIONS.mdindex 50d4c852f64c..7d6724a9d87b 100644--- a/products/review_hog/DECISIONS.md+++ b/products/review_hog/DECISIONS.md@@ -2080,7 +2080,7 @@ fixes via a companion PR, maximum reuse of a verified engine), skip B.**#### Conversational / control surface (optional; channel-agnostic)-Per the maintainer the **interaction channel is pluggable** (Slack, GitHub comments, PostHog Code, …) and out of+Per the maintainer the **interaction channel is pluggable** (Slack, GitHub comments, PostHog Desktop, …) and out ofscope — design the durable part, leave the UI a thin adapter. **Must-have (ships with Variant A):** `@workflow.query`for live state (stage, findings-so-far, lifecycle counts, watermarks — zero history cost; copy `get_buffer_size` /`get_paused_state`) and `@workflow.signal` for inject-context / pause / cancel / force-turn (copy `submit_signal` /@@ -3391,7 +3391,7 @@ reasoning_effort}]` → `get_task_processing_context` reads it back → `start_a`build_agent_runtime_env_prefix` (`logic/services/sandbox.py`) emits `env POSTHOG_CODE_{RUNTIME_ADAPTER,PROVIDER,MODEL,REASONING_EFFORT}=…` prefixed onto the agent launch command (guarded by `test_agentsh.py`).-**`@posthog/agent` — where they are consumed + applied (the PostHog Code monorepo, _not_ this repo).** Clone via+**`@posthog/agent` — where they are consumed + applied (the PostHog Desktop monorepo, _not_ this repo).** Clone via`LOCAL_POSTHOG_CODE_MONOREPO_ROOT` (legacy alias `LOCAL_TWIG_MONOREPO_ROOT`); package `packages/agent`(npm `@posthog/agent`, baked into `Dockerfile.sandbox-base`).diff --git a/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/PLAN.md b/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/PLAN.mdindex f7fc92cb682b..812f35d653d8 100644--- a/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/PLAN.md+++ b/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/PLAN.md@@ -107,7 +107,7 @@ reads; the funnel/valid count is secondary with the structure caveat attached.edits — but a reload severs live streams, so gateway config edits only between runs). Smoke-verified2026-07-03: one-shot dedup call end-to-end → `$ai_generation` with model=claude-sonnet-5,ai_product=review_hog, ai_stage stamped (593 in / 20 out).-- **Env gotcha (agent-driven shells only):** the PostHog Code desktop harness overrides+- **Env gotcha (agent-driven shells only):** the PostHog Desktop harness overrides`LLM_GATEWAY_URL` to its own local proxy — prefix manual shell invocations with`LLM_GATEWAY_URL=http://localhost:3308`. The Temporal worker (started from a normal terminal) getsthe correct debug default and is unaffected.diff --git a/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/sample_oneshot_chunker.py b/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/sample_oneshot_chunker.pyindex e51d56bfbeca..d90c65b4c0c8 100644--- a/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/sample_oneshot_chunker.py+++ b/products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/sample_oneshot_chunker.py@@ -8,7 +8,7 @@ call (~cents, no sandbox), sequential.N_SAMPLES=5 OUT_FILE=products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/runs/chunker-offline-sample.md \python manage.py shell -c "exec(open('products/review_hog/eval/experiments/2026-07-oneshot-chunking-dedup/sample_oneshot_chunker.py').read())"-Gotcha: a PostHog Code desktop-harness shell overrides LLM_GATEWAY_URL to the app's own proxy —+Gotcha: a PostHog Desktop harness shell overrides LLM_GATEWAY_URL to the app's own proxy —prefix the command with LLM_GATEWAY_URL=http://localhost:3308 when driving this from an agent shell."""diff --git a/products/review_hog/eval/experiments/2026-07-pipeline-models/PLAN.md b/products/review_hog/eval/experiments/2026-07-pipeline-models/PLAN.mdindex ef3074ea42a4..ca0a5040abf9 100644--- a/products/review_hog/eval/experiments/2026-07-pipeline-models/PLAN.md+++ b/products/review_hog/eval/experiments/2026-07-pipeline-models/PLAN.md@@ -45,7 +45,7 @@ local llm-gateway allowlists** — sandbox agents authenticate as product `posthgateway's cost logs), and neither `_POSTHOG_CODE_AGENT_MODELS` nor `background_agents` listed fable-5.Without the gateway entry the agent's `sanitizedModel` silently falls back to Opus — a fallback run looksnormal. Fix: add `"claude-fable-5"` to both sets in-`services/llm-gateway/src/llm_gateway/products/config.py` (commit-worthy parity — PostHog Code's composer+`services/llm-gateway/src/llm_gateway/products/config.py` (commit-worthy parity — PostHog Desktop's composeralready offers Fable 5). **The local gateway runs `uvicorn --reload`, so this edit must wait until no runis in flight** — the reload severs live sandbox streams (A1's validator died exactly that way).Arm D constants: `REVIEW_MODEL`/`VALIDATION_MODEL = "claude-fable-5"`,diff --git a/products/review_hog/eval/experiments/2026-07-prompt-caching/CANDIDATES.md b/products/review_hog/eval/experiments/2026-07-prompt-caching/CANDIDATES.mdindex 4ac73a73a2dd..4026d14489f1 100644--- a/products/review_hog/eval/experiments/2026-07-prompt-caching/CANDIDATES.md+++ b/products/review_hog/eval/experiments/2026-07-prompt-caching/CANDIDATES.md@@ -74,7 +74,7 @@| hedges (unsequenced) | #5 Arm B (blind-spot as warm continuation turn, C5-guarded); #9 Arm A (prompt turn budget — tension with constraint 1, last if at all) | ~$2.9 and ~$3/run respectively (same re-anchor caveat) |**Harness path (resolved 2026-07-06):** the fork's harness changes (T2 cache-stable system prompt, T3 raw-JSONL-fork-seed) are patched directly in the local PostHog Code checkout (`/Users/woutut/Documents/Code/code`); the proven+fork-seed) are patched directly in the local PostHog Desktop checkout (`/Users/woutut/Documents/Code/code`); the provenbuild/overlay/verify loop and exact patch surfaces are in `HARNESS.md`. How the fixes ship upstream is decided afterthe experiment proves value.@@ -309,7 +309,7 @@ off-touched-file findings not collapsed to ~0 while control > 0 (a rate comparisso every arm is also judged where it matters most (judge-based scoring; no old-reviewer yardstick exists for it).- All cost gates are cache-aware and RELATIVE to the measured sonnet-era control (Gate 0 = #1); opus-era absolutes($0.10/turn, $19.6 review stage, $5.3 blind-spot slice) are sizing inputs only.-- Harness work (V1/V2/V3 fixes, T1-T3 in INVESTIGATION.md) lives in the PostHog Code repo. 2026-07-06: the user opened+- Harness work (V1/V2/V3 fixes, T1-T3 in INVESTIGATION.md) lives in the PostHog Desktop repo. 2026-07-06: the user openedlocal two-repo experimentation — experiments may run on a locally patched `packages/agent`; shipping the fixes upstreamis a separate, later decision.- Validators keep fresh sessions; nothing here seeds a validator from review/warm-up transcripts.diff --git a/products/review_hog/eval/experiments/2026-07-prompt-caching/HARNESS.md b/products/review_hog/eval/experiments/2026-07-prompt-caching/HARNESS.mdindex 5b912429185d..9632e657c8f9 100644--- a/products/review_hog/eval/experiments/2026-07-prompt-caching/HARNESS.md+++ b/products/review_hog/eval/experiments/2026-07-prompt-caching/HARNESS.md@@ -1,7 +1,7 @@-# Harness (PostHog Code repo) — local patch, build, and verify loop (recon 2026-07-06)+# Harness (PostHog Desktop repo) — local patch, build, and verify loop (recon 2026-07-06)> Companion to `CANDIDATES.md` #8 (warm-up+fork flagship) and `PLAN.md`. The user approved local two-repo-> experimentation 2026-07-06: T2/T3-class harness changes are patched in the local PostHog Code checkout at+> experimentation 2026-07-06: T2/T3-class harness changes are patched in the local PostHog Desktop checkout at> `/Users/woutut/Documents/Code/code` for experiments; upstreaming is a later, separate decision.> All file:line anchors below are as of 2026-07-06 and will drift; function names are the stable anchors.diff --git a/products/review_hog/eval/experiments/2026-07-prompt-caching/INVESTIGATION.md b/products/review_hog/eval/experiments/2026-07-prompt-caching/INVESTIGATION.mdindex b301948b658b..680af48767d3 100644--- a/products/review_hog/eval/experiments/2026-07-prompt-caching/INVESTIGATION.md+++ b/products/review_hog/eval/experiments/2026-07-prompt-caching/INVESTIGATION.md@@ -53,11 +53,11 @@ Instrument: `eval/scripts/dump_result.py` (cache-aware split, validated Δ +0.0%- **Shipped:** the cache-aware metrology (`dump_result.py`), validated live; the probe-era "+28% gateway-vs-list discrepancy" resolved as a measurement artifact.- **Dropped/demoted:** the pre-build overlap gate (Spike 3) and the standalone gateway probe (Spike 1) — the fork build's own mechanics gate (follower turn-1 cache reads ≈ warm-up transcript size) subsumes the substrate check. The T1 rewrite-bug ticket is pending re-quantification on fresh runs (expected: demote; crude post-flip probe found ~$0.005/run).-- **Next experiment:** the warm-up+fork build — T2+T3 patched locally in the PostHog Code checkout (approved working mode, `HARNESS.md`), Spike 2 (stripped-form fork fidelity) as first milestone, then the ReviewHog warm-up stage behind an on/off constant, then 2 arm vs 2 control runs on frozen PR #62096. Harness fixes ship upstream only after the experiment proves value.+- **Next experiment:** the warm-up+fork build — T2+T3 patched locally in the PostHog Desktop checkout (approved working mode, `HARNESS.md`), Spike 2 (stripped-form fork fidelity) as first milestone, then the ReviewHog warm-up stage behind an on/off constant, then 2 arm vs 2 control runs on frozen PR #62096. Harness fixes ship upstream only after the experiment proves value.## Key files- this repo: `products/review_hog/backend/temporal/workflow.py` (fan-out; where the warm-up slots in), `backend/reviewer/sandbox/executor.py` (prompt→description; `MultiTurnSession`), `backend/reviewer/constants.py` (`REVIEW_MODEL`, on/off knobs), `products/tasks/backend/temporal/process_task/activities/provision_sandbox.py` (sandbox env injection, incl. `ENABLE_PROMPT_CACHING_1H`), `get_sandbox_for_repository.py` (branch-ref checkout to SHA-pin), `eval/scripts/dump_result.py` (validated cost instrument)-- code repo (PostHog Code): `packages/agent/src/server/agent-server.ts` (`buildCloudSystemPrompt`, Task-Id append), `packages/agent/src/adapters/claude/session/options.ts` (systemPrompt build; Bedrock header), `packages/agent/src/adapters/claude/session/jsonl-hydration.ts` (raw JSONL path; lossy hydration to avoid)+- code repo (PostHog Desktop): `packages/agent/src/server/agent-server.ts` (`buildCloudSystemPrompt`, Task-Id append), `packages/agent/src/adapters/claude/session/options.ts` (systemPrompt build; Bedrock header), `packages/agent/src/adapters/claude/session/jsonl-hydration.ts` (raw JSONL path; lossy hydration to avoid)Line references drift; function names are the stable anchors. Exact patch surfaces with line numbers: `HARNESS.md`.diff --git a/products/review_hog/eval/experiments/2026-07-prompt-caching/PLAN.md b/products/review_hog/eval/experiments/2026-07-prompt-caching/PLAN.mdindex d0d8c73eb525..a80a601b4c95 100644--- a/products/review_hog/eval/experiments/2026-07-prompt-caching/PLAN.md+++ b/products/review_hog/eval/experiments/2026-07-prompt-caching/PLAN.md@@ -41,7 +41,7 @@ Three deliverables, in priority order:chunk-local rescheduling; can the blind-spot be a 5th forker). Compute on the largest available multi-chunk runs as well asfrozen #62096 — large PRs are the program's priority (locked 2026-07-06).-Non-goals: NO pipeline changes, NO eval runs, NO harness (PostHog Code repo) changes, NO builds of #4/#8/#10. Zero prod risk by construction.+Non-goals: NO pipeline changes, NO eval runs, NO harness (PostHog Desktop repo) changes, NO builds of #4/#8/#10. Zero prod risk by construction.## Working mode (locked with the user 2026-07-06)@@ -167,7 +167,7 @@ table with rates, recommendations, cost totals) plus:4. CANDIDATES.md re-anchored (its $ figures and the measured-facts section updated with sonnet-era cache-aware numbers)5. recommendation for the next rounds, for the user to greenlight: Round 1 default per CANDIDATES.md = #4 skill-body splice +#10 pre-pack (after its pre-gate); flagship verdict = fork ladder GO/STOP from s + substrate. Harness path is resolved- (2026-07-06): experiments run on a locally patched PostHog Code checkout (`/Users/woutut/Documents/Code/code`);+ (2026-07-06): experiments run on a locally patched PostHog Desktop checkout (`/Users/woutut/Documents/Code/code`);upstreaming is decided after the experiment proves value## Run logdiff --git a/products/review_hog/eval/experiments/2026-07-reviewer-model-sonnet5/FINAL_REPORT.md b/products/review_hog/eval/experiments/2026-07-reviewer-model-sonnet5/FINAL_REPORT.mdindex 83b5d709b6c4..7a7cf5fb89f0 100644--- a/products/review_hog/eval/experiments/2026-07-reviewer-model-sonnet5/FINAL_REPORT.md+++ b/products/review_hog/eval/experiments/2026-07-reviewer-model-sonnet5/FINAL_REPORT.md@@ -112,7 +112,7 @@ item-3 C-win path; or (b) the latency win (~15%) starts mattering for the Inboxmotive, test **sonnet-5 @ high** first — xhigh's extra turns are where the price edge goes to die.Registry enablement (`claude-sonnet-5` in `CLAUDE_REASONING_EFFORTS_BY_MODEL`) ships regardless — it's parity with-the agent/gateway/PostHog Code and unblocks any future flip, Slack picker, or per-user choice.+the agent/gateway/PostHog Desktop and unblocks any future flip, Slack picker, or per-user choice.> **Decision postscript (2026-07-03):** the user chose to flip prod to `claude-sonnet-5 @ xhigh` immediately> (flip-and-watch: dogfood volume means the live-PR confirmation happens in prod, and the change is a one-constantdiff --git a/products/signals/backend/auto_start.py b/products/signals/backend/auto_start.pyindex 7b25efa7a4f2..01de720437c1 100644--- a/products/signals/backend/auto_start.py+++ b/products/signals/backend/auto_start.py@@ -148,7 +148,7 @@ def _build_autostart_task_description("turn summary why you didn't open the PR directly. Err on the side of caution to avoid committing a ""social faux pas in someone else's project.\n\n""When opening the PR, include this report link in the description footer, "- "making the footer '*Created with [PostHog Code](https://posthog.com/code?ref=pr) "+ "making the footer '*Created with [PostHog Desktop](https://posthog.com/code?ref=pr) "f"from [this inbox report]({report_link}).' - ""so the human reviewer can jump straight to it.")diff --git a/products/signals/backend/slack_inbox_notifications.py b/products/signals/backend/slack_inbox_notifications.pyindex f4261d016224..32ad05b61279 100644--- a/products/signals/backend/slack_inbox_notifications.py+++ b/products/signals/backend/slack_inbox_notifications.py@@ -59,7 +59,7 @@ _SLACK_HEADER_MAX_LEN = 150# Bound message size / avoid pinging a crowd._MAX_REVIEWER_MENTIONS = 5-# Deep link opened by the PostHog Code desktop app. Override via env for dev (`posthog-code-dev`).+# Deep link opened by the PostHog Desktop app. Override via env for dev (`posthog-code-dev`).POSTHOG_CODE_INBOX_DEEP_LINK_SCHEME = getattr(settings, "POSTHOG_CODE_INBOX_DEEP_LINK_SCHEME", "posthog-code")# Priority ranking — lower index is higher priority. Index used for threshold comparison.@@ -377,7 +377,7 @@ def _build_message_blocks(# Bound how many evidence signals we post into a thread so a large report can't flood a channel._MAX_THREAD_SIGNALS = 30# Explicit "Product · Signal type" labels, mirroring `signalCardSourceLine` in the canonical Inbox UI-# (PostHog Code's apps/code/.../detail/SignalCard.tsx). Keep in sync with it.+# (PostHog Desktop's apps/code/.../detail/SignalCard.tsx). Keep in sync with it._SIGNAL_SOURCE_LINES: dict[tuple[str, str], str] = {("error_tracking", "issue_created"): "Error tracking · New issue",("error_tracking", "issue_reopened"): "Error tracking · Issue reopened",diff --git a/products/signals/backend/test/test_agentic_report_activity.py b/products/signals/backend/test/test_agentic_report_activity.pyindex 1cbb1c99eecd..dbb8336d0de6 100644--- a/products/signals/backend/test/test_agentic_report_activity.py+++ b/products/signals/backend/test/test_agentic_report_activity.py@@ -243,7 +243,7 @@ async def test_select_repository_activity_no_repo(monkeypatch, ateam):@pytest.mark.asyncio@pytest.mark.django_dbasync def test_select_repository_activity_does_not_raise_with_only_user_integration(monkeypatch, ateam):- # PostHog Code installs land in `UserIntegration`, never on `Integration`. Before the cascade+ # PostHog Desktop installs land in `UserIntegration`, never on `Integration`. Before the cascade# was wired up, this combination raised `RuntimeError("No GitHub integration found ...")` and# killed the activity. Now it must resolve a user_id and reach `select_repository_for_report`.user = await sync_to_async(User.objects.create)(email=f"posthog-code-{random.randint(1, 99999)}@example.com")diff --git a/products/signals/skills/exploring-scouts/SKILL.md b/products/signals/skills/exploring-scouts/SKILL.mdindex 58712657bc2f..79abf3d15285 100644--- a/products/signals/skills/exploring-scouts/SKILL.md+++ b/products/signals/skills/exploring-scouts/SKILL.md@@ -74,7 +74,7 @@ Read the result against three cases:- **Empty (`results: []`)** — no scouts are registered.The project isn't enrolled in the scout fleet (or hasn't ticked yet).Say so plainly; don't go fishing for runs.- Point the user at the Signals scout settings / PostHog Code onboarding rather than inventing activity.+ Point the user at the Signals scout settings / PostHog Desktop onboarding rather than inventing activity.- **Configs exist but all `enabled: false`** — the fleet is registered but paused.Nothing is running.Tell the user which scouts exist and that they're all off.diff --git a/products/signals/skills/inbox-exploration/SKILL.md b/products/signals/skills/inbox-exploration/SKILL.mdindex 3229bf097a76..2241d40d81c5 100644--- a/products/signals/skills/inbox-exploration/SKILL.md+++ b/products/signals/skills/inbox-exploration/SKILL.md@@ -17,7 +17,7 @@ The **Inbox** is where PostHog surfaces signal reports — clusters of related o/checkout"). Reports come from multiple source products: error tracking, session replay, webanalytics, experiments, and integrations like Linear, GitHub, and Zendesk.-Inbox is part of [PostHog Code](https://posthog.com/code), PostHog's agentic surface for+Inbox is part of [PostHog Desktop](https://posthog.com/code), PostHog's agentic surface forengineering teams.Don't assume the user's project has reports, or that any signal sources are configured — plenty@@ -147,12 +147,12 @@ Three meaningful cases:The user hasn't onboarded to Inbox / signals. **Don't pretend the inbox has data.** Tell the userplainly that Inbox needs signal sources to be set up first, and that the recommended way to do-this is to install **PostHog Code** at <https://posthog.com/code>. Example response:+this is to install **PostHog Desktop** at <https://posthog.com/code>. Example response:> Your project doesn't have any signal sources configured yet, so the Inbox is empty. Inbox surfaces> issues and trends that PostHog automatically clusters from sources like error tracking, session> replay, GitHub, Linear, and Zendesk. The fastest way to set this up is to install-> [PostHog Code](https://posthog.com/code) — once it's connected, signals will start flowing in+> [PostHog Desktop](https://posthog.com/code) — once it's connected, signals will start flowing in> and reports will appear in your inbox over the next day or so.Stop here unless the user wants to discuss setup. Don't run further inbox tools — they'll all be@@ -458,7 +458,7 @@ inbox-source-configs-partial-update- **Check setup before assuming the inbox is empty.** If `inbox-reports-list` returns `count: 0`,call `inbox-source-configs-list` first — no sources means the user needs to install- [PostHog Code](https://posthog.com/code) to start receiving signals; sources-but-no-reports+ [PostHog Desktop](https://posthog.com/code) to start receiving signals; sources-but-no-reportsmeans signals are flowing but nothing has clustered yet- **Always surface `_posthogUrl`** so the user can click through to the report- The default ordering already prioritizes the user's suggested reports — don't reorder unlessdiff --git a/products/slack_app/backend/api.py b/products/slack_app/backend/api.pyindex aaad71ab0817..2d038d4ccadc 100644--- a/products/slack_app/backend/api.py+++ b/products/slack_app/backend/api.py@@ -651,7 +651,7 @@ _VALID_WORKSPACE_CLAIM_KINDS = frozenset(SLACK_INTEGRATION_KINDS)def slack_workspace_claims_view(request: HttpRequest) -> HttpResponse:"""Cross-region probe: does this region hold an Integration row for the given Slack workspace?- Both Cloud regions provision the PostHog Code Slack signing secret, so a region can HMAC-sign+ Both Cloud regions provision the PostHog Desktop Slack signing secret, so a region can HMAC-signa small JSON body and the receiver can verify it with the same routine that validates realSlack webhooks. The signed body covers `slack_team_id` + `kinds`, so a captured signaturecannot be replayed against a different workspace.diff --git a/products/slack_app/backend/services/slack_app_home.py b/products/slack_app/backend/services/slack_app_home.pyindex 2648f64051bb..ea87e610a5c0 100644--- a/products/slack_app/backend/services/slack_app_home.py+++ b/products/slack_app/backend/services/slack_app_home.py@@ -430,7 +430,7 @@ def _active_model_blocks(effective: AIPreferences, source: PreferenceSource) ->"type": "section","text": {"type": "mrkdwn",- "text": "Inheriting PostHog Code's default — pick personal or workspace settings to override.",+ "text": "Inheriting PostHog Desktop's default — pick personal or workspace settings to override.",},},source_blurb,@@ -1217,7 +1217,6 @@ def handle_app_home_view_submission(payload: dict) -> HttpResponse | JsonResponsdef _get_slack_integration(slack_team_id: str) -> Integration | None:-if not slack_team_id:return Nonereturn (@@ -1228,7 +1227,6 @@ def _get_slack_integration(slack_team_id: str) -> Integration | None:def _load_rows(integration: Integration, slack_user_id: str) -> tuple[SlackSettings | None, SlackSettings | None]:-user_row = SlackSettings.objects.filter(slack_workspace_id=integration.integration_id,slack_user_id=slack_user_id,@@ -1251,7 +1249,6 @@ def _row_to_settings(row: SlackSettings | None) -> AIPreferences:def _is_admin(slack: SlackIntegration, integration: Integration, slack_user_id: str) -> bool:-try:return is_slack_workspace_admin(slack, integration, slack_user_id)except Exception:diff --git a/products/slack_app/backend/tests/test_guess_repository.py b/products/slack_app/backend/tests/test_guess_repository.pyindex 099b503556ee..a13e216fdbc3 100644--- a/products/slack_app/backend/tests/test_guess_repository.py+++ b/products/slack_app/backend/tests/test_guess_repository.py@@ -595,7 +595,7 @@ class TestHandleRulesCommandActivity:assert result.status == "handled"msg = mock_slack.client.chat_postMessage.call_argsassert "@PostHog <task description>" in msg.kwargs["text"]- assert "@PostHog Code" not in msg.kwargs["text"]+ assert "@PostHog Desktop" not in msg.kwargs["text"]@patch("posthog.models.integration.SlackIntegration")def test_list_shows_rules(self, mock_slack_cls):diff --git a/products/slack_app/backend/tests/test_slack_thread.py b/products/slack_app/backend/tests/test_slack_thread.pyindex 4ea2e744d128..17f7b72bdc60 100644--- a/products/slack_app/backend/tests/test_slack_thread.py+++ b/products/slack_app/backend/tests/test_slack_thread.py@@ -200,7 +200,7 @@ def _button_texts(action_block: dict) -> list[str]:class TestSlackThreadHandlerWithoutTaskUrl(SimpleTestCase):- """A ``task_url=None`` payload signals the recipient does not have PostHog Code access.+ """A ``task_url=None`` payload signals the recipient does not have PostHog Desktop access.Each renderer must drop the PostHog button (or the entire actions block whenthat was the only button) so the message stays useful without dangling at adiff --git a/products/stamphog/backend/temporal/activities.py b/products/stamphog/backend/temporal/activities.pyindex 801ef5cdf567..26b6e809adf9 100644--- a/products/stamphog/backend/temporal/activities.py+++ b/products/stamphog/backend/temporal/activities.py@@ -114,7 +114,7 @@ def _mint_reviewer_gateway_token(run: ReviewRun) -> str:tasks uses with ``task.created_by``), under the shared sandbox OAuth app, carrying only``llm_gateway:read`` plus the ``internal_run:read`` provenance marker — the gateway's stamphogroute sets ``requires_server_credential`` and refuses OAuth tokens without the marker, so a- user's own Code OAuth token can't reach the route. The marker is passed explicitly instead of+ user's own Desktop OAuth token can't reach the route. The marker is passed explicitly instead of``include_internal_scopes=True`` to keep the rest of the internal bundle (``task:write``) out ofa sandbox that runs an LLM over untrusted PR content. If that PR coaxes the reviewer intoleaking the token, it buys a few hours of stamphog-route LLM calls and nothing else — thediff --git a/products/tasks/backend/access.py b/products/tasks/backend/access.pyindex 2cdf7bfd3e18..bb8a0404f41b 100644--- a/products/tasks/backend/access.py+++ b/products/tasks/backend/access.py@@ -29,7 +29,7 @@ def _is_flag_enabled(flag_key: str, user: User, team: "Team | None" = None) -> bdef has_tasks_access(user: User) -> bool:"""- User has access to PostHog Code if the `tasks` feature flag is enabled for them+ User has access to PostHog Desktop if the `tasks` feature flag is enabled for themOR they have redeemed an invite code."""if not user or not user.is_authenticated:diff --git a/products/tasks/backend/automation_service.py b/products/tasks/backend/automation_service.pyindex 37beeb887291..620cb5c9d7f7 100644--- a/products/tasks/backend/automation_service.py+++ b/products/tasks/backend/automation_service.py@@ -68,7 +68,7 @@ def run_task_automation(automation_id: str, trigger_workflow_id: str | None = Notask = automation.taskif task.created_by is not None and not has_tasks_access(task.created_by):- raise PermissionDenied("PostHog Code access is required to run task automations")+ raise PermissionDenied("PostHog Desktop access is required to run task automations")if trigger_workflow_id:existing_task_run_query = TaskRun.objects.select_related("task").filter(diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.pyindex 807288bbc911..ca77b2b14b16 100644--- a/products/tasks/backend/facade/api.py+++ b/products/tasks/backend/facade/api.py@@ -1126,11 +1126,11 @@ def create_completed_sandbox_snapshot(external_id: str) -> UUID:return snapshot.id-# --- Code invites ---+# --- Desktop invites ---def redeem_code_invite(code: str, user_id: int) -> contracts.CodeInviteRedeemResult:- """Redeem a PostHog Code invite for a user.+ """Redeem a PostHog Desktop invite for a user.Idempotent: a user who already redeemed this code gets ``REDEEMED`` without a secondredemption row. A fresh redemption takes a row lock on the invite, re-checksdiff --git a/products/tasks/backend/facade/contracts.py b/products/tasks/backend/facade/contracts.pyindex 7d6a3ba54c83..4abb12017136 100644--- a/products/tasks/backend/facade/contracts.py+++ b/products/tasks/backend/facade/contracts.py@@ -479,7 +479,7 @@ class CreatedTaskDTO:@dataclass(frozen=True)class CodeInviteRedeemResult:- """Outcome of attempting to redeem a PostHog Code invite.+ """Outcome of attempting to redeem a PostHog Desktop invite.``outcome`` is one of ``redeemed`` (or ``already_redeemed``), ``invalid_code``, or``not_redeemable``. The presentation layer maps it to the success/error HTTP response;diff --git a/products/tasks/backend/logic/services/code_usage_gate.py b/products/tasks/backend/logic/services/code_usage_gate.pyindex 235bafdef76e..6c833f2a16a8 100644--- a/products/tasks/backend/logic/services/code_usage_gate.py+++ b/products/tasks/backend/logic/services/code_usage_gate.py@@ -119,7 +119,7 @@ def get_posthog_code_usage(user, team_id: int) -> CodeUsageStatus | None:def rate_limit_error_payload(usage: CodeUsageStatus) -> dict[str, Any]:- """Structured 429 body the PostHog Code client parses into its upgrade prompt.+ """Structured 429 body the PostHog Desktop client parses into its upgrade prompt.Omits unknown bucket/reset fields so they don't render as null in the sharederror serializer (which other error responses reuse).@@ -127,7 +127,7 @@ def rate_limit_error_payload(usage: CodeUsageStatus) -> dict[str, Any]:payload: dict[str, Any] = {"type": "rate_limited","code": "usage_limit_exceeded",- "error": "You've reached your PostHog Code usage limit.",+ "error": "You've reached your PostHog Desktop usage limit.","is_pro": usage.is_pro,}if usage.limit_type is not None:@@ -145,7 +145,7 @@ def code_access_required_response(user) -> Response | None:{"type": "permission_denied","code": "code_access_required",- "error": "PostHog Code access is required to run tasks in the cloud.",+ "error": "PostHog Desktop access is required to run tasks in the cloud.",}).data,status=status.HTTP_403_FORBIDDEN,@@ -153,7 +153,7 @@ def code_access_required_response(user) -> Response | None:def cloud_usage_limit_response(user, team_id: int) -> Response | None:- """Return a blocking response when Code access or usage limits deny a cloud run, else None.+ """Return a blocking response when Desktop access or usage limits deny a cloud run, else None.Entitlement checks fail closed. Usage checks fail open when the gateway can't be reached.Every usage check is counted by outcome (`checked_allowed` / `checked_blocked` / `fail_open`)diff --git a/products/tasks/backend/logic/services/docker_sandbox.py b/products/tasks/backend/logic/services/docker_sandbox.pyindex 30455c4f0296..afcac19487b2 100644--- a/products/tasks/backend/logic/services/docker_sandbox.py+++ b/products/tasks/backend/logic/services/docker_sandbox.py@@ -164,9 +164,9 @@ class DockerSandbox(SandboxBase):@staticmethoddef _get_local_posthog_code_packages() -> tuple[str, str, str, str] | None:"""- Get paths to local PostHog Code packages for development builds.+ Get paths to local PostHog Desktop packages for development builds.- Configure via LOCAL_POSTHOG_CODE_MONOREPO_ROOT pointing to the PostHog Code monorepo root.+ Configure via LOCAL_POSTHOG_CODE_MONOREPO_ROOT pointing to the PostHog Desktop monorepo root.Returns tuple of (agent_path, shared_path, git_path, enricher_path) or None if not configured."""monorepo_root = os.environ.get(@@ -252,8 +252,8 @@ class DockerSandbox(SandboxBase):@staticmethoddef _build_local_image(agent_path: str, shared_path: str, git_path: str, enricher_path: str) -> None:- """Build the local sandbox image with local PostHog Code packages."""- logger.info("Building posthog-sandbox-base-local image with local PostHog Code packages...")+ """Build the local sandbox image with local PostHog Desktop packages."""+ logger.info("Building posthog-sandbox-base-local image with local PostHog Desktop packages...")dockerfile_path = os.path.join(settings.BASE_DIR, "products/tasks/backend/sandbox/images/Dockerfile.sandbox-local")diff --git a/products/tasks/backend/mentions.py b/products/tasks/backend/mentions.pyindex f0ee4cad5204..4dbf27efefb6 100644--- a/products/tasks/backend/mentions.py+++ b/products/tasks/backend/mentions.py@@ -1,7 +1,7 @@"""Parsing and user resolution for @-mention tokens embedded in thread message content.Mentions are stored inline as ``@[Display Name](email)`` (the canonical format-shared with PostHog Code clients), so any layer can answer "who does this+shared with PostHog Desktop clients), so any layer can answer "who does thismessage mention?" from the plain string alone."""diff --git a/products/tasks/backend/migrations/0032_task_archived_archived_at.py b/products/tasks/backend/migrations/0032_task_archived_archived_at.pyindex eda69e7db23a..5982942b1183 100644--- a/products/tasks/backend/migrations/0032_task_archived_archived_at.py+++ b/products/tasks/backend/migrations/0032_task_archived_archived_at.py@@ -13,7 +13,7 @@ class Migration(migrations.Migration):field=models.BooleanField(default=False,help_text=(- "If true, the task is hidden from default list responses. Used by PostHog Code clients "+ "If true, the task is hidden from default list responses. Used by PostHog Desktop clients ""to share archive state across desktop and mobile."),),diff --git a/products/tasks/backend/models.py b/products/tasks/backend/models.pyindex 1016d4f0966e..438f6c630bf8 100644--- a/products/tasks/backend/models.py+++ b/products/tasks/backend/models.py@@ -60,7 +60,7 @@ def resolve_schema(schema: type[BaseModel] | dict) -> dict:class Channel(TeamScopedRootMixin):- """A shared feed of tasks (rendered as "#<name>" in PostHog Code). Every task is+ """A shared feed of tasks (rendered as "#<name>" in PostHog Desktop). Every task isowned by the channel it was kicked off in. Each user gets one private "personal"channel ("#me") per team, provisioned lazily on first channel list."""@@ -233,7 +233,7 @@ class Task(FileSystemSyncMixin, DeletedMetaFields, models.Model):archived = models.BooleanField(default=False,help_text=(- "If true, the task is hidden from default list responses. Used by PostHog Code clients "+ "If true, the task is hidden from default list responses. Used by PostHog Desktop clients ""to share archive state across desktop and mobile."),)@@ -1371,7 +1371,7 @@ class TaskRun(models.Model):help_text="Run state data for resuming or tracking execution state",)- # Local url-based MCP servers imported from the creating client (PostHog Code),+ # Local url-based MCP servers imported from the creating client (PostHog Desktop),# merged into the sandbox agent server's --mcpServers at spawn. Encrypted because# header values carry credentials; never exposed through API responses.imported_mcp_servers = EncryptedJSONStringField(@@ -2453,7 +2453,7 @@ class SandboxCustomImage(TeamScopedRootMixin):class CodeInvite(UUIDModel):- """Invite codes for PostHog Code access."""+ """Invite codes for PostHog Desktop access."""code = models.CharField(max_length=50, unique=True, db_index=True, blank=True)max_redemptions = models.PositiveIntegerField(default=1, help_text="Maximum number of redemptions. 0 = unlimited.")@@ -2498,7 +2498,7 @@ class CodeInvite(UUIDModel):class CodeInviteRedemption(UUIDModel):- """Tracks each redemption of a PostHog Code invite."""+ """Tracks each redemption of a PostHog Desktop invite."""invite_code = models.ForeignKey(CodeInvite, on_delete=models.CASCADE, related_name="redemptions")user = models.ForeignKey("posthog.User", on_delete=models.CASCADE)@@ -2521,7 +2521,7 @@ TASK_PRESENCE_TTL_SECONDS = 60class TaskPresence(TeamScopedRootMixin):"""Per-device 'this user is actively watching this task' beacon.- Created/refreshed by the desktop and mobile PostHog Code clients while a+ Created/refreshed by the desktop and mobile PostHog Desktop clients while atask screen is foregrounded. The push fanout consults this table to skipdevices that are demonstrably already watching the task, so we don't firephantom notifications at a phone while the user is mid-conversation withdiff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.pyindex 5a190e064945..8b267f3edcfa 100644--- a/products/tasks/backend/presentation/serializers.py+++ b/products/tasks/backend/presentation/serializers.py@@ -327,7 +327,7 @@ class WizardCloudRunSerializer(DataclassSerializer):# The relationship a client asserts between a task and a signal report when creating a task from the-# report (e.g. PostHog Code inbox), recorded as a signals `task_run` work-log entry. This is a+# report (e.g. PostHog Desktop inbox), recorded as a signals `task_run` work-log entry. This is a# free-form label — the same as the `task_run` artefact `(product, type)` values, which have never# been access-controlled — so no relationship is reserved here either. `implementation` additionally# opens the auto-start spend gate (recorded server-side via `record_report_task`). Only the routing-@@ -1611,7 +1611,7 @@ class ImportedMcpServersFieldMixin(serializers.Serializer):default=None,write_only=True,help_text=(- "Local url-based MCP servers from the creating client (PostHog Code) to make "+ "Local url-based MCP servers from the creating client (PostHog Desktop) to make ""available inside the cloud sandbox. Header values are treated as credentials: ""stored encrypted and never returned by the API."),@@ -1651,7 +1651,7 @@ class RelayedMcpServersFieldMixin(serializers.Serializer):default=None,write_only=True,help_text=(- "Names of desktop-only MCP servers the creating client (PostHog Code) relays into the "+ "Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the ""cloud sandbox over the durable event/command channel. Names only — the server ""configuration (command, env, URL, headers) never crosses the wire."),@@ -1783,7 +1783,7 @@ class TaskRunCreateRequestSerializer(ImportedMcpServersFieldMixin, RelayedMcpSerallow_blank=False,write_only=True,help_text=(- "Optional GitHub user token from PostHog Code for user-authored cloud pull requests. "+ "Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. ""Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; ""this field remains supported for callers that still manage their own tokens."),@@ -1962,7 +1962,7 @@ class TaskRunBootstrapCreateRequestSerializer(default=None,allow_blank=False,write_only=True,- help_text="Ephemeral GitHub user token from PostHog Code for user-authored cloud pull requests.",+ help_text="Ephemeral GitHub user token from PostHog Desktop for user-authored cloud pull requests.",)initial_permission_mode = serializers.ChoiceField(choices=ALL_INITIAL_PERMISSION_MODE_CHOICES,@@ -2252,7 +2252,7 @@ class TaskRunResumeRequestSchemaSerializer(serializers.Serializer):allow_blank=False,write_only=True,help_text=(- "Optional GitHub user token from PostHog Code for user-authored cloud pull requests. "+ "Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. ""Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; ""this field remains supported for callers that still manage their own tokens."),diff --git a/products/tasks/backend/presentation/views/api.py b/products/tasks/backend/presentation/views/api.pyindex 5a7e15b3cbe5..5599f7ef19d2 100644--- a/products/tasks/backend/presentation/views/api.py+++ b/products/tasks/backend/presentation/views/api.py@@ -2251,7 +2251,7 @@ class TaskRunLivingArtifactViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewS@extend_schema(tags=["code-invites"])class CodeInviteViewSet(viewsets.ViewSet):- """API for redeeming PostHog Code invite codes."""+ """API for redeeming PostHog Desktop invite codes."""authentication_classes = [SessionAuthentication,@@ -2281,7 +2281,7 @@ class CodeInviteViewSet(viewsets.ViewSet):),},summary="Redeem invite code",- description="Redeem a PostHog Code invite code to enable access.",+ description="Redeem a PostHog Desktop invite code to enable access.",)@action(detail=False, methods=["post"], url_path="redeem")def redeem(self, request, **kwargs):@@ -2305,7 +2305,7 @@ class CodeInviteViewSet(viewsets.ViewSet):200: OpenApiResponse(description="Access check result"),},summary="Check access",- description="Check whether the authenticated user has access to PostHog Code and to Loops.",+ description="Check whether the authenticated user has access to PostHog Desktop and to Loops.",)@action(detail=False, methods=["get"], url_path="check-access")def check_access(self, request, **kwargs):diff --git a/products/tasks/backend/presentation/views/seat_api.py b/products/tasks/backend/presentation/views/seat_api.pyindex 889fc60be2c9..7927be946b03 100644--- a/products/tasks/backend/presentation/views/seat_api.py+++ b/products/tasks/backend/presentation/views/seat_api.py@@ -27,8 +27,8 @@ from ee.settings import BILLING_SERVICE_URL# Duplicated in services/llm-gateway/src/llm_gateway/services/plan_resolver.pyPRO_PLAN_PREFIXES = ("posthog-code-200", "posthog-code-pro-")RETIRED_SEAT_PRODUCT_MESSAGE = (- "You can no longer create, upgrade, or reactivate PostHog Code seats. "- "PostHog Code with usage-based billing launched on July 16, 2026, "+ "You can no longer create, upgrade, or reactivate PostHog Desktop seats. "+ "PostHog Desktop with usage-based billing launched on July 16, 2026, ""and existing seats expire on the same date.")RETIRED_SEAT_PRODUCTS = {"posthog_code": RETIRED_SEAT_PRODUCT_MESSAGE}diff --git a/products/tasks/backend/push_dispatcher.py b/products/tasks/backend/push_dispatcher.pyindex 2ed015f0d7dd..8bc88c33cc14 100644--- a/products/tasks/backend/push_dispatcher.py+++ b/products/tasks/backend/push_dispatcher.py@@ -40,7 +40,7 @@ if TYPE_CHECKING:logger = structlog.get_logger(__name__)-PUSH_TITLE = "PostHog Code"+PUSH_TITLE = "PostHog Desktop"FEATURE_FLAG_KEY = "posthog-code-mobile-push"# Cooldown windows per push kind. Terminal pushes get a longer window becausediff --git a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-base b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-baseindex 6fc629e0dabe..2a847c849d6c 100644--- a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-base+++ b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-base@@ -153,7 +153,7 @@ RUN chmod +x /tmp/install-skills.sh && \# Runs configured for user-authored pull requests receive# GIT_AUTHOR_*/GIT_COMMITTER_* env vars that override these defaults.RUN git config --global user.email "[email protected]" && \- git config --global user.name "PostHog Code"+ git config --global user.name "PostHog Desktop"# Block `git commit`/`git push` so unsigned commits cannot leave the sandboxCOPY products/tasks/backend/sandbox/images/git-guard.sh /opt/posthog/bin/gitdiff --git a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-local b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-localindex a0ab68755ab6..7c66546dd5dd 100644--- a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-local+++ b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-local@@ -1,6 +1,6 @@# Dockerfile for local agent development - builds on top of sandbox-base# This image should be rebuilt when the local agent package changes-# Set LOCAL_POSTHOG_CODE_MONOREPO_ROOT to the path to the PostHog Code monorepo to use this in DockerSandbox+# Set LOCAL_POSTHOG_CODE_MONOREPO_ROOT to the path to the PostHog Desktop monorepo to use this in DockerSandboxFROM posthog-sandbox-basediff --git a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-notebook b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-notebookindex 706ef0e84cd8..a0faa1ee9c1d 100644--- a/products/tasks/backend/sandbox/images/Dockerfile.sandbox-notebook+++ b/products/tasks/backend/sandbox/images/Dockerfile.sandbox-notebook@@ -86,7 +86,7 @@ RUN cd /scripts && \# Runs configured for user-authored pull requests receive# GIT_AUTHOR_*/GIT_COMMITTER_* env vars that override these defaults.RUN git config --global user.email "[email protected]" && \- git config --global user.name "PostHog Code"+ git config --global user.name "PostHog Desktop"# Block `git commit`/`git push` so unsigned commits cannot leave the sandbox.COPY products/tasks/backend/sandbox/images/git-guard.sh /opt/posthog/bin/gitdiff --git a/products/tasks/backend/sandbox/images/git-guard.sh b/products/tasks/backend/sandbox/images/git-guard.shindex 08670eab5821..32ec0ecce9a2 100644--- a/products/tasks/backend/sandbox/images/git-guard.sh+++ b/products/tasks/backend/sandbox/images/git-guard.sh@@ -48,7 +48,7 @@ donecase "$subcommand" incommit|push)- echo "git $subcommand is disabled in PostHog Code: commits must be signed." >&2+ echo "git $subcommand is disabled in PostHog Desktop: commits must be signed." >&2echo "To commit: stage changes with 'git add', then call the git_signed_commit tool." >&2echo "To force-push after a rebase/conflict fix: call the git_signed_rewrite tool." >&2exit 1diff --git a/products/tasks/backend/temporal/process_task/README.md b/products/tasks/backend/temporal/process_task/README.mdindex 23cd1268d534..f0cbf33021d2 100644--- a/products/tasks/backend/temporal/process_task/README.md+++ b/products/tasks/backend/temporal/process_task/README.md@@ -52,7 +52,7 @@ User ─────────────────────────### PostHog API-`backend/presentation/views/api.py` (thin viewsets) over `backend/facade/api.py` (behavior) — every user-triggered cloud launch path, including prewarming and task automations, checks server-side PostHog Code access before provisioning or activating a run. Scheduled automations repeat the entitlement check at execution time so revoked access cannot launch later. `TaskViewSet.run` creates a `TaskRun` (status=QUEUED) and starts the Temporal workflow. `TaskRunViewSet.partial_update` handles status transitions and signals the Temporal workflow on terminal statuses via `signal_workflow_completion`. `TaskRunViewSet.cancel` (`POST .../runs/{id}/cancel/`) is the user-facing kill switch: `cancel_task_run` interrupts the in-flight agent turn, signals `complete_task("cancelled")` so the workflow snapshots the session and tears down the sandbox, and falls back to finalizing the run directly when no workflow is running.+`backend/presentation/views/api.py` (thin viewsets) over `backend/facade/api.py` (behavior) — every user-triggered cloud launch path, including prewarming and task automations, checks server-side PostHog Desktop access before provisioning or activating a run. Scheduled automations repeat the entitlement check at execution time so revoked access cannot launch later. `TaskViewSet.run` creates a `TaskRun` (status=QUEUED) and starts the Temporal workflow. `TaskRunViewSet.partial_update` handles status transitions and signals the Temporal workflow on terminal statuses via `signal_workflow_completion`. `TaskRunViewSet.cancel` (`POST .../runs/{id}/cancel/`) is the user-facing kill switch: `cancel_task_run` interrupts the in-flight agent turn, signals `complete_task("cancelled")` so the workflow snapshots the session and tears down the sandbox, and falls back to finalizing the run directly when no workflow is running.### Temporal workflow@@ -114,7 +114,7 @@ Environment variables consumed inside the sandbox:4. **update_task_run_status** — Sets status to IN_PROGRESS5. **get_sandbox_for_repository** — Gets GitHub token from integration, creates OAuth access token, provisions sandbox, clones repo (unless snapshot used), stores sandbox credentials in TaskRun.state6. **start_agent_server** — Starts `npx agent-server` in sandbox, polls `/health` until ready-7. **wait_condition** — Workflow blocks with a 2-hour inactivity timeout, extended by `heartbeat` signals from the agent. PostHog Code or the agent server signals completion via the API+7. **wait_condition** — Workflow blocks with a 2-hour inactivity timeout, extended by `heartbeat` signals from the agent. PostHog Desktop or the agent server signals completion via the API8. Agent server calls `PATCH /api/projects/{team_id}/task_runs/{run_id}/` with terminal status9. API handler sends `complete_task(status, error_message)` signal to the Temporal workflow- A user can end the run early via `POST .../runs/{run_id}/cancel/`, which sends the same signal with status `cancelled`@@ -204,9 +204,9 @@ Set `SANDBOX_API_URL` to the ngrok URL. `SITE_URL` stays as `http://localhost:80## Frontend-- **TaskDetailPage** (`frontend/components/TaskDetailPage.tsx`) — Task detail view with run history, "Run task" button, "Open in PostHog Code" link+- **TaskDetailPage** (`frontend/components/TaskDetailPage.tsx`) — Task detail view with run history, "Run task" button, "Open in PostHog Desktop" link- **TaskSessionView** (`frontend/components/TaskSessionView.tsx`) — Live log streaming with hedgehog animation during agent execution-- PostHog Code integration via `posthog-code://task/{id}` deep links+- PostHog Desktop integration via `posthog-code://task/{id}` deep links## Key filesdiff --git a/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py b/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.pyindex bde97d9b82c5..d5da4c9457ad 100644--- a/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py+++ b/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py@@ -286,7 +286,7 @@ def _is_rtk_enabled() -> bool:"""rtk compression is on by default. The kill-switch flag wins over everything —a fleet-wide disable must not be pinned back on by a per-run override — and- otherwise the per-run state override (the user's toggle in PostHog Code settings)+ otherwise the per-run state override (the user's toggle in PostHog Desktop settings)applies. Fails open (enabled, override honored) on flag-service errors so thedefault posture is preserved."""try:diff --git a/products/tasks/backend/temporal/process_task/activities/post_slack_update.py b/products/tasks/backend/temporal/process_task/activities/post_slack_update.pyindex c38e35e81929..8ac8ebebd95f 100644--- a/products/tasks/backend/temporal/process_task/activities/post_slack_update.py+++ b/products/tasks/backend/temporal/process_task/activities/post_slack_update.py@@ -87,7 +87,7 @@ class PostSlackUpdateInput:def _viewer_has_posthog_code_access(viewer: User | None) -> bool:"""Fail closed: missing creator or any flag-service error suppresses the link.- The PostHog Code app is rolled out via cohort + invite redemption; surfacing+ The PostHog Desktop app is rolled out via cohort + invite redemption; surfacingdeep links to users who can't open them sends them into an install flow wedon't want to scale right now. Errors from the flag service therefore defaultto "no access" rather than "show the link anyway".diff --git a/products/tasks/backend/temporal/process_task/utils.py b/products/tasks/backend/temporal/process_task/utils.pyindex 8bda818cce61..b486710356df 100644--- a/products/tasks/backend/temporal/process_task/utils.py+++ b/products/tasks/backend/temporal/process_task/utils.py@@ -375,7 +375,7 @@ def get_sandbox_snapshot_metadata(snapshot: SandboxSnapshot) -> SnapshotMetadata# TTL for the per-run GitHub user token cache. Kept for backward-compat with callers-# (notably the PostHog Code CLI) that still pass ``github_user_token`` on the run request.+# (notably the PostHog Desktop CLI) that still pass ``github_user_token`` on the run request.# The server-side identity flow should be preferred going forward.GITHUB_USER_TOKEN_CACHE_TTL_SECONDS = 6 * 60 * 60@@ -615,8 +615,8 @@ def _resolve_mcp_consumer(interaction_origin: str | None) -> str:"""Map the task's interaction origin to the `x-posthog-mcp-consumer` value.Slack-launched runs send `"slack"` and posthog_ai (Max) runs send- `"posthog_ai"`; everything else (the PostHog Code UI, API callers, missing- origin) is treated as PostHog Code. Only `"posthog-code"` is a UI-apps host+ `"posthog_ai"`; everything else (the PostHog Desktop UI, API callers, missing+ origin) is treated as PostHog Desktop. Only `"posthog-code"` is a UI-apps hoston the MCP server — it gates UI-apps payload emission, so `"posthog_ai"` and`"slack"` deliberately don't get UI apps. Keep the `"posthog-code"` literalin sync with `POSTHOG_CODE_CONSUMER` in@@ -990,7 +990,7 @@ def _resolve_sandbox_github_token(Resolution order for ``USER`` authorship:1. Caller-supplied token cached at run-create time (backward compat for the- PostHog Code CLI — wins when present so self-managed tokens still work).+ PostHog Desktop CLI — wins when present so self-managed tokens still work).2. Server-side ``UserIntegration`` for the acting user, refreshing on demand.3. Team ``Integration`` token for legacy runs that predate persisted user identity.@@ -1201,7 +1201,7 @@ def get_git_identity_env_vars(task: Task, state: dict[str, Any] | None = None) -"""Return git author/committer env vars for the sandbox.Runs with user authorship are attributed to the acting user.- Bot-authored runs fall back to the Dockerfile defaults ("PostHog Code" /+ Bot-authored runs fall back to the Dockerfile defaults ("PostHog Desktop" /"""if get_pr_authorship_mode(task, state) != PrAuthorshipMode.USER:diff --git a/products/tasks/backend/temporal/process_task/workflow.py b/products/tasks/backend/temporal/process_task/workflow.pyindex 0c2ad2b91ba7..99ac5ffbafc2 100644--- a/products/tasks/backend/temporal/process_task/workflow.py+++ b/products/tasks/backend/temporal/process_task/workflow.py@@ -1038,7 +1038,7 @@ class ProcessTaskWorkflow(PostHogWorkflow):# those changes, opens the PR, and keeps it green (it never implements PostHog itself).await self._run_wizard_if_configured(sandbox_output)- # Start agent-server for direct connection from PostHog Code+ # Start agent-server for direct connection from PostHog Desktopif sandbox_output.agent_server_launched:agent_server_output = await self._await_agent_server_ready(sandbox_output)else:diff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.pyindex 2bb29f7e3bb4..65bfd8c9bf7e 100644--- a/products/tasks/backend/tests/test_api.py+++ b/products/tasks/backend/tests/test_api.py@@ -8360,7 +8360,7 @@ class TestTaskRunCommandAPI(BaseTaskAPITest):def test_command_no_control_verb_telemetry_for_non_posthog_ai(self, mock_post, mock_capture):reset_sandbox_jwt_key_cache()self._mock_agent_response(mock_post, {"jsonrpc": "2.0", "id": "req-2", "result": {"cancelled": True}})- # USER_CREATED task (e.g. PostHog Code) — the generic relay must not emit PostHog AI funnels.+ # USER_CREATED task (e.g. PostHog Desktop) — the generic relay must not emit PostHog AI funnels.task = self.create_task()run = self._create_run_with_sandbox(task)diff --git a/products/tasks/backend/tests/test_post_slack_update.py b/products/tasks/backend/tests/test_post_slack_update.pyindex 0d4c692353cb..1d641789d576 100644--- a/products/tasks/backend/tests/test_post_slack_update.py+++ b/products/tasks/backend/tests/test_post_slack_update.py@@ -517,7 +517,7 @@ class TestPostSlackUpdate(TestCase):mock_post_progress,mock_post_completion,):- # When the task creator is not a PostHog Code user, every handler call+ # When the task creator is not a PostHog Desktop user, every handler call# (including the progress handler) receives ``task_url=None`` so the# web buttons are skipped.self._access_patcher.stop()diff --git a/products/tasks/backend/tests/test_push_dispatcher.py b/products/tasks/backend/tests/test_push_dispatcher.pyindex 6be5495cf63a..eb1ea938570d 100644--- a/products/tasks/backend/tests/test_push_dispatcher.py+++ b/products/tasks/backend/tests/test_push_dispatcher.py@@ -56,7 +56,7 @@ class TestPushDispatcher(TestCase):mock_delay.assert_called_once()user_id, title, body, data, suppressed = mock_delay.call_args.argsself.assertEqual(user_id, self.user.id)- self.assertEqual(title, "PostHog Code")+ self.assertEqual(title, "PostHog Desktop")self.assertIn(expected_body_fragment, body)self.assertEqual(data["taskId"], str(self.task.id))self.assertEqual(data["taskRunId"], str(self.task_run.id))diff --git a/products/tasks/backend/tests/test_seat_api.py b/products/tasks/backend/tests/test_seat_api.pyindex 5619ec635b0a..292e86fec413 100644--- a/products/tasks/backend/tests/test_seat_api.py+++ b/products/tasks/backend/tests/test_seat_api.py@@ -261,8 +261,8 @@ class TestSeatAPIRetiredProducts(BaseSeatAPITest):assert response.status_code == status.HTTP_410_GONEassert response.json() == {"error": (- "You can no longer create, upgrade, or reactivate PostHog Code seats. "- "PostHog Code with usage-based billing launched on July 16, 2026, "+ "You can no longer create, upgrade, or reactivate PostHog Desktop seats. "+ "PostHog Desktop with usage-based billing launched on July 16, 2026, ""and existing seats expire on the same date."),"code": "seat_product_retired",diff --git a/products/tasks/docs/CHANNELS.md b/products/tasks/docs/CHANNELS.mdindex 3fda89afec5e..84ea47606f55 100644--- a/products/tasks/docs/CHANNELS.md+++ b/products/tasks/docs/CHANNELS.md@@ -1,4 +1,4 @@-# Channels & Threads (PostHog Code / Bluebird)+# Channels & Threads (PostHog Desktop / Bluebird)Spec for the Slack-style channel revamp. A channel is a shared feed where eachmember message kicks off a task; the task renders as a card everyone in the@@ -105,7 +105,7 @@ Thread messages inherit the task's visibility.`signal_task_run_user_message`, then stamps `forwarded_to_agent_at`,`forwarded_by`, `forwarded_run`. 400 when the task has no signalable run.-## Client (PostHog Code, bluebird mode)+## Client (PostHog Desktop, bluebird mode)- **Channel feed** — the channel view becomes a Slack-like feed: each item isthe kickoff message (author avatar + name + prompt) with a task carddiff --git a/products/tasks/docs/INSTRUMENTATION.md b/products/tasks/docs/INSTRUMENTATION.mdindex 19daf4abb8cb..b72c94a6d776 100644--- a/products/tasks/docs/INSTRUMENTATION.md+++ b/products/tasks/docs/INSTRUMENTATION.md@@ -185,7 +185,7 @@ Source: `products/tasks/backend/api.py`### `code_invite_redeemed`-Tracked when a user redeems a Code invite. Includes `organization` group analytics. No additional properties.+Tracked when a user redeems a Desktop invite. Includes `organization` group analytics. No additional properties.## Activity Observability Eventsdiff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.tsindex 67a2494103dd..4aef145f1ec3 100644--- a/products/tasks/frontend/generated/api.schemas.ts+++ b/products/tasks/frontend/generated/api.schemas.ts@@ -1833,12 +1833,12 @@ export const InitialPermissionModeEnumApi = {*/export interface ClaudeTaskRunCreateSchemaApi {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServerApi[] | null/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServerApi[] | null@@ -1897,7 +1897,7 @@ export interface ClaudeTaskRunCreateSchemaApi {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnumApi- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string/** Initial permission mode for Claude runtimes.*@@ -1944,12 +1944,12 @@ export const CodexTaskRunCreateSchemaInitialPermissionModeEnumApi = {*/export interface CodexTaskRunCreateSchemaApi {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServerApi[] | null/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServerApi[] | null@@ -2008,7 +2008,7 @@ export interface CodexTaskRunCreateSchemaApi {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnumApi- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string/** Initial permission mode for Codex runtimes.*@@ -2056,7 +2056,7 @@ export interface TaskRunResumeRequestSchemaApi {run_source?: RunSourceEnumApi/** Optional signal report identifier when this run was started from Inbox. */signal_report_id?: string- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string}@@ -2266,12 +2266,12 @@ export const TaskRunBootstrapCreateRequestInitialPermissionModeEnumApi = {*/export interface TaskRunBootstrapCreateRequestApi {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServerApi[] | null/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServerApi[] | null@@ -2327,7 +2327,7 @@ export interface TaskRunBootstrapCreateRequestApi {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnumApi- /** Ephemeral GitHub user token from PostHog Code for user-authored cloud pull requests. */+ /** Ephemeral GitHub user token from PostHog Desktop for user-authored cloud pull requests. */github_user_token?: string/** Initial permission mode for the agent session. Claude runtimes accept PostHog permission presets like 'plan'. Codex runtimes accept native Codex modes like 'plan', 'auto', and 'read-only'.*diff --git a/products/tasks/frontend/generated/api.ts b/products/tasks/frontend/generated/api.tsindex 698e0932b472..e5dd80686a4b 100644--- a/products/tasks/frontend/generated/api.ts+++ b/products/tasks/frontend/generated/api.ts@@ -114,7 +114,7 @@ export const getCodeInvitesCheckAccessRetrieveUrl = () => {}/**- * Check whether the authenticated user has access to PostHog Code and to Loops.+ * Check whether the authenticated user has access to PostHog Desktop and to Loops.* @summary Check access*/export const codeInvitesCheckAccessRetrieve = async (options?: RequestInit): Promise<void> => {@@ -129,7 +129,7 @@ export const getCodeInvitesRedeemCreateUrl = () => {}/**- * Redeem a PostHog Code invite code to enable access.+ * Redeem a PostHog Desktop invite code to enable access.* @summary Redeem invite code*/export const codeInvitesRedeemCreate = async (diff --git a/products/tasks/frontend/generated/api.zod.ts b/products/tasks/frontend/generated/api.zod.tsindex 2253fea77f00..6dd33ca3a094 100644--- a/products/tasks/frontend/generated/api.zod.ts+++ b/products/tasks/frontend/generated/api.zod.ts@@ -10,7 +10,7 @@import * as zod from 'zod'/**- * Redeem a PostHog Code invite code to enable access.+ * Redeem a PostHog Desktop invite code to enable access.* @summary Redeem invite code*/export const codeInvitesRedeemCreateBodyCodeMax = 50@@ -1502,7 +1502,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([).nullish().describe(- 'Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'+ 'Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'),relayed_mcp_servers: zod.array(@@ -1516,7 +1516,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([).nullish().describe(- 'Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'+ 'Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'),mode: zod.enum(['interactive', 'background'])@@ -1594,7 +1594,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([.string().optional().describe(- 'Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'+ 'Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'),initial_permission_mode: zod.enum(['default', 'acceptEdits', 'plan', 'bypassPermissions', 'auto'])@@ -1639,7 +1639,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([).nullish().describe(- 'Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'+ 'Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'),relayed_mcp_servers: zod.array(@@ -1653,7 +1653,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([).nullish().describe(- 'Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'+ 'Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'),mode: zod.enum(['interactive', 'background'])@@ -1731,7 +1731,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([.string().optional().describe(- 'Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'+ 'Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'),initial_permission_mode: zod.enum(['plan', 'auto', 'read-only', 'full-access'])@@ -1803,7 +1803,7 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([.string().optional().describe(- 'Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'+ 'Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens.'),}),])@@ -2040,7 +2040,7 @@ export const TasksRunsCreateBody = /* @__PURE__ */ zod).nullish().describe(- 'Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'+ 'Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.'),relayed_mcp_servers: zod.array(@@ -2052,7 +2052,7 @@ export const TasksRunsCreateBody = /* @__PURE__ */ zod).nullish().describe(- 'Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'+ 'Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event\/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.'),environment: zod.enum(['local', 'cloud'])@@ -2125,7 +2125,7 @@ export const TasksRunsCreateBody = /* @__PURE__ */ zodgithub_user_token: zod.string().optional()- .describe('Ephemeral GitHub user token from PostHog Code for user-authored cloud pull requests.'),+ .describe('Ephemeral GitHub user token from PostHog Desktop for user-authored cloud pull requests.'),initial_permission_mode: zod.enum(['default', 'acceptEdits', 'plan', 'bypassPermissions', 'auto', 'read-only', 'full-access']).describe(diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source.py b/products/warehouse_sources/backend/presentation/views/external_data_source.pyindex 5e9ad526b7e6..361687dd25d7 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_source.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_source.py@@ -768,7 +768,7 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializerhelp_text=("How this source was created. Defaults to `api` on create when omitted. ""`web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, "- "`wizard` for the setup wizard and `self_driving` for the PostHog Code app "+ "`wizard` for the setup wizard and `self_driving` for the PostHog Desktop app ""(both derived server-side from the caller's user agent). ""Ignored on update."),@@ -1308,7 +1308,7 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):# `wizard` and `self_driving` are intentionally omitted: they are never accepted from a# caller (that would let any client self-label as wizard- or self-driving-created). They# are derived server-side by upgrading a machine-injected `mcp` value based on the request- # transport (the wizard, PostHog Code, or the wizard's self-driving program).+ # transport (the wizard, PostHog Desktop, or the wizard's self-driving program).choices=[ExternalDataSource.CreatedVia.WEB,ExternalDataSource.CreatedVia.API,@@ -1319,7 +1319,7 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):help_text=("Where the request came from: `web` for the in-app UI, `api` for direct API callers, ""`mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — "- "they are derived server-side for wizard- and PostHog Code-driven MCP calls. Defaults to `api`."+ "they are derived server-side for wizard- and PostHog Desktop-driven MCP calls. Defaults to `api`."),)direct_query_enabled = serializers.BooleanField(@@ -2039,7 +2039,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi# It avoids a second live credential round-trip — and the confusing failure mode where the# first check passes but a transient blip fails the second, leaving nothing created.- # The setup wizard and PostHog Code drive creation through the MCP tools, which inject+ # The setup wizard and PostHog Desktop drive creation through the MCP tools, which inject# `created_via=mcp` before the request reaches us — the agent can't set the field itself.# Upgrade that machine-injected value when the transport identifies one of them, so their# runs are distinguishable from other MCP clients. Explicit `web`/`api` values are left alone.@@ -2595,7 +2595,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi# `source` (web/api/mcp/wizard/posthog_code) is derived from the request by report_user_action;# `created_via` is the caller's explicit intent (with one exception: the machine-injected `mcp`- # is upgraded above when the transport identifies the wizard or PostHog Code). They usually+ # is upgraded above when the transport identifies the wizard or PostHog Desktop). They usually# agree but are kept separate so a transport change (e.g. a new wrapper UA) doesn't silently# rewrite historical attribution.report_user_action(diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_source.py b/products/warehouse_sources/backend/tests/api/test_external_data_source.pyindex 1f0f800e485c..dce0af2dd648 100644--- a/products/warehouse_sources/backend/tests/api/test_external_data_source.py+++ b/products/warehouse_sources/backend/tests/api/test_external_data_source.py@@ -469,7 +469,7 @@ class TestExternalDataSource(APIBaseTest):@parameterized.expand([- # The MCP tool injects `mcp`; a wizard or PostHog Code user agent upgrades it.+ # The MCP tool injects `mcp`; a wizard or PostHog Desktop user agent upgrades it.("posthog/wizard/1.0.0", ExternalDataSource.CreatedVia.MCP, ExternalDataSource.CreatedVia.WIZARD),("posthog/code 1.2.3", ExternalDataSource.CreatedVia.MCP, ExternalDataSource.CreatedVia.SELF_DRIVING),# The wizard's self-driving program marks its UA distinctly → self_driving, not plain wizard.@@ -601,7 +601,7 @@ class TestExternalDataSource(APIBaseTest):[("garbage_value", "hacker"),# `wizard` and `self_driving` are derived server-side; a caller must not be able to- # self-label as wizard- or PostHog Code-created.+ # self-label as wizard- or PostHog Desktop-created.("wizard_is_not_caller_settable", ExternalDataSource.CreatedVia.WIZARD),("self_driving_is_not_caller_settable", ExternalDataSource.CreatedVia.SELF_DRIVING),]diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.tsindex a0d9ae2dce6a..082a47b7a335 100644--- a/products/warehouse_sources/frontend/generated/api.schemas.ts+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts@@ -2963,7 +2963,7 @@ export interface ExternalDataSourceSerializersApi {readonly created_at: string/** @nullable */readonly created_by: string | null- /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.+ /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api@@ -4329,7 +4329,7 @@ export interface ExternalDataSourceCreateApi {* * `warehouse` - warehouse* * `direct` - direct */access_method?: AccessMethodEnumApi- /** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Code-driven MCP calls. Defaults to `api`.+ /** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Desktop-driven MCP calls. Defaults to `api`.** * `web` - web* * `api` - api@@ -4354,7 +4354,7 @@ export interface PatchedExternalDataSourceSerializersApi {readonly created_at?: string/** @nullable */readonly created_by?: string | null- /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.+ /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - apidiff --git a/products/web_analytics/backend/hogql_queries/bot_definitions.py b/products/web_analytics/backend/hogql_queries/bot_definitions.pyindex 4dc3f3e5e77d..22a54a9673fa 100644--- a/products/web_analytics/backend/hogql_queries/bot_definitions.py+++ b/products/web_analytics/backend/hogql_queries/bot_definitions.py@@ -155,17 +155,17 @@ BOT_DEFINITIONS: dict[str, BotDefinition] = {"NotebookLM", "ai_assistant", "AI Agent", "Google", documentation_url="https://notebooklm.google.com/"),"Shap-User": BotDefinition("Shap", "ai_assistant", "AI Agent", "Shap"),- # PostHog Code clients (Electron desktop, React Native mobile, agent CLI, cloud agent server).+ # PostHog Desktop clients (Electron desktop, React Native mobile, agent CLI, cloud agent server).# Dots are escaped because keys are evaluated as re2 regex by the REGEXP_TREE dictionary.r"desktop\.hog\.dev": BotDefinition(- "PostHog Code Desktop",+ "PostHog Desktop","ai_assistant","AI Agent","PostHog",documentation_url="https://posthog.com/code",),r"mobile\.hog\.dev": BotDefinition(- "PostHog Code Mobile",+ "PostHog Mobile","ai_assistant","AI Agent","PostHog",diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.ambrindex 75b7a6776482..0c6096816644 100644--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.ambr+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.ambr@@ -46,7 +46,7 @@-- HogQLSELECT- if(equals(multiMatchAnyIndex(ifNull(properties.$user_agent, ''), ['GPTBot', 'Google-CloudVertexBot', 'Google-Extended', 'GoogleOther', 'Claude-SearchBot', 'Claude-User', 'ClaudeBot', 'Claude-Web', 'anthropic-ai', 'Perplexity-User', 'PerplexityBot', 'CCBot', 'meta-externalagent', 'Bytespider', 'TikTokSpider', 'cohere-ai', 'Diffbot', 'omgili', 'Webzio-Extended', 'Timpibot', 'Amazonbot', 'PetalBot', 'Brightbot', 'amazon-kendra', 'OAI-SearchBot', 'Applebot-Extended', 'ChatGPT-User', 'meta-externalfetcher', 'Meta-ExternalFetcher', 'DuckAssistBot', 'MistralAI-User', 'Manus-User', 'Google-NotebookLM', 'Shap-User', 'desktop\\.hog\\.dev', 'mobile\\.hog\\.dev', 'agent\\.hog\\.dev', 'cloud\\.hog\\.dev', 'Claude/.*Electron', 'ChatGPT/.*Electron', 'Applebot/', 'Googlebot', 'bingbot', 'Bingbot', 'YandexBot', 'Baiduspider', 'DuckDuckBot', 'Slurp', 'Yeti/', 'YisouSpider', 'Sogou web spider', 'pageburst', '360Spider', 'Qwantbot', 'YouBot', 'DataForSeoBot', 'AwarioBot', 'ArchiveTeam ArchiveBot', 'AdsBot-Google', 'Google-InspectionTool', 'Google-Food', 'Google-Adwords', 'AhrefsSiteAudit', 'AhrefsBot', 'Barkrowler', 'SemrushBot', 'SERankingBacklinksBot', 'MJ12bot', 'DotBot', 'Lighthouse', 'MeltwaterNews', 'SiteAuditBot', 'Screaming Frog SEO Spider', 'PTST', 'FacebookBot', 'facebookexternalhit', 'Twitterbot', 'LinkedInBot', 'Pinterest', 'Slackbot', 'Slack-ImgProxy', 'TelegramBot', 'WhatsApp', 'GoogleImageProxy', 'Iframely', 'SkypeUriPreview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google-Ads-Conversions', 'Datadog', 'GrafanaSyntheticMonitoring', 'DMBrowser', 'DigitalOcean Uptime Probe', 'HubSpot', 'curl/', 'Wget', 'python-requests', 'axios', 'node-fetch', 'Go-http-client', 'okhttp', 'Apache-HttpClient', 'libwww-perl', 'Scrapy', 'httpx', 'Google-Apps-Script', 'PlayStore-Google', 'Amazon CloudFront', 'AmazonProductDiscovery', 'Google-BusinessLinkVerification', 'Storebot-Google', 'Google-Read-Aloud', 'Google-Appointments', 'Google-Actions', 'OneTrust', 'Checkly', 'RuxitSynthetic', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'TwilioKnowledge', 'Google-Agent', 'Google-Structured-Data-Testing', 'google-structured-data-testing-tool', 'adbeat', 'SEBot-WA', 'Ads-Naver', 'Better Uptime Bot', 'woorankreview', 'Viber', 'Taboolabot', 'Archive-It', 'seo4ajax.com', 'CookieHubScan', 'BitSightBot', 'ArchiveBox', 'Dataprovider', 'BingPreview', 'Convertify', 'GoogleAgent-Mariner', 'DareBoost', 'AccessibleWebBot', 'Stripebot', 'Bluesky', 'TagInspector', 'oast', 'CookieScript', 'Mediapartners', 'OhDear', 'Siteimprove', 'SnapchatAds', 'MarketGoo', 'oncrawl', 'kinsta-bot', 'CensysInspect', 'SeznamBot', 'WPMU DEV', 'Google Web Preview', 'Catchpoint', 'Snap URL Preview Service', 'Blackboard', 'Foregenix', 'FirecrawlAgent', 'Seekport', 'ev-crawler', 'bitdiscovery', 'SecurityHeaders', 'vercel-screenshot', 'AppEngine-Google', 'InternetMeasurement', 'GoogleDocs', 'linkchecker.pro', 'zgrab', 'amazon-QBusiness', 'aiohttp', 'WellKnownBot', 'OKX-dolphin-crawler', 'BrightEdge Crawler', 'Asana', 'Google-PageRenderer', 'charlotte', 'AmazonSellerInitiatedListing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsidobot', 'SearchAtlas Bot', 'VelenPublicWebCrawler', 'Cookiebot', 'nmap', 'MicrosoftPreview', 'Chrome Privacy Preserving Prefetch Proxy', 'Mozlila/', '\\) AppleWebKit/537\\.36 Chrome/', 'HeadlessChrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb-Crawler', 'mwmbl', 'MojeekBot', 'meta-webindexer', 'archive\\.org_bot', 'jobcrawler', 'FlamingoBot', 'heritrix', 'crawlcrawl-actors', 'Inkeep-Crawler', 'KhojifyBot', 'AzureAI-SearchBot', 'GrowthXBot', 'RegieBrainBot', 'IntelvaneBot', 'ModelContextProtocol', 'Amazon-Bedrock-AgentCore-Browser', 'ResearchBot', 'ShapBot', 'ABEvalBot', 'OzDocsCrawler', 'polygazer', 'BIC-Probe', 'AIWebIndex', 'MBCrawler', 'AffsignalCrawler', 'RankyDockyBot', 'pricingbrief-bot', 'SiteavailObservatory', 'appzbot', 'Optimize Pilot Research Bot', 'KalleWorks-Monitor', 'LosClouds-Monitor', 'Exit1-Website-Monitor', 'UptimeWizardBot', 'PreflightBot', 'MerchantSecurityScanner', 'Discordbot', '^$']), 0), '', ['GPTBot', 'Google Cloud Vertex', 'Google AI', 'GoogleOther', 'Claude Search', 'Claude User', 'Claude', 'Claude Web', 'Anthropic', 'Perplexity User', 'Perplexity', 'Common Crawl', 'Meta AI', 'ByteDance', 'TikTok AI', 'Cohere', 'Diffbot', 'Webz.io', 'Webz.io Extended', 'Timpi', 'Amazon', 'Petal', 'Brightbot', 'Amazon Kendra', 'OpenAI Search', 'Apple AI', 'ChatGPT', 'Meta Fetcher', 'Meta Fetcher', 'DuckDuckGo AI', 'Mistral AI', 'Manus', 'NotebookLM', 'Shap', 'PostHog Code Desktop', 'PostHog Code Mobile', 'PostHog Code Agent', 'PostHog Code Cloud', 'Claude Desktop', 'ChatGPT Desktop', 'Applebot', 'Googlebot', 'Bingbot', 'Bingbot', 'Yandex', 'Baidu', 'DuckDuckGo', 'Yahoo', 'Naver', 'Yisou', 'Sogou', 'Pageburst', '360 Spider', 'Qwant', 'You.com', 'DataForSeo', 'Awario', 'ArchiveTeam ArchiveBot', 'Google Ads', 'Google Inspection', 'Google Food', 'Google Adwords', 'Ahrefs Site Audit', 'Ahrefs', 'Barkrowler', 'Semrush', 'SE Ranking', 'Majestic', 'Moz', 'Lighthouse', 'Meltwater', 'Semrush Site Audit', 'Screaming Frog', 'WebPageTest', 'Facebook Bot', 'Facebook', 'Twitter', 'LinkedIn', 'Pinterest', 'Slack', 'Slack Image Proxy', 'Telegram', 'WhatsApp', 'Google Image Proxy', 'Iframely', 'Skype Preview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google Ads Conversions', 'Datadog', 'Grafana Synthetic', 'Doctom Monitor', 'DigitalOcean Uptime', 'HubSpot Crawler', 'curl', 'Wget', 'Python Requests', 'Axios', 'Node Fetch', 'Go HTTP', 'OkHttp', 'Apache HTTP', 'LWP', 'Scrapy', 'httpx', 'Google Apps Script', 'Google Play Store', 'Amazon CloudFront', 'Amazon Product Discovery', 'Google Business Link', 'Google Storebot', 'Google Read Aloud', 'Google Appointments', 'Google Actions', 'OneTrust', 'Checkly', 'dynatrace-monitor', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'Twilio Knowledge', 'Google-Agent', 'Google Schema Markup Testing Tool', 'google-structured-data-testing-tool', 'Adbeat', 'SE Ranking Bot', 'adsnaver', 'Better Stack', 'WooRank', 'viber-crawler', 'Taboola', 'Internet Archive - Archive-It', 'seo4ajax', 'cookiehub-scan', 'BitSight', 'ArchiveBox', 'Dataprovider.com', 'Bing Preview', 'Convertify', 'GoogleAgent-Mariner', 'dareboost-crawler', 'Accessible Web Bot', 'Stripebot', 'Bluesky', 'Tag Inspector', 'Interactsh', 'CookieScript', 'google-adsense-googlebot', 'OhDearBot', 'Siteimprove', 'SnapchatAdsBot', 'marketgoo', 'oncrawl', 'Kinsta', 'CensysInspectBot', 'SeznamBot', 'WPMU DEV', 'google-preview', 'catchpoint', 'SnapURLPreviewBot', 'blackboard-crawler', 'Foregenix ThreatView/WebScan', 'FirecrawlAgent', 'seekport-crawler', 'Headline', 'Tenable.asm', 'SecurityHeaders', 'Vercel Screenshot Bot', 'google-appengine', 'InternetMeasurementBot', 'Google Docs', 'LinkChecker Bot', 'zgrab', 'Amazon Q', 'python-aiohttp', 'wellknown-crawler', 'OKX-dolphin-crawler', 'BrightEdge Bot', 'Asana', 'Google PageRenderer', 'Charlotte', 'Amazon Seller Initiated Listing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsido', 'SearchAtlas', 'Velen', 'Cookiebot', 'nmap', 'Microsoft Preview', 'Chrome Prefetch Proxy', 'Mozlila Typo Bot', 'Malformed Chrome UA', 'Headless Chrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb', 'Mwmbl', 'Mojeek', 'Meta Web Indexer', 'Internet Archive', 'jobcrawler', 'FlamingoBot', 'Heritrix', 'crawlcrawl', 'Inkeep', 'Khojify', 'Azure AI Search', 'GrowthX', 'Regie.ai', 'Intelvane', 'Model Context Protocol', 'Amazon Bedrock AgentCore', 'ResearchBot', 'Shap', 'ABEvalBot', 'OzDocs', 'polygazer', 'BIC Probe', 'AIWebIndex', 'Monitor Backlinks', 'Affsignal', 'RankyDocky', 'PricingBrief', 'Siteavail', 'appzbot', 'Optimize Pilot', 'KalleWorks', 'LosClouds', 'Exit1', 'UptimeWizard', 'Preflight', 'Stripe Merchant Security Scanner', 'Discord', ''][multiMatchAnyIndex(ifNull(properties.$user_agent, ''), ['GPTBot', 'Google-CloudVertexBot', 'Google-Extended', 'GoogleOther', 'Claude-SearchBot', 'Claude-User', 'ClaudeBot', 'Claude-Web', 'anthropic-ai', 'Perplexity-User', 'PerplexityBot', 'CCBot', 'meta-externalagent', 'Bytespider', 'TikTokSpider', 'cohere-ai', 'Diffbot', 'omgili', 'Webzio-Extended', 'Timpibot', 'Amazonbot', 'PetalBot', 'Brightbot', 'amazon-kendra', 'OAI-SearchBot', 'Applebot-Extended', 'ChatGPT-User', 'meta-externalfetcher', 'Meta-ExternalFetcher', 'DuckAssistBot', 'MistralAI-User', 'Manus-User', 'Google-NotebookLM', 'Shap-User', 'desktop\\.hog\\.dev', 'mobile\\.hog\\.dev', 'agent\\.hog\\.dev', 'cloud\\.hog\\.dev', 'Claude/.*Electron', 'ChatGPT/.*Electron', 'Applebot/', 'Googlebot', 'bingbot', 'Bingbot', 'YandexBot', 'Baiduspider', 'DuckDuckBot', 'Slurp', 'Yeti/', 'YisouSpider', 'Sogou web spider', 'pageburst', '360Spider', 'Qwantbot', 'YouBot', 'DataForSeoBot', 'AwarioBot', 'ArchiveTeam ArchiveBot', 'AdsBot-Google', 'Google-InspectionTool', 'Google-Food', 'Google-Adwords', 'AhrefsSiteAudit', 'AhrefsBot', 'Barkrowler', 'SemrushBot', 'SERankingBacklinksBot', 'MJ12bot', 'DotBot', 'Lighthouse', 'MeltwaterNews', 'SiteAuditBot', 'Screaming Frog SEO Spider', 'PTST', 'FacebookBot', 'facebookexternalhit', 'Twitterbot', 'LinkedInBot', 'Pinterest', 'Slackbot', 'Slack-ImgProxy', 'TelegramBot', 'WhatsApp', 'GoogleImageProxy', 'Iframely', 'SkypeUriPreview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google-Ads-Conversions', 'Datadog', 'GrafanaSyntheticMonitoring', 'DMBrowser', 'DigitalOcean Uptime Probe', 'HubSpot', 'curl/', 'Wget', 'python-requests', 'axios', 'node-fetch', 'Go-http-client', 'okhttp', 'Apache-HttpClient', 'libwww-perl', 'Scrapy', 'httpx', 'Google-Apps-Script', 'PlayStore-Google', 'Amazon CloudFront', 'AmazonProductDiscovery', 'Google-BusinessLinkVerification', 'Storebot-Google', 'Google-Read-Aloud', 'Google-Appointments', 'Google-Actions', 'OneTrust', 'Checkly', 'RuxitSynthetic', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'TwilioKnowledge', 'Google-Agent', 'Google-Structured-Data-Testing', 'google-structured-data-testing-tool', 'adbeat', 'SEBot-WA', 'Ads-Naver', 'Better Uptime Bot', 'woorankreview', 'Viber', 'Taboolabot', 'Archive-It', 'seo4ajax.com', 'CookieHubScan', 'BitSightBot', 'ArchiveBox', 'Dataprovider', 'BingPreview', 'Convertify', 'GoogleAgent-Mariner', 'DareBoost', 'AccessibleWebBot', 'Stripebot', 'Bluesky', 'TagInspector', 'oast', 'CookieScript', 'Mediapartners', 'OhDear', 'Siteimprove', 'SnapchatAds', 'MarketGoo', 'oncrawl', 'kinsta-bot', 'CensysInspect', 'SeznamBot', 'WPMU DEV', 'Google Web Preview', 'Catchpoint', 'Snap URL Preview Service', 'Blackboard', 'Foregenix', 'FirecrawlAgent', 'Seekport', 'ev-crawler', 'bitdiscovery', 'SecurityHeaders', 'vercel-screenshot', 'AppEngine-Google', 'InternetMeasurement', 'GoogleDocs', 'linkchecker.pro', 'zgrab', 'amazon-QBusiness', 'aiohttp', 'WellKnownBot', 'OKX-dolphin-crawler', 'BrightEdge Crawler', 'Asana', 'Google-PageRenderer', 'charlotte', 'AmazonSellerInitiatedListing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsidobot', 'SearchAtlas Bot', 'VelenPublicWebCrawler', 'Cookiebot', 'nmap', 'MicrosoftPreview', 'Chrome Privacy Preserving Prefetch Proxy', 'Mozlila/', '\\) AppleWebKit/537\\.36 Chrome/', 'HeadlessChrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb-Crawler', 'mwmbl', 'MojeekBot', 'meta-webindexer', 'archive\\.org_bot', 'jobcrawler', 'FlamingoBot', 'heritrix', 'crawlcrawl-actors', 'Inkeep-Crawler', 'KhojifyBot', 'AzureAI-SearchBot', 'GrowthXBot', 'RegieBrainBot', 'IntelvaneBot', 'ModelContextProtocol', 'Amazon-Bedrock-AgentCore-Browser', 'ResearchBot', 'ShapBot', 'ABEvalBot', 'OzDocsCrawler', 'polygazer', 'BIC-Probe', 'AIWebIndex', 'MBCrawler', 'AffsignalCrawler', 'RankyDockyBot', 'pricingbrief-bot', 'SiteavailObservatory', 'appzbot', 'Optimize Pilot Research Bot', 'KalleWorks-Monitor', 'LosClouds-Monitor', 'Exit1-Website-Monitor', 'UptimeWizardBot', 'PreflightBot', 'MerchantSecurityScanner', 'Discordbot', '^$'])]) AS bot_name,+ if(equals(multiMatchAnyIndex(ifNull(properties.$user_agent, ''), ['GPTBot', 'Google-CloudVertexBot', 'Google-Extended', 'GoogleOther', 'Claude-SearchBot', 'Claude-User', 'ClaudeBot', 'Claude-Web', 'anthropic-ai', 'Perplexity-User', 'PerplexityBot', 'CCBot', 'meta-externalagent', 'Bytespider', 'TikTokSpider', 'cohere-ai', 'Diffbot', 'omgili', 'Webzio-Extended', 'Timpibot', 'Amazonbot', 'PetalBot', 'Brightbot', 'amazon-kendra', 'OAI-SearchBot', 'Applebot-Extended', 'ChatGPT-User', 'meta-externalfetcher', 'Meta-ExternalFetcher', 'DuckAssistBot', 'MistralAI-User', 'Manus-User', 'Google-NotebookLM', 'Shap-User', 'desktop\\.hog\\.dev', 'mobile\\.hog\\.dev', 'agent\\.hog\\.dev', 'cloud\\.hog\\.dev', 'Claude/.*Electron', 'ChatGPT/.*Electron', 'Applebot/', 'Googlebot', 'bingbot', 'Bingbot', 'YandexBot', 'Baiduspider', 'DuckDuckBot', 'Slurp', 'Yeti/', 'YisouSpider', 'Sogou web spider', 'pageburst', '360Spider', 'Qwantbot', 'YouBot', 'DataForSeoBot', 'AwarioBot', 'ArchiveTeam ArchiveBot', 'AdsBot-Google', 'Google-InspectionTool', 'Google-Food', 'Google-Adwords', 'AhrefsSiteAudit', 'AhrefsBot', 'Barkrowler', 'SemrushBot', 'SERankingBacklinksBot', 'MJ12bot', 'DotBot', 'Lighthouse', 'MeltwaterNews', 'SiteAuditBot', 'Screaming Frog SEO Spider', 'PTST', 'FacebookBot', 'facebookexternalhit', 'Twitterbot', 'LinkedInBot', 'Pinterest', 'Slackbot', 'Slack-ImgProxy', 'TelegramBot', 'WhatsApp', 'GoogleImageProxy', 'Iframely', 'SkypeUriPreview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google-Ads-Conversions', 'Datadog', 'GrafanaSyntheticMonitoring', 'DMBrowser', 'DigitalOcean Uptime Probe', 'HubSpot', 'curl/', 'Wget', 'python-requests', 'axios', 'node-fetch', 'Go-http-client', 'okhttp', 'Apache-HttpClient', 'libwww-perl', 'Scrapy', 'httpx', 'Google-Apps-Script', 'PlayStore-Google', 'Amazon CloudFront', 'AmazonProductDiscovery', 'Google-BusinessLinkVerification', 'Storebot-Google', 'Google-Read-Aloud', 'Google-Appointments', 'Google-Actions', 'OneTrust', 'Checkly', 'RuxitSynthetic', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'TwilioKnowledge', 'Google-Agent', 'Google-Structured-Data-Testing', 'google-structured-data-testing-tool', 'adbeat', 'SEBot-WA', 'Ads-Naver', 'Better Uptime Bot', 'woorankreview', 'Viber', 'Taboolabot', 'Archive-It', 'seo4ajax.com', 'CookieHubScan', 'BitSightBot', 'ArchiveBox', 'Dataprovider', 'BingPreview', 'Convertify', 'GoogleAgent-Mariner', 'DareBoost', 'AccessibleWebBot', 'Stripebot', 'Bluesky', 'TagInspector', 'oast', 'CookieScript', 'Mediapartners', 'OhDear', 'Siteimprove', 'SnapchatAds', 'MarketGoo', 'oncrawl', 'kinsta-bot', 'CensysInspect', 'SeznamBot', 'WPMU DEV', 'Google Web Preview', 'Catchpoint', 'Snap URL Preview Service', 'Blackboard', 'Foregenix', 'FirecrawlAgent', 'Seekport', 'ev-crawler', 'bitdiscovery', 'SecurityHeaders', 'vercel-screenshot', 'AppEngine-Google', 'InternetMeasurement', 'GoogleDocs', 'linkchecker.pro', 'zgrab', 'amazon-QBusiness', 'aiohttp', 'WellKnownBot', 'OKX-dolphin-crawler', 'BrightEdge Crawler', 'Asana', 'Google-PageRenderer', 'charlotte', 'AmazonSellerInitiatedListing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsidobot', 'SearchAtlas Bot', 'VelenPublicWebCrawler', 'Cookiebot', 'nmap', 'MicrosoftPreview', 'Chrome Privacy Preserving Prefetch Proxy', 'Mozlila/', '\\) AppleWebKit/537\\.36 Chrome/', 'HeadlessChrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb-Crawler', 'mwmbl', 'MojeekBot', 'meta-webindexer', 'archive\\.org_bot', 'jobcrawler', 'FlamingoBot', 'heritrix', 'crawlcrawl-actors', 'Inkeep-Crawler', 'KhojifyBot', 'AzureAI-SearchBot', 'GrowthXBot', 'RegieBrainBot', 'IntelvaneBot', 'ModelContextProtocol', 'Amazon-Bedrock-AgentCore-Browser', 'ResearchBot', 'ShapBot', 'ABEvalBot', 'OzDocsCrawler', 'polygazer', 'BIC-Probe', 'AIWebIndex', 'MBCrawler', 'AffsignalCrawler', 'RankyDockyBot', 'pricingbrief-bot', 'SiteavailObservatory', 'appzbot', 'Optimize Pilot Research Bot', 'KalleWorks-Monitor', 'LosClouds-Monitor', 'Exit1-Website-Monitor', 'UptimeWizardBot', 'PreflightBot', 'MerchantSecurityScanner', 'Discordbot', '^$']), 0), '', ['GPTBot', 'Google Cloud Vertex', 'Google AI', 'GoogleOther', 'Claude Search', 'Claude User', 'Claude', 'Claude Web', 'Anthropic', 'Perplexity User', 'Perplexity', 'Common Crawl', 'Meta AI', 'ByteDance', 'TikTok AI', 'Cohere', 'Diffbot', 'Webz.io', 'Webz.io Extended', 'Timpi', 'Amazon', 'Petal', 'Brightbot', 'Amazon Kendra', 'OpenAI Search', 'Apple AI', 'ChatGPT', 'Meta Fetcher', 'Meta Fetcher', 'DuckDuckGo AI', 'Mistral AI', 'Manus', 'NotebookLM', 'Shap', 'PostHog Desktop', 'PostHog Mobile', 'PostHog Code Agent', 'PostHog Code Cloud', 'Claude Desktop', 'ChatGPT Desktop', 'Applebot', 'Googlebot', 'Bingbot', 'Bingbot', 'Yandex', 'Baidu', 'DuckDuckGo', 'Yahoo', 'Naver', 'Yisou', 'Sogou', 'Pageburst', '360 Spider', 'Qwant', 'You.com', 'DataForSeo', 'Awario', 'ArchiveTeam ArchiveBot', 'Google Ads', 'Google Inspection', 'Google Food', 'Google Adwords', 'Ahrefs Site Audit', 'Ahrefs', 'Barkrowler', 'Semrush', 'SE Ranking', 'Majestic', 'Moz', 'Lighthouse', 'Meltwater', 'Semrush Site Audit', 'Screaming Frog', 'WebPageTest', 'Facebook Bot', 'Facebook', 'Twitter', 'LinkedIn', 'Pinterest', 'Slack', 'Slack Image Proxy', 'Telegram', 'WhatsApp', 'Google Image Proxy', 'Iframely', 'Skype Preview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google Ads Conversions', 'Datadog', 'Grafana Synthetic', 'Doctom Monitor', 'DigitalOcean Uptime', 'HubSpot Crawler', 'curl', 'Wget', 'Python Requests', 'Axios', 'Node Fetch', 'Go HTTP', 'OkHttp', 'Apache HTTP', 'LWP', 'Scrapy', 'httpx', 'Google Apps Script', 'Google Play Store', 'Amazon CloudFront', 'Amazon Product Discovery', 'Google Business Link', 'Google Storebot', 'Google Read Aloud', 'Google Appointments', 'Google Actions', 'OneTrust', 'Checkly', 'dynatrace-monitor', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'Twilio Knowledge', 'Google-Agent', 'Google Schema Markup Testing Tool', 'google-structured-data-testing-tool', 'Adbeat', 'SE Ranking Bot', 'adsnaver', 'Better Stack', 'WooRank', 'viber-crawler', 'Taboola', 'Internet Archive - Archive-It', 'seo4ajax', 'cookiehub-scan', 'BitSight', 'ArchiveBox', 'Dataprovider.com', 'Bing Preview', 'Convertify', 'GoogleAgent-Mariner', 'dareboost-crawler', 'Accessible Web Bot', 'Stripebot', 'Bluesky', 'Tag Inspector', 'Interactsh', 'CookieScript', 'google-adsense-googlebot', 'OhDearBot', 'Siteimprove', 'SnapchatAdsBot', 'marketgoo', 'oncrawl', 'Kinsta', 'CensysInspectBot', 'SeznamBot', 'WPMU DEV', 'google-preview', 'catchpoint', 'SnapURLPreviewBot', 'blackboard-crawler', 'Foregenix ThreatView/WebScan', 'FirecrawlAgent', 'seekport-crawler', 'Headline', 'Tenable.asm', 'SecurityHeaders', 'Vercel Screenshot Bot', 'google-appengine', 'InternetMeasurementBot', 'Google Docs', 'LinkChecker Bot', 'zgrab', 'Amazon Q', 'python-aiohttp', 'wellknown-crawler', 'OKX-dolphin-crawler', 'BrightEdge Bot', 'Asana', 'Google PageRenderer', 'Charlotte', 'Amazon Seller Initiated Listing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsido', 'SearchAtlas', 'Velen', 'Cookiebot', 'nmap', 'Microsoft Preview', 'Chrome Prefetch Proxy', 'Mozlila Typo Bot', 'Malformed Chrome UA', 'Headless Chrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb', 'Mwmbl', 'Mojeek', 'Meta Web Indexer', 'Internet Archive', 'jobcrawler', 'FlamingoBot', 'Heritrix', 'crawlcrawl', 'Inkeep', 'Khojify', 'Azure AI Search', 'GrowthX', 'Regie.ai', 'Intelvane', 'Model Context Protocol', 'Amazon Bedrock AgentCore', 'ResearchBot', 'Shap', 'ABEvalBot', 'OzDocs', 'polygazer', 'BIC Probe', 'AIWebIndex', 'Monitor Backlinks', 'Affsignal', 'RankyDocky', 'PricingBrief', 'Siteavail', 'appzbot', 'Optimize Pilot', 'KalleWorks', 'LosClouds', 'Exit1', 'UptimeWizard', 'Preflight', 'Stripe Merchant Security Scanner', 'Discord', ''][multiMatchAnyIndex(ifNull(properties.$user_agent, ''), ['GPTBot', 'Google-CloudVertexBot', 'Google-Extended', 'GoogleOther', 'Claude-SearchBot', 'Claude-User', 'ClaudeBot', 'Claude-Web', 'anthropic-ai', 'Perplexity-User', 'PerplexityBot', 'CCBot', 'meta-externalagent', 'Bytespider', 'TikTokSpider', 'cohere-ai', 'Diffbot', 'omgili', 'Webzio-Extended', 'Timpibot', 'Amazonbot', 'PetalBot', 'Brightbot', 'amazon-kendra', 'OAI-SearchBot', 'Applebot-Extended', 'ChatGPT-User', 'meta-externalfetcher', 'Meta-ExternalFetcher', 'DuckAssistBot', 'MistralAI-User', 'Manus-User', 'Google-NotebookLM', 'Shap-User', 'desktop\\.hog\\.dev', 'mobile\\.hog\\.dev', 'agent\\.hog\\.dev', 'cloud\\.hog\\.dev', 'Claude/.*Electron', 'ChatGPT/.*Electron', 'Applebot/', 'Googlebot', 'bingbot', 'Bingbot', 'YandexBot', 'Baiduspider', 'DuckDuckBot', 'Slurp', 'Yeti/', 'YisouSpider', 'Sogou web spider', 'pageburst', '360Spider', 'Qwantbot', 'YouBot', 'DataForSeoBot', 'AwarioBot', 'ArchiveTeam ArchiveBot', 'AdsBot-Google', 'Google-InspectionTool', 'Google-Food', 'Google-Adwords', 'AhrefsSiteAudit', 'AhrefsBot', 'Barkrowler', 'SemrushBot', 'SERankingBacklinksBot', 'MJ12bot', 'DotBot', 'Lighthouse', 'MeltwaterNews', 'SiteAuditBot', 'Screaming Frog SEO Spider', 'PTST', 'FacebookBot', 'facebookexternalhit', 'Twitterbot', 'LinkedInBot', 'Pinterest', 'Slackbot', 'Slack-ImgProxy', 'TelegramBot', 'WhatsApp', 'GoogleImageProxy', 'Iframely', 'SkypeUriPreview', 'Pingdom', 'UptimeRobot', 'Site24x7', 'StatusCake', 'Google-Ads-Conversions', 'Datadog', 'GrafanaSyntheticMonitoring', 'DMBrowser', 'DigitalOcean Uptime Probe', 'HubSpot', 'curl/', 'Wget', 'python-requests', 'axios', 'node-fetch', 'Go-http-client', 'okhttp', 'Apache-HttpClient', 'libwww-perl', 'Scrapy', 'httpx', 'Google-Apps-Script', 'PlayStore-Google', 'Amazon CloudFront', 'AmazonProductDiscovery', 'Google-BusinessLinkVerification', 'Storebot-Google', 'Google-Read-Aloud', 'Google-Appointments', 'Google-Actions', 'OneTrust', 'Checkly', 'RuxitSynthetic', 'Google-AdWords-Express', 'meta-externalads', 'Google-Safety', 'GTmetrix', 'TwilioKnowledge', 'Google-Agent', 'Google-Structured-Data-Testing', 'google-structured-data-testing-tool', 'adbeat', 'SEBot-WA', 'Ads-Naver', 'Better Uptime Bot', 'woorankreview', 'Viber', 'Taboolabot', 'Archive-It', 'seo4ajax.com', 'CookieHubScan', 'BitSightBot', 'ArchiveBox', 'Dataprovider', 'BingPreview', 'Convertify', 'GoogleAgent-Mariner', 'DareBoost', 'AccessibleWebBot', 'Stripebot', 'Bluesky', 'TagInspector', 'oast', 'CookieScript', 'Mediapartners', 'OhDear', 'Siteimprove', 'SnapchatAds', 'MarketGoo', 'oncrawl', 'kinsta-bot', 'CensysInspect', 'SeznamBot', 'WPMU DEV', 'Google Web Preview', 'Catchpoint', 'Snap URL Preview Service', 'Blackboard', 'Foregenix', 'FirecrawlAgent', 'Seekport', 'ev-crawler', 'bitdiscovery', 'SecurityHeaders', 'vercel-screenshot', 'AppEngine-Google', 'InternetMeasurement', 'GoogleDocs', 'linkchecker.pro', 'zgrab', 'amazon-QBusiness', 'aiohttp', 'WellKnownBot', 'OKX-dolphin-crawler', 'BrightEdge Crawler', 'Asana', 'Google-PageRenderer', 'charlotte', 'AmazonSellerInitiatedListing', 'Splunk Synthetics', 'Detectify', 'Ghost Inspector', 'Monsidobot', 'SearchAtlas Bot', 'VelenPublicWebCrawler', 'Cookiebot', 'nmap', 'MicrosoftPreview', 'Chrome Privacy Preserving Prefetch Proxy', 'Mozlila/', '\\) AppleWebKit/537\\.36 Chrome/', 'HeadlessChrome', 'PhantomJS', 'Puppeteer', 'Playwright', 'Selenium', 'ClueWeb-Crawler', 'mwmbl', 'MojeekBot', 'meta-webindexer', 'archive\\.org_bot', 'jobcrawler', 'FlamingoBot', 'heritrix', 'crawlcrawl-actors', 'Inkeep-Crawler', 'KhojifyBot', 'AzureAI-SearchBot', 'GrowthXBot', 'RegieBrainBot', 'IntelvaneBot', 'ModelContextProtocol', 'Amazon-Bedrock-AgentCore-Browser', 'ResearchBot', 'ShapBot', 'ABEvalBot', 'OzDocsCrawler', 'polygazer', 'BIC-Probe', 'AIWebIndex', 'MBCrawler', 'AffsignalCrawler', 'RankyDockyBot', 'pricingbrief-bot', 'SiteavailObservatory', 'appzbot', 'Optimize Pilot Research Bot', 'KalleWorks-Monitor', 'LosClouds-Monitor', 'Exit1-Website-Monitor', 'UptimeWizardBot', 'PreflightBot', 'MerchantSecurityScanner', 'Discordbot', '^$'])]) AS bot_name,count() AS countFROMeventsdiff --git a/products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py b/products/web_analytics/backend/hogql_queries/test/test_bot_definitions.pyindex e67ec9c5256f..0055b902273a 100644--- a/products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py+++ b/products/web_analytics/backend/hogql_queries/test/test_bot_definitions.py@@ -82,9 +82,9 @@ class TestBotDefinitionsDataStructure:("Meta-ExternalFetcher", "Meta Fetcher", "ai_assistant", "AI Agent"),("DuckAssistBot", "DuckDuckGo AI", "ai_assistant", "AI Agent"),("MistralAI-User", "Mistral AI", "ai_assistant", "AI Agent"),- # PostHog Code clients- (r"desktop\.hog\.dev", "PostHog Code Desktop", "ai_assistant", "AI Agent"),- (r"mobile\.hog\.dev", "PostHog Code Mobile", "ai_assistant", "AI Agent"),+ # PostHog Desktop clients+ (r"desktop\.hog\.dev", "PostHog Desktop", "ai_assistant", "AI Agent"),+ (r"mobile\.hog\.dev", "PostHog Mobile", "ai_assistant", "AI Agent"),(r"agent\.hog\.dev", "PostHog Code Agent", "ai_assistant", "AI Agent"),(r"cloud\.hog\.dev", "PostHog Code Cloud", "ai_assistant", "AI Agent"),("amazon-kendra", "Amazon Kendra", "ai_crawler", "AI Agent"),diff --git a/services/llm-gateway/src/llm_gateway/api/usage.py b/services/llm-gateway/src/llm_gateway/api/usage.pyindex 1f023e6cddb3..b3f5b7a32d03 100644--- a/services/llm-gateway/src/llm_gateway/api/usage.py+++ b/services/llm-gateway/src/llm_gateway/api/usage.py@@ -27,7 +27,7 @@ usage_router = APIRouter(prefix="/v1/usage", tags=["Usage"])class CostLimitStatus(BaseModel):used_percent: float- # Kept on the wire for older PostHog Code clients whose zod schema still+ # Kept on the wire for older PostHog Desktop clients whose zod schema still# requires it. Newer clients anchor to `reset_at`; drop in a follow-up once# the long tail of pinned clients has rolled forward.resets_in_seconds: intdiff --git a/services/llm-gateway/src/llm_gateway/cli/reset_posthog_code_usage.py b/services/llm-gateway/src/llm_gateway/cli/reset_posthog_code_usage.pyindex 8d5e0a5c70e2..b55a22e58ec2 100644--- a/services/llm-gateway/src/llm_gateway/cli/reset_posthog_code_usage.py+++ b/services/llm-gateway/src/llm_gateway/cli/reset_posthog_code_usage.py@@ -1,4 +1,4 @@-"""Reset PostHog Code usage counters in Redis. Resets all users by default, or a single user with --user-id."""+"""Reset PostHog Desktop usage counters in Redis. Resets all users by default, or a single user with --user-id."""from __future__ import annotations@@ -77,7 +77,7 @@ def _non_empty_user_id(value: str) -> str:async def _amain(argv: list[str]) -> int:parser = argparse.ArgumentParser(prog="reset-posthog-code-usage",- description="Reset PostHog Code usage counters in the LLM gateway Redis. Resets every user unless --user-id is given.",+ description="Reset PostHog Desktop usage counters in the LLM gateway Redis. Resets every user unless --user-id is given.",)parser.add_argument("--dry-run", action="store_true", help="Count keys without deleting.")parser.add_argument(diff --git a/services/llm-gateway/src/llm_gateway/products/config.py b/services/llm-gateway/src/llm_gateway/products/config.pyindex c042ff205be7..43146815c79f 100644--- a/services/llm-gateway/src/llm_gateway/products/config.py+++ b/services/llm-gateway/src/llm_gateway/products/config.py@@ -39,7 +39,7 @@ class ProductConfig:credit_bucket: CreditBucket | None = None# When True, OAuth callers must present a server-minted credential (a token carrying# the internal `internal_run:read` scope). Set on the internal products that share the- # PostHog Code OAuth app but are only ever driven by sandbox runs — a user's own Code+ # PostHog Desktop OAuth app but are only ever driven by sandbox runs — a user's own Code# OAuth token can't carry an internal scope, so this stops it routing around the# posthog_code free-tier model gate through these products. Personal API keys are# unaffected (they reach the gateway only with an explicit, feature-gated@@ -279,7 +279,7 @@ PRODUCTS: Final[dict[str, ProductConfig]] = {# The trade-off (any personal API key can reach an unbilled route) is shared by every# key-accessible unbilled product in this table and is bounded by the model pins.# requires_server_credential closes the OAuth side of that class: reviewer tokens are minted- # server-side with the internal marker, so a user's own Code OAuth token can't ride this route+ # server-side with the internal marker, so a user's own Desktop OAuth token can't ride this route# around the posthog_code free-tier gate."stamphog": ProductConfig(allowed_application_ids=frozenset({POSTHOG_CODE_US_APP_ID, POSTHOG_CODE_EU_APP_ID, POSTHOG_CODE_DEV_APP_ID}),@@ -411,8 +411,8 @@ def check_product_access(if application_id not in allowed_application_ids:return False, f"OAuth application not authorized for product '{product}'"- # Internal products that share the PostHog Code OAuth app are only ever driven by- # server-minted sandbox tokens; a user's own Code OAuth token would otherwise reach them+ # Internal products that share the PostHog Desktop OAuth app are only ever driven by+ # server-minted sandbox tokens; a user's own Desktop OAuth token would otherwise reach them# and route around the posthog_code free-tier model gate. Require the internal marker that# only server-minted tokens carry. OAuth-only: personal API keys reach the gateway with an# explicit, feature-gated llm_gateway:read scope (a `*` PAK is rejected at auth), so thediff --git a/services/llm-gateway/src/llm_gateway/rate_limiting/billable_credits_throttle.py b/services/llm-gateway/src/llm_gateway/rate_limiting/billable_credits_throttle.pyindex aea1f147205b..64eee2ea5256 100644--- a/services/llm-gateway/src/llm_gateway/rate_limiting/billable_credits_throttle.py+++ b/services/llm-gateway/src/llm_gateway/rate_limiting/billable_credits_throttle.py@@ -9,7 +9,7 @@ _BUCKET_EXHAUSTED_DETAIL = {"Top up at https://app.posthog.com/organization/billing to continue."),CreditBucket.POSTHOG_CODE_CREDITS: (- "Your team has reached its PostHog Code usage limit for this billing period. "+ "Your team has reached its PostHog Desktop usage limit for this billing period. ""See https://app.posthog.com/organization/billing for your usage and limits."),}diff --git a/services/llm-gateway/src/llm_gateway/services/plan_resolver.py b/services/llm-gateway/src/llm_gateway/services/plan_resolver.pyindex f7cde5e69f91..03a16edeb3d8 100644--- a/services/llm-gateway/src/llm_gateway/services/plan_resolver.py+++ b/services/llm-gateway/src/llm_gateway/services/plan_resolver.py@@ -1,4 +1,4 @@-"""Resolves a user's PostHog Code plan via the PostHog API seats endpoint.+"""Resolves a user's PostHog Desktop plan via the PostHog API seats endpoint.Calls ``GET /api/seats/me/?product_key=posthog_code`` on the PostHog API,forwarding the user's auth token. The Django SeatViewSet handles billingdiff --git a/services/llm-gateway/src/llm_gateway/services/quota_resolver.py b/services/llm-gateway/src/llm_gateway/services/quota_resolver.pyindex 6dc2cd38a966..b0839d462b62 100644--- a/services/llm-gateway/src/llm_gateway/services/quota_resolver.py+++ b/services/llm-gateway/src/llm_gateway/services/quota_resolver.py@@ -9,7 +9,7 @@ values in the product registry — e.g. ``ai_credits``, ``posthog_code_credits``Transient upstream failures (network errors, 5xx) are retried within therequest with exponential backoff. 4xx responses or exhausted retries fallopen and briefly cache ``limited=False`` so a struggling Django isn't hit on-every subsequent request. The Code usage billing bit in that fail-open entry+every subsequent request. The Desktop usage billing bit in that fail-open entryfalls back to the team's last known value instead (see``_LAST_KNOWN_BILLING_TTL_SECONDS``), so an upstream blip doesn't re-cap apaying org's users.@@ -40,7 +40,7 @@ logger = structlog.get_logger(__name__)# upstream is consulted again within a minute._FAIL_OPEN_CACHE_TTL_SECONDS = 60-# Last known Code usage billing bit per team: written on every successful+# Last known Desktop usage billing bit per team: written on every successful# fetch, read only when a fetch fails. Bounds how stale the fail-time fallback# may be — a billed org keeps paid-tier treatment through a day-long upstream# outage, after which unknown teams fail closed again.diff --git a/services/llm-gateway/tests/test_billable_credits_throttle.py b/services/llm-gateway/tests/test_billable_credits_throttle.pyindex 5d7da3bacd6b..4f839f2760f4 100644--- a/services/llm-gateway/tests/test_billable_credits_throttle.py+++ b/services/llm-gateway/tests/test_billable_credits_throttle.py@@ -59,7 +59,7 @@ class TestBillableCreditThrottle:assert result.allowed is Falseassert result.status_code == 429- assert "PostHog Code usage limit" in result.detail+ assert "PostHog Desktop usage limit" in result.detail@pytest.mark.asyncio@pytest.mark.parametrize(diff --git a/services/llm-gateway/tests/test_cost_throttles.py b/services/llm-gateway/tests/test_cost_throttles.pyindex 32dfdfa4b27d..6e089aeab5a3 100644--- a/services/llm-gateway/tests/test_cost_throttles.py+++ b/services/llm-gateway/tests/test_cost_throttles.py@@ -1413,7 +1413,7 @@ class TestPlanAwareThrottling:@pytest.mark.parametrize(("seat_missing", "code_usage_billed", "expected_allowed"),[- # Seatless + org-billed Code usage: bills to the org - no per-user cap.+ # Seatless + org-billed Desktop usage: bills to the org - no per-user cap.# $600 spent clears both the $20 free cap and the $500/day default.(True, True, True),# Seatless + not billed: the free cap holds (this pair pins that thediff --git a/services/llm-gateway/tests/test_dependencies.py b/services/llm-gateway/tests/test_dependencies.pyindex 9285ab804a5b..1f3bdcf737e8 100644--- a/services/llm-gateway/tests/test_dependencies.py+++ b/services/llm-gateway/tests/test_dependencies.py@@ -373,7 +373,7 @@ class TestFreeTierModelGateWiring:error = exc_info.value.detail["error"]assert "claude-fable-5" in error["message"]assert error["code"] == "model_gate"- # Legacy PostHog Code clients route errors by substring; the+ # Legacy PostHog Desktop clients route errors by substring; the# "(rate_limit)" suffix sends this 403 to their usage-limit modal# instead of their fatal-session teardown path.assert error["message"].endswith("(rate_limit)")diff --git a/services/llm-gateway/tests/test_product_config.py b/services/llm-gateway/tests/test_product_config.pyindex 9dba9b864431..4abd71fc530a 100644--- a/services/llm-gateway/tests/test_product_config.py+++ b/services/llm-gateway/tests/test_product_config.py@@ -491,7 +491,7 @@ class TestCheckFreeTierModelAccess:# The alias routes are the same surface - a URL spelling must not bypass("array", "claude-fable-5", False, False, False),("twig", "gpt-5.5", False, False, False),- # Org pays for Code usage: everything stays open+ # Org pays for Desktop usage: everything stays open("posthog_code", "claude-fable-5", True, False, True),# Staff bypass mirrors the cost-throttle exemption("posthog_code", "claude-fable-5", False, True, True),@@ -547,9 +547,9 @@ class TestCheckFreeTierModelAccess:class TestServerCredentialRequirement:- """The internal products that share the PostHog Code OAuth app (background_agents, signals,+ """The internal products that share the PostHog Desktop OAuth app (background_agents, signals,slack_app, conversations) must accept only server-minted tokens — those carrying the internal- `internal_run:read` marker. Otherwise a user's own Code OAuth token could route around the+ `internal_run:read` marker. Otherwise a user's own Desktop OAuth token could route around theposthog_code free-tier gate through these products to premium models."""_MARKER_SCOPES = ["llm_gateway:read", "task:write", "internal_run:read"]@@ -626,8 +626,8 @@ class TestServerCredentialConfigInvariant:@pytest.mark.parametrize("product", [p for p in _CODE_APP_PRODUCTS if p != "posthog_code"])def test_internal_code_app_products_require_a_server_credential(self, product: str):assert PRODUCTS[product].requires_server_credential, (- f"'{product}' accepts the PostHog Code OAuth app but doesn't require a server-minted "- "credential, so a user's own Code OAuth token could reach it and route around the "+ f"'{product}' accepts the PostHog Desktop OAuth app but doesn't require a server-minted "+ "credential, so a user's own Desktop OAuth token could reach it and route around the ""posthog_code free-tier model gate")diff --git a/services/llm-gateway/tests/test_rate_limiting.py b/services/llm-gateway/tests/test_rate_limiting.pyindex 5e7353feabed..31b0738b72f6 100644--- a/services/llm-gateway/tests/test_rate_limiting.py+++ b/services/llm-gateway/tests/test_rate_limiting.py@@ -263,7 +263,7 @@ class TestFreeTierModelGateErrorBody:) -> None:"""Pins the gate 403's wire shape end-to-end (raise site + exception-handlerunwrap): a top-level error envelope, never FastAPI's {"detail": ...} nesting.- Pre-cutover PostHog Code clients route this 403 by the "(rate_limit)"+ Pre-cutover PostHog Desktop clients route this 403 by the "(rate_limit)"substring in the message and newer clients read the code — a regression ineither strands installed builds in fatal-session teardown."""from llm_gateway.auth.models import AuthenticatedUser@@ -275,7 +275,7 @@ class TestFreeTierModelGateErrorBody:get_settings.cache_clear()try:app = create_test_app(mock_db_pool)- # OAuth caller on the Code app whose org isn't billed for Code usage+ # OAuth caller on the Desktop app whose org isn't billed for Desktop usage# (the conftest quota resolver reports code_usage_billing_active=False).app.dependency_overrides[get_authenticated_user] = lambda: AuthenticatedUser(user_id=7,diff --git a/services/llm-gateway/tests/test_usage.py b/services/llm-gateway/tests/test_usage.pyindex ae1eb2a073a6..9a4fca1e926b 100644--- a/services/llm-gateway/tests/test_usage.py+++ b/services/llm-gateway/tests/test_usage.py@@ -425,7 +425,7 @@ class TestUsageEndpoint:assert resolver_mock.call_args.args[0] == "ai_credits"def test_ai_credits_carries_org_spend_numbers(self, authenticated_usage_client: TestClient) -> None:- """PostHog Code renders "used $X of $Y" (titlebar, plans page) off these+ """PostHog Desktop renders "used $X of $Y" (titlebar, plans page) off thesenumbers; None must stay None so clients read unknown, not $0."""from llm_gateway.services.quota_resolver import QuotaResourceStatusdiff --git a/services/mcp/README.md b/services/mcp/README.mdindex 729bee67e18b..b45696f149d8 100644--- a/services/mcp/README.md+++ b/services/mcp/README.md@@ -302,7 +302,7 @@ https://mcp.posthog.com/mcp?consumer=pluginx-posthog-mcp-consumer: plugin```-The header wins when both the header and the query parameter are set. Reserved values: `plugin` (AI-tool plugin installs), `posthog-code` (PostHog Code Tasks sandbox), `slack` (Slack integration).+The header wins when both the header and the query parameter are set. Reserved values: `plugin` (AI-tool plugin installs), `posthog-code` (PostHog Desktop Tasks sandbox), `slack` (Slack integration).### Data processing@@ -397,7 +397,7 @@ npx### Developing against Claude Desktop-Claude Desktop is one of the easiest ways to test MCP Apps - while PostHog Code doesn't support it. You can configure access Settings > Developer and then edit `claude_desktop_config.json` with the following:+Claude Desktop is one of the easiest ways to test MCP Apps - while PostHog Desktop doesn't support it. You can configure access Settings > Developer and then edit `claude_desktop_config.json` with the following:```json{diff --git a/services/mcp/playbooks/authenticating-as-the-user/SKILL.md b/services/mcp/playbooks/authenticating-as-the-user/SKILL.mdindex d312bc4eda90..54db73fa8007 100644--- a/services/mcp/playbooks/authenticating-as-the-user/SKILL.md+++ b/services/mcp/playbooks/authenticating-as-the-user/SKILL.md@@ -13,7 +13,7 @@ Identity has two independent questions. Confusing them is the #1 mistake.1. **Principal — _who is asking?_** Set by the trigger:- `posthog` (chat / MCP): an authenticated PostHog user — the bearer- arrives at the trigger edge (the PostHog Code / IDE passthrough).+ arrives at the trigger edge (the PostHog Desktop / IDE passthrough).- `slack`: a Slack user (identified by their Slack user id).- `jwt`: an embedding app's end-user.The principal is _who_, not _what they can do_.@@ -89,7 +89,7 @@ Every identity-gated call resolves to one of three outcomes:Where the bearer comes from depends on the surface:-- **chat / MCP (PostHog Code, IDE):** passthrough from the trigger edge —+- **chat / MCP (PostHog Desktop, IDE):** passthrough from the trigger edge —already authenticated, no link step.- **slack:** the user links once via the OAuth flow. After linking it'spersisted per-user and reused.diff --git a/services/mcp/playbooks/authoring-new-agents/SKILL.md b/services/mcp/playbooks/authoring-new-agents/SKILL.mdindex df9120484d6e..2c834db2789d 100644--- a/services/mcp/playbooks/authoring-new-agents/SKILL.md+++ b/services/mcp/playbooks/authoring-new-agents/SKILL.md@@ -11,7 +11,7 @@ Before any MCP call, get answers to:1. **What does this agent do?** One sentence. If you can't writethe sentence yet, the user can't either — ask more questions.2. **What triggers it?** Cron? Slack mentions? Chat from- PostHog Code? A webhook from an external system?+ PostHog Desktop? A webhook from an external system?3. **What does it have access to?** PostHog data? Slack? Anexternal service via a custom tool or MCP?4. **What's the success criterion?** One concrete example of a@@ -128,7 +128,7 @@ posthog__agent-applications-revisions-create → empty draft revision (with specJSON straight in. Don't create-empty-then-partial-update; that'stwo round-trips for nothing.-**Drive the PostHog Code UI** so the user follows along. Right after+**Drive the PostHog Desktop UI** so the user follows along. Right after`posthog__agent-applications-create` returns, call:```textdiff --git a/services/mcp/playbooks/designing-mcp-surfaces/SKILL.md b/services/mcp/playbooks/designing-mcp-surfaces/SKILL.mdindex 474111884797..b09a7c7661eb 100644--- a/services/mcp/playbooks/designing-mcp-surfaces/SKILL.md+++ b/services/mcp/playbooks/designing-mcp-surfaces/SKILL.md@@ -204,7 +204,7 @@ After designing the MCP surface, point the user at where the connectsnippet lives — it is **not** a callable tool. The ingress serves itas a public HTTP route, `GET /agents/<slug>/mcp/connect-info`, whichreturns the URL + auth instructions + paste-ready Claude Code / mcp.json-snippets (PostHog Code's Connections tab renders the same thing). So-either send them to the agent's **Connections** tab in PostHog Code or+snippets (PostHog Desktop's Connections tab renders the same thing). So+either send them to the agent's **Connections** tab in PostHog Desktop orhand them the connect-info URL. Don't try to set up the clientyourself — the user does that locally.diff --git a/services/mcp/playbooks/editing-agents-safely/SKILL.md b/services/mcp/playbooks/editing-agents-safely/SKILL.mdindex dc5739ec9abf..0e605f0af863 100644--- a/services/mcp/playbooks/editing-agents-safely/SKILL.md+++ b/services/mcp/playbooks/editing-agents-safely/SKILL.md@@ -46,7 +46,7 @@ NOT this:- ❌ Create an empty draft and rebuild. You'll drift from live.- ❌ Branch from an archived revision. You'd be regressing.-In PostHog Code, `focus_revision` to the new draft so the user+In PostHog Desktop, `focus_revision` to the new draft so the usersees it.## Step 3 — edit@@ -94,7 +94,7 @@ For each edit, surface to the user:- The before/after diff if it's small (< 20 lines), else just thesummary-In PostHog Code, `focus_file` to each file as you touch it.+In PostHog Desktop, `focus_file` to each file as you touch it.## Step 4 — validate@@ -170,7 +170,7 @@ Then call `posthog__agent-applications-revisions-promote-create`.## Step 8 — observeAfter promoting, **watch the first real session(s)**. In-PostHog Code, `focus_session` for `posthog__agent-applications-sessions-list`+PostHog Desktop, `focus_session` for `posthog__agent-applications-sessions-list`and tell the user you're watching for the next fire. If somethinglooks wrong in the first 1-3 sessions, you have a quick rollback:diff --git a/services/mcp/playbooks/querying-ai-observability/SKILL.md b/services/mcp/playbooks/querying-ai-observability/SKILL.mdindex dc32c7461e17..78933c0714fe 100644--- a/services/mcp/playbooks/querying-ai-observability/SKILL.md+++ b/services/mcp/playbooks/querying-ai-observability/SKILL.md@@ -175,7 +175,7 @@ single-agent deep dive."`@posthog/slack-post-message` failed in 9/40 sessions this week,all `not_in_channel`" is a proposal-worthy finding; one failure isnoise.-- **Always offer the deep link.** PostHog Code's session page links+- **Always offer the deep link.** PostHog Desktop's session page linksstraight to the trace in LLM Analytics — point the user there forthe rich waterfall view rather than pasting a giant result set.diff --git a/services/mcp/playbooks/reading-an-agent/SKILL.md b/services/mcp/playbooks/reading-an-agent/SKILL.mdindex b147ff6b9830..abc8ad5c8333 100644--- a/services/mcp/playbooks/reading-an-agent/SKILL.md+++ b/services/mcp/playbooks/reading-an-agent/SKILL.md@@ -19,7 +19,7 @@ mental model from earlier in the session.`live_revision_id`. Capture `spec` (the full JSON) and`bundle_sha256`.-3. **Pre-focus in PostHog Code.** If you have `focus_revision`,+3. **Pre-focus in PostHog Desktop.** If you have `focus_revision`,fire `focus_revision({ slug, revisionId: <live_revision_id> })`now so the user sees the same screen you do.diff --git a/services/mcp/playbooks/running-and-evaluating-tests/SKILL.md b/services/mcp/playbooks/running-and-evaluating-tests/SKILL.mdindex ce217ffef578..7fe078d12668 100644--- a/services/mcp/playbooks/running-and-evaluating-tests/SKILL.md+++ b/services/mcp/playbooks/running-and-evaluating-tests/SKILL.md@@ -115,7 +115,7 @@ agent-applications-revisions-test-results-retrieve test_run_id=<id>conversation, tool_calls, logs, usage } ] }```-In PostHog Code, `focus_session` to the test run as it+In PostHog Desktop, `focus_session` to the test run as itstreams. The user wants to watch.## Reading resultsdiff --git a/services/mcp/playbooks/secrets-and-integrations/SKILL.md b/services/mcp/playbooks/secrets-and-integrations/SKILL.mdindex 07e92d2fa837..5f6eff1de9cf 100644--- a/services/mcp/playbooks/secrets-and-integrations/SKILL.md+++ b/services/mcp/playbooks/secrets-and-integrations/SKILL.md@@ -82,7 +82,7 @@ promote — but a better user experience is to catch it duringdeclares a `slack` trigger, drive the punch-out for BOTH requiredkeys before reaching freeze. See the `setting-up-slack-app` playbook forthe step-by-step flow (create app → set Request URL → install →-copy + punch-out tokens). PostHog Code's env editor also surfaces+copy + punch-out tokens). PostHog Desktop's env editor also surfaces"Required for this trigger" hints next to the relevant fields, so auser setting things up in the UI sees the requirement without youhaving to spell it out.@@ -109,13 +109,13 @@ landed. Then proceed to freeze + promote.## Setting a secret — the punch-out flow-The punch-out flow is live in PostHog Code. You never see the+The punch-out flow is live in PostHog Desktop. You never see thevalue; the user enters it into a UI form scoped to that key. Threepaths, picked by what the client supports — preferred to least.### Path A (preferred) — `client.kind = posthog-code`, inline tool-PostHog Code fulfills a `set_secret` client tool by rendering an+PostHog Desktop fulfills a `set_secret` client tool by rendering aninline form **inside the matching tool-call card**, right in thechat transcript. The user fills it in without leaving theconversation.@@ -165,7 +165,7 @@ Loop:suggest the user retry or use the deep-link fallback (Path B).If the runtime returns `unhandled_client_tool` _immediately_ (older-PostHog Code version that doesn't yet know `set_secret`), fall through+PostHog Desktop version that doesn't yet know `set_secret`), fall throughto path B — the runner returns the unhandled error directly, nopark + wake.@@ -186,14 +186,14 @@ secrets editor and wait for a session callback. Loop:`focus_*` tool for this — the editor wants its own modal,not a panel hand-off.-3. **Wait for the callback.** When the user saves, PostHog Code+3. **Wait for the callback.** When the user saves, PostHog Desktopposts a `[system]` message into the same session:`[system] User set secret KEY on agent SLUG. Continue.` Don'tpoll — the callback is push, not pull. If the user closes thedialog without saving, ask once after a turn of silence thendrop it.-### Path C — non-PostHog-Code client+### Path C — non-PostHog-Desktop clientNo inline tool, no callback wire — same URL, but you ask the userto confirm manually. Loop:@@ -207,7 +207,7 @@ to confirm manually. Loop:https://<host>/project/<team>/agents/<slug>/connections?edit_secret=<KEY>```- Omit `callback_session=` — without PostHog Code there's nothing+ Omit `callback_session=` — without PostHog Desktop there's nothingto receive it.3. Tell them: "Open <url>, set your value, then say 'done' here."diff --git a/services/mcp/playbooks/setting-up-slack-app/SKILL.md b/services/mcp/playbooks/setting-up-slack-app/SKILL.mdindex e63312a8f169..8b9e6a390e4a 100644--- a/services/mcp/playbooks/setting-up-slack-app/SKILL.md+++ b/services/mcp/playbooks/setting-up-slack-app/SKILL.md@@ -62,8 +62,8 @@ carries the events Request URL makes Slack verify it immediately:- If `events_url` came back null (no public ingress URL), say so andstop — same as the manual flow; the manifest's URL is a placeholder.-PostHog Code surfaces the same manifest under the agent's **Connections**-tab ("Set up Slack" card) — point PostHog Code users there instead of pasting+PostHog Desktop surfaces the same manifest under the agent's **Connections**+tab ("Set up Slack" card) — point PostHog Desktop users there instead of pastingJSON into chat.## Prereqs you can detectdiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 320549983c27..a29a1505c716 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -14134,12 +14134,12 @@ export namespace Schemas {*/export interface ClaudeTaskRunCreateSchema {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServer[] | null;/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServer[] | null;@@ -14198,7 +14198,7 @@ export namespace Schemas {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnum;- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string;/** Initial permission mode for Claude runtimes.*@@ -14505,12 +14505,12 @@ export namespace Schemas {*/export interface CodexTaskRunCreateSchema {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServer[] | null;/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServer[] | null;@@ -14569,7 +14569,7 @@ export namespace Schemas {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnum;- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string;/** Initial permission mode for Codex runtimes.*@@ -22920,7 +22920,7 @@ export namespace Schemas {* @nullable*/conclusion_comment?: string | null;- /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */+ /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */open_cleanup_pr?: boolean;}@@ -26519,7 +26519,7 @@ export namespace Schemas {*/conclusion_comment?: string | null;/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id: string | null;@@ -26814,7 +26814,7 @@ export namespace Schemas {} as const;export interface ExperimentFlagCleanupTask {- /** ID of the flag-cleanup Code task. */+ /** ID of the flag-cleanup Desktop task. */task_id: string;/** Status of the task's latest run.*@@ -26832,7 +26832,7 @@ export namespace Schemas {* @nullable*/pr_url: string | null;- /** Whether the requesting user can open the task in PostHog Code. Cleanup tasks are visible to their creator only, so other viewers should not be shown a task link. */+ /** Whether the requesting user can open the task in PostHog Desktop. Cleanup tasks are visible to their creator only, so other viewers should not be shown a task link. */can_view_task: boolean;}@@ -27275,7 +27275,7 @@ export namespace Schemas {*/conclusion_comment?: string | null;/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id: string | null;@@ -30312,7 +30312,7 @@ export namespace Schemas {* * `warehouse` - warehouse* * `direct` - direct */access_method?: AccessMethodEnum;- /** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Code-driven MCP calls. Defaults to `api`.+ /** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Desktop-driven MCP calls. Defaults to `api`.** * `web` - web* * `api` - api@@ -30387,7 +30387,7 @@ export namespace Schemas {readonly created_at: string;/** @nullable */readonly created_by: string | null;- /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.+ /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api@@ -31547,7 +31547,7 @@ export namespace Schemas {}export interface GitHubPrepareCallbackRequest {- /** Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Code). */+ /** Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Desktop). */next?: string;/** GitHub installation ID being managed; binds the seeded update state so a callback can't swap in a different installation. */installation_id?: string;@@ -48090,7 +48090,7 @@ export namespace Schemas {*/conclusion_comment?: string | null;/**- * ID of the Code task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.+ * ID of the Desktop task opened to remove the experiment's feature-flag code, when one was requested via open_cleanup_pr on end/ship_variant. Read its status via the flag_cleanup_task action.* @nullable*/readonly flag_cleanup_task_id?: string | null;@@ -48276,7 +48276,7 @@ export namespace Schemas {readonly created_at?: string;/** @nullable */readonly created_by?: string | null;- /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.+ /** How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api@@ -58343,7 +58343,7 @@ export namespace Schemas {export interface QuotaLimitsResponse {/** Per-resource limit state for every `QuotaResource` value, e.g. `ai_credits`, `posthog_code_credits`. */limited: QuotaLimitsResponseLimited;- /** Whether the team's organization pays for PostHog Code usage: billing grants the `posthog_code_usage` product feature only on the Code usage product's paid plan, synced into the organization's available features. Consumers gate paid-tier Code behavior on this; an org unknown to billing reads as not paying. */+ /** Whether the team's organization pays for PostHog Desktop usage: billing grants the `posthog_code_usage` product feature only on the Desktop usage product's paid plan, synced into the organization's available features. Consumers gate paid-tier Desktop behavior on this; an org unknown to billing reads as not paying. */code_usage_billing_active: boolean;}@@ -60634,7 +60634,7 @@ export namespace Schemas {* @nullable*/conclusion_comment?: string | null;- /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */+ /** When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise. */open_cleanup_pr?: boolean;/** The key of the variant to ship. */variant_key: string;@@ -67043,12 +67043,12 @@ export namespace Schemas {*/export interface TaskRunBootstrapCreateRequest {/**- * Local url-based MCP servers from the creating client (PostHog Code) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.+ * Local url-based MCP servers from the creating client (PostHog Desktop) to make available inside the cloud sandbox. Header values are treated as credentials: stored encrypted and never returned by the API.* @nullable*/imported_mcp_servers?: ImportedMcpServer[] | null;/**- * Names of desktop-only MCP servers the creating client (PostHog Code) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.+ * Names of desktop-only MCP servers the creating client (PostHog Desktop) relays into the cloud sandbox over the durable event/command channel. Names only — the server configuration (command, env, URL, headers) never crosses the wire.* @nullable*/relayed_mcp_servers?: RelayedMcpServer[] | null;@@ -67104,7 +67104,7 @@ export namespace Schemas {* * `xhigh` - xhigh* * `max` - max */reasoning_effort?: ReasoningEffortEnum;- /** Ephemeral GitHub user token from PostHog Code for user-authored cloud pull requests. */+ /** Ephemeral GitHub user token from PostHog Desktop for user-authored cloud pull requests. */github_user_token?: string;/** Initial permission mode for the agent session. Claude runtimes accept PostHog permission presets like 'plan'. Codex runtimes accept native Codex modes like 'plan', 'auto', and 'read-only'.*@@ -67216,7 +67216,7 @@ export namespace Schemas {run_source?: RunSourceEnum;/** Optional signal report identifier when this run was started from Inbox. */signal_report_id?: string;- /** Optional GitHub user token from PostHog Code for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */+ /** Optional GitHub user token from PostHog Desktop for user-authored cloud pull requests. Prefer linking GitHub from Settings → Linked accounts so the server can manage tokens; this field remains supported for callers that still manage their own tokens. */github_user_token?: string;}@@ -68485,7 +68485,7 @@ export namespace Schemas {export interface UserGitHubLinkStartRequest {/**- * Optional team/project id (e.g. PostHog Code); web UI uses the session's current team.+ * Optional team/project id (e.g. PostHog Desktop); web UI uses the session's current team.* @nullable*/team_id?: number | null;diff --git a/services/mcp/src/generated/experiments/api.ts b/services/mcp/src/generated/experiments/api.tsindex 47bc8f07c34e..29ec3af7c864 100644--- a/services/mcp/src/generated/experiments/api.ts+++ b/services/mcp/src/generated/experiments/api.ts@@ -11634,7 +11634,7 @@ export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({.boolean().default(experimentsEndCreateBodyOpenCleanupPrDefault).describe(- "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise."+ "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise."),})@@ -11792,7 +11792,7 @@ export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({.boolean().default(experimentsShipVariantCreateBodyOpenCleanupPrDefault).describe(- "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise."+ "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise."),variant_key: zod.string().describe('The key of the variant to ship.'),release_to_everyone: zoddiff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.tsindex 959ef218dbe3..6d986401e59e 100644--- a/services/mcp/src/generated/warehouse_sources/api.ts+++ b/services/mcp/src/generated/warehouse_sources/api.ts@@ -1892,7 +1892,7 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zod]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),client_secret: zod.string().optional(),account_id: zod.string().optional(),@@ -1971,7 +1971,7 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zod]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),client_secret: zod.string(),account_id: zod.string(),@@ -2038,7 +2038,7 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zod]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),client_secret: zod.string(),account_id: zod.string(),@@ -2101,7 +2101,7 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zod]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),direct_query_enabled: zod.boolean()@@ -2159,7 +2159,7 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zod]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),direct_query_enabled: zod.boolean()@@ -2242,7 +2242,7 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */]).optional().describe(- "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"+ "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving"),client_secret: zod.string(),account_id: zod.string(),diff --git a/services/mcp/src/lib/build-tool-result.ts b/services/mcp/src/lib/build-tool-result.tsindex 870a6dba8204..717037a0e9e5 100644--- a/services/mcp/src/lib/build-tool-result.ts+++ b/services/mcp/src/lib/build-tool-result.ts@@ -23,7 +23,7 @@ export interface BuildToolResultOptions {/** Whether formatted-result text should win over structuredContent for this client profile. */suppressStructuredContentForFormattedResults?: boolean | undefined/**- * For inline-exec UI-app hosts (PostHog Code, Claude Code, Cowork): always drop+ * For inline-exec UI-app hosts (PostHog Desktop, Claude Code, Cowork): always drop* top-level `structuredContent` toward the model and re-home the app payload onto* `_meta` instead — even when there's no formatted table (the model then reads the* TOON text). These hosts surface `structuredContent` to the model, so it mustdiff --git a/services/mcp/src/lib/client-detection.ts b/services/mcp/src/lib/client-detection.tsindex 4caeec17d698..3f0d5b4f057d 100644--- a/services/mcp/src/lib/client-detection.ts+++ b/services/mcp/src/lib/client-detection.ts@@ -23,7 +23,7 @@* so it does not need the formatted-results workaround.** - `isPostHogCodeConsumer()` matches the `x-posthog-mcp-consumer` header- * sent by the PostHog Code Tasks wrapper.+ * sent by the PostHog Desktop Tasks wrapper.** - `isClaudeUiHost()` matches Claude web/desktop and Cowork — MCP Apps hosts* that render interactive UI (iframes). Used to advertise the `render-ui`@@ -161,10 +161,10 @@ export function resolveEffectiveClientName(return VENDOR_CLIENT_TO_CLIENT_NAME[normalizeClientName(vendorClient)] ?? vendorClient}-// Value sent in `x-posthog-mcp-consumer` by PostHog Code (the Tasks sandbox+// Value sent in `x-posthog-mcp-consumer` by PostHog Desktop (the Tasks sandbox// wrapper around the Claude Agent SDK) when the task was launched from the-// PostHog Code UI. Slack-launched runs send `"slack"` and posthog_ai (Max) runs-// send `"posthog_ai"`; only PostHog Code renders MCP UI apps, so this is the+// PostHog Desktop UI. Slack-launched runs send `"slack"` and posthog_ai (Max) runs+// send `"posthog_ai"`; only PostHog Desktop renders MCP UI apps, so this is the// sole consumer that gates UI-apps payload emission in single-exec mode.export const POSTHOG_CODE_CONSUMER = 'posthog-code'@@ -189,7 +189,7 @@ export const ANTHROPIC_CHAT_HOST_VENDOR_FRAGMENTS = ['claudeai'] as const// Anthropic coding-agent surfaces that render MCP UI apps inline through the// single-exec `exec` tool. `ClaudeCode` and `Cowork` render UI apps on the exec// response itself (`ClaudeAI` uses the separate `render-ui` tool instead;-// `Cowork` supports both), so they get the same treatment as the PostHog Code+// `Cowork` supports both), so they get the same treatment as the PostHog Desktop// consumer.export const INLINE_EXEC_UI_APP_VENDOR_FRAGMENTS = ['claudecode', 'cowork'] as const@@ -325,7 +325,7 @@ export class MCPClientProfile {// Anthropic coding-agent surfaces that render MCP UI apps inline through the// single-exec `exec` tool (Claude Code, Cowork) — Claude.ai web/desktop// renders via the separate `render-ui` tool instead (Cowork supports both).- // Like PostHog Code, these hosts surface `structuredContent` to the model, so+ // Like PostHog Desktop, these hosts surface `structuredContent` to the model, so// the exec UI-app branch suppresses it and re-homes the app data onto `_meta`.// The per-request vendor header (`ClaudeCode` / `Cowork`) is the reliable signal.return matchesAnyFragment(this.vendorClient, INLINE_EXEC_UI_APP_VENDOR_FRAGMENTS)diff --git a/services/mcp/src/tools/exec.ts b/services/mcp/src/tools/exec.tsindex dc33970527bb..119e98649f6d 100644--- a/services/mcp/src/tools/exec.ts+++ b/services/mcp/src/tools/exec.ts@@ -59,7 +59,7 @@ export interface ExecToolOptions {/*** Client is an inline-exec UI-app host that renders MCP UI apps on the exec* response (Claude Code, Cowork). Gets the same UI-app payload treatment as the- * PostHog Code consumer: structuredContent suppressed toward the model, app data+ * PostHog Desktop consumer: structuredContent suppressed toward the model, app data* re-homed onto `_meta`. Computed from the client profile at the call site.*/isInlineExecUiHost?: boolean@@ -633,7 +633,7 @@ export function createExecTool(}// If the inner tool has a UI app attached AND the caller self-identifies as- // PostHog Code (the UI-apps host), emit a full `CallToolResult` payload+ // PostHog Desktop (the UI-apps host), emit a full `CallToolResult` payload// carrying `structuredContent` + `_meta.ui.resourceUri`. Clients only see// the `exec` tool registered in single-exec mode, so the UI metadata has to// ride on the per-call response. Gated on the consumer because other@@ -649,7 +649,7 @@ export function createExecTool(toolMeta: tool._meta,toolName: tool.name,params: useJson ? { ...input, output_format: 'json' } : input,- // Inline-exec UI-app hosts (PostHog Code, Claude Code, Cowork)+ // Inline-exec UI-app hosts (PostHog Desktop, Claude Code, Cowork)// surface `structuredContent` to the model in preference to the// text content, which would bury the compact formatted table// under the raw JSON. Always re-home the UI app's data ontodiff --git a/services/mcp/src/ui-apps/types.ts b/services/mcp/src/ui-apps/types.tsindex 94ceafa4d405..aa62f363d931 100644--- a/services/mcp/src/ui-apps/types.ts+++ b/services/mcp/src/ui-apps/types.ts@@ -23,7 +23,7 @@ export interface AnalyticsMetadata {/*** Result `_meta` key that carries a UI app's data payload when the top-level* `structuredContent` is suppressed from the model. Coding-agent hosts (e.g.- * PostHog Code) surface `structuredContent` to the model, so when a compact+ * PostHog Desktop) surface `structuredContent` to the model, so when a compact* formatted table is returned we drop `structuredContent` to keep the model's* context lean. The UI app still needs the data to render, and `_meta` is host-* and app-only (never shown to the model), so the app hydrates from here.diff --git a/services/mcp/tests/integration/mcp-protocol-suite.ts b/services/mcp/tests/integration/mcp-protocol-suite.tsindex fa54487cd737..ee0e0581062d 100644--- a/services/mcp/tests/integration/mcp-protocol-suite.ts+++ b/services/mcp/tests/integration/mcp-protocol-suite.ts@@ -1822,7 +1822,7 @@ export function defineStatelessProtocolTests(})it('merges server identity into a tool result that carries its own _meta', async () => {- // Only the exec path with a PostHog Code consumer puts `_meta`+ // Only the exec path with a PostHog Desktop consumer puts `_meta`// (ui.resourceUri) on the call result — the one production shape// that would expose serverInfo stamping clobbering a tool's meta.const harness = await getHarness()diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.jsonindex b16810ac942f..8a9a49449e19 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json@@ -32,7 +32,7 @@},"open_cleanup_pr": {"default": false,- "description": "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise.",+ "description": "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise.","type": "boolean"}},diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.jsonindex db46b53a976b..5ca554fe60d4 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json@@ -32,7 +32,7 @@},"open_cleanup_pr": {"default": false,- "description": "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Code (403 otherwise). Only acts for allowlisted teams; ignored otherwise.",+ "description": "When true, open a draft pull request that removes the experiment's feature-flag code from the linked repository. Requires the requesting user to have access to PostHog Desktop (403 otherwise). Only acts for allowlisted teams; ignored otherwise.","type": "boolean"},"release_to_everyone": {diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.jsonindex 1fdc67fa973d..c0a6eda1fea3 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json@@ -39,7 +39,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"description": {"anyOf": [diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.jsonindex 1fdc67fa973d..c0a6eda1fea3 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json@@ -39,7 +39,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"description": {"anyOf": [diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.jsonindex e9e807dfb2c1..27fe7c40f0cc 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json@@ -39,7 +39,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"description": {"anyOf": [diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.jsonindex 92548a03a0df..f695158a27ba 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json@@ -33,7 +33,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"direct_query_enabled": {"description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.jsonindex 92548a03a0df..f695158a27ba 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json@@ -33,7 +33,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"direct_query_enabled": {"description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.jsonindex 1fdc67fa973d..c0a6eda1fea3 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json@@ -39,7 +39,7 @@"type": "null"}],- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Code app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup wizard and `self_driving` for the PostHog Desktop app (both derived server-side from the caller's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving"},"description": {"anyOf": [diff --git a/services/mcp/tests/unit/client-detection.test.ts b/services/mcp/tests/unit/client-detection.test.tsindex d4ff28f34471..a28c87ef4b48 100644--- a/services/mcp/tests/unit/client-detection.test.ts+++ b/services/mcp/tests/unit/client-detection.test.ts@@ -165,7 +165,7 @@ describe('resolveEffectiveClientName', () => {})describe('isPostHogCodeConsumer', () => {- it('matches the exact PostHog Code consumer value', () => {+ it('matches the exact PostHog Desktop consumer value', () => {expect(isPostHogCodeConsumer(POSTHOG_CODE_CONSUMER)).toBe(true)expect(isPostHogCodeConsumer('posthog-code')).toBe(true)})diff --git a/services/mcp/tests/unit/exec.test.ts b/services/mcp/tests/unit/exec.test.tsindex 5bbf79d6d06c..c3cacfeb8b4b 100644--- a/services/mcp/tests/unit/exec.test.ts+++ b/services/mcp/tests/unit/exec.test.ts@@ -332,7 +332,7 @@ describe('exec tool', () => {expect(result.__execBuiltPayload).toBe(true)})- // Inline-exec UI-app hosts: PostHog Code (via consumer) plus Claude Code and+ // Inline-exec UI-app hosts: PostHog Desktop (via consumer) plus Claude Code and// Cowork (via the client-profile flag). All three surface structuredContent to// the model, so it must be dropped and the UI data re-homed onto _meta.it.each([diff --git a/services/oauth-proxy/src/index.ts b/services/oauth-proxy/src/index.tsindex 63d27bcda95c..1216b31a4a4d 100644--- a/services/oauth-proxy/src/index.ts+++ b/services/oauth-proxy/src/index.ts@@ -4,7 +4,7 @@* A Cloudflare Worker that sits in front of both US and EU PostHog instances,* providing a single OAuth endpoint that handles region routing transparently.*- * Used by the PostHog MCP server, PostHog Code, and any future OAuth integration+ * Used by the PostHog MCP server, PostHog Desktop, and any future OAuth integration* so they don't need separate US/EU URLs.*/import { handleAuthorize } from '@/handlers/authorize'diff --git a/tools/hogli-commands/hogli_commands/devenv/generator.py b/tools/hogli-commands/hogli_commands/devenv/generator.pyindex b795141c7fcb..1a3d71baf9ff 100644--- a/tools/hogli-commands/hogli_commands/devenv/generator.py+++ b/tools/hogli-commands/hogli_commands/devenv/generator.py@@ -411,7 +411,7 @@ printf ' {gray}Run {reset}{blue}hogli dev:setup{reset}{gray} to tailor this to_SANDBOX_UNSANDBOXED_PREFIXES = ("bin/dev-open-when-ready",)# Procs excluded from the sandbox by default: they need the docker socket the- # profile denies (e.g. temporal-worker running PostHog Code tasks with+ # profile denies (e.g. temporal-worker running PostHog Desktop tasks with# SANDBOX_PROVIDER=docker). POSTHOG_DEV_SANDBOX_EXCLUDE adds more on top._SANDBOX_DEFAULT_EXCLUDES = frozenset({"temporal-worker"})@@ -429,7 +429,7 @@ printf ' {gray}Run {reset}{blue}hogli dev:setup{reset}{gray} to tailor this toSome procs are excluded by default (``_SANDBOX_DEFAULT_EXCLUDES``) becausethey need the docker socket the profile denies, e.g. temporal-worker running- PostHog Code tasks with SANDBOX_PROVIDER=docker. POSTHOG_DEV_SANDBOX_EXCLUDE+ PostHog Desktop tasks with SANDBOX_PROVIDER=docker. POSTHOG_DEV_SANDBOX_EXCLUDE(comma-separated proc names) opts additional procs back out. Excluded procsrun fully unsandboxed, so the dependency-isolation guarantee no longer coversthem.diff --git a/tools/hogli-commands/hogli_commands/worktrees.py b/tools/hogli-commands/hogli_commands/worktrees.pyindex 5b4210d1fae2..2183f50829e1 100644--- a/tools/hogli-commands/hogli_commands/worktrees.py+++ b/tools/hogli-commands/hogli_commands/worktrees.py@@ -1,4 +1,4 @@-"""Clean up unused agent worktrees (Claude Code, Codex, PostHog Code).+"""Clean up unused agent worktrees (Claude Code, Codex, PostHog Desktop).These tools each create throwaway git worktrees that accumulate over time. Asingle PostHog worktree carries multi-GB `node_modules`, Python venvs, and Rust@@ -41,7 +41,7 @@ from .doctor import _format_size# Roots that hold agent-created worktrees, keyed by the tool that owns them.-# Claude Code and Codex nest worktrees directly under the repo; PostHog Code+# Claude Code and Codex nest worktrees directly under the repo; PostHog Desktop# keeps them in the home directory as <id>/posthog. Returned as (source, root).def _worktree_roots(repo_root: Path) -> list[tuple[str, Path]]:return [@@ -131,7 +131,7 @@ class Worktree:@click.command(name="worktrees:clean",- help="Clear out unused Claude Code / Codex / PostHog Code worktrees by age",+ help="Clear out unused Claude Code / Codex / PostHog Desktop worktrees by age",)@click.option("--before",@@ -225,7 +225,7 @@ def worktrees_clean(resolved = _resolve(path)if resolved in protected:continue- # PostHog Code worktrees live outside the repo and the home root is+ # PostHog Desktop worktrees live outside the repo and the home root is# shared across repos, so only act on worktrees owned by this repo.if not _belongs_to_repo(resolved, repo_root, repo_common):continue@@ -432,7 +432,7 @@ def _parse_cutoff(value: str) -> tuple[float, str]:def _discover_worktrees(root: Path, max_depth: int = 2) -> list[Path]:"""Find worktree directories under *root* (a dir containing a .git entry).- Depth 1 covers Claude/Codex (root/<name>); depth 2 covers PostHog Code+ Depth 1 covers Claude/Codex (root/<name>); depth 2 covers PostHog Desktop(root/<id>/posthog). Found worktrees are not descended into."""@@ -529,7 +529,7 @@ def _belongs_to_repo(resolved_path: Path, repo_root: Path, repo_common: Path | N"""Whether a worktree is owned by *repo_root*.Worktrees physically inside the repo always belong to it. For out-of-repo- worktrees (PostHog Code's home root is shared across repos), confirm via the+ worktrees (PostHog Desktop's home root is shared across repos), confirm via thegitdir's commondir pointing back at this repo's common git directory. Adangling pointer we can't attribute is treated as not ours, so we neverdelete another repo's worktree.@@ -938,7 +938,7 @@ def _delete_paths(paths: Sequence[Path], sizes: dict[str, float]) -> tuple[floatdef _cleanup_empty_parent(path: Path) -> None:- """Remove a now-empty parent (e.g. PostHog Code's <id>/ after <id>/posthog)."""+ """Remove a now-empty parent (e.g. PostHog Desktop's <id>/ after <id>/posthog)."""parent = path.parenttry:diff --git a/tools/pr-approval-agent/test_github.py b/tools/pr-approval-agent/test_github.pyindex f8996d0cd4f0..83b559b944ba 100644--- a/tools/pr-approval-agent/test_github.py+++ b/tools/pr-approval-agent/test_github.py@@ -203,12 +203,12 @@ def test_is_bot_author(user: dict, expected: bool) -> None:[pytest.param("fix: resolve login redirect loop\n\n"- "Generated-By: PostHog Code\n"+ "Generated-By: PostHog Desktop\n""Task-Id: a95947d1-6e11-4565-9922-1f857cc6f6fe\n\x1e\n",CommitProvenance(commit_count=1,agent_commit_count=1,- generated_by=("PostHog Code",),+ generated_by=("PostHog Desktop",),task_ids=("a95947d1-6e11-4565-9922-1f857cc6f6fe",),),id="single-agent-commit",@@ -219,13 +219,13 @@ def test_is_bot_author(user: dict, expected: bool) -> None:id="human-only-commits",),pytest.param(- "feat: add export\n\nGenerated-By: PostHog Code\nTask-Id: task-1\n\x1e\n"+ "feat: add export\n\nGenerated-By: PostHog Desktop\nTask-Id: task-1\n\x1e\n""fix: review feedback\n\x1e\n"- "fix: more feedback\n\nGenerated-By: PostHog Code\nTask-Id: task-2\n\x1e\n",+ "fix: more feedback\n\nGenerated-By: PostHog Desktop\nTask-Id: task-2\n\x1e\n",CommitProvenance(commit_count=3,agent_commit_count=2,- generated_by=("PostHog Code",),+ generated_by=("PostHog Desktop",),task_ids=("task-1", "task-2"),),id="mixed-commits-dedupe-generator-collect-task-ids",@@ -233,11 +233,11 @@ def test_is_bot_author(user: dict, expected: bool) -> None:pytest.param("feat(insights): retention export (#71452)\n\n""* feat: first pass\n\n"- "Generated-By: PostHog Code\n"+ "Generated-By: PostHog Desktop\n""Task-Id: task-1\n\n""* fix: address review\n\x1e\n",CommitProvenance(- commit_count=1, agent_commit_count=1, generated_by=("PostHog Code",), task_ids=("task-1",)+ commit_count=1, agent_commit_count=1, generated_by=("PostHog Desktop",), task_ids=("task-1",)),id="squash-style-message-with-embedded-trailers",),diff --git a/tools/pr-approval-agent/test_review_pr.py b/tools/pr-approval-agent/test_review_pr.pyindex 9cc0ceee7320..8891b449ae3c 100644--- a/tools/pr-approval-agent/test_review_pr.py+++ b/tools/pr-approval-agent/test_review_pr.py@@ -518,7 +518,7 @@ def test_capture_review_completed_includes_familiarity_and_provenance(pipeline.provenance = CommitProvenance(commit_count=3,agent_commit_count=2,- generated_by=("PostHog Code",),+ generated_by=("PostHog Desktop",),task_ids=("task-1", "task-2"),)@@ -534,7 +534,7 @@ def test_capture_review_completed_includes_familiarity_and_provenance(assert props["stamphog_agent_authored"] is Trueassert props["stamphog_agent_commit_count"] == 2assert props["stamphog_commit_count"] == 3- assert props["stamphog_generated_by"] == ["PostHog Code"]+ assert props["stamphog_generated_by"] == ["PostHog Desktop"]assert props["stamphog_task_ids"] == ["task-1", "task-2"]else:assert props["stamphog_owner_teams"] == []