: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
feat(data-warehouse): attribute posthog code-created sources as created_via=self_driving (#70661)
Tom Owers04a79ad09de5
diff --git a/products/data_warehouse/backend/presentation/views/external_data_source.py b/products/data_warehouse/backend/presentation/views/external_data_source.pyindex 5d7f60fd551e..6cb78d0dc8ff 100644--- a/products/data_warehouse/backend/presentation/views/external_data_source.py+++ b/products/data_warehouse/backend/presentation/views/external_data_source.py@@ -774,7 +774,8 @@ 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 (derived server-side from the wizard's user agent). "+ "`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."),)@@ -1280,9 +1281,10 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):help_text="Connection mode: 'warehouse' (import) or 'direct' (live query).",)created_via = serializers.ChoiceField(- # `wizard` is intentionally omitted: it is never accepted from a caller (that would let any- # client self-label as wizard-created). It is derived server-side by upgrading a- # machine-injected `mcp` value when the request comes from the wizard transport.+ # `wizard` and `self_driving` are intentionally omitted: they are never accepted from a+ # caller (that would let any client self-label as wizard- or PostHog Code-created). They+ # are derived server-side by upgrading a machine-injected `mcp` value when the request+ # comes from the wizard or PostHog Code transport.choices=[ExternalDataSource.CreatedVia.WEB,ExternalDataSource.CreatedVia.API,@@ -1292,8 +1294,8 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):default=ExternalDataSource.CreatedVia.API,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` cannot be set directly — it is derived "- "server-side for wizard-driven MCP calls. Defaults to `api`."+ "`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`."),)direct_query_enabled = serializers.BooleanField(@@ -1904,12 +1906,16 @@ 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 drives 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 to `wizard` when the transport identifies the wizard, so wizard+ # The setup wizard and PostHog Code 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.- if created_via == ExternalDataSource.CreatedVia.MCP and get_event_source(request) == EventSource.WIZARD:- created_via = ExternalDataSource.CreatedVia.WIZARD+ if created_via == ExternalDataSource.CreatedVia.MCP:+ transport_created_via = {+ EventSource.WIZARD: ExternalDataSource.CreatedVia.WIZARD,+ EventSource.POSTHOG_CODE: ExternalDataSource.CreatedVia.SELF_DRIVING,+ }+ created_via = transport_created_via.get(get_event_source(request), created_via)is_direct_query = access_method == ExternalDataSource.AccessMethod.DIRECTis_direct_mysql = is_direct_query and source_type == ExternalDataSourceType.MYSQLis_direct_snowflake = is_direct_query and source_type == ExternalDataSourceType.SNOWFLAKE@@ -2493,11 +2499,11 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMiximanaged_viewset.sync_views()ensure_person_join(self.team.pk, new_source_model.prefix)- # `source` (web/api/mcp/wizard) 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- # to `wizard` above when the transport identifies the wizard). They usually agree but are kept- # separate so a transport change (e.g. a new wrapper UA) doesn't silently rewrite historical- # attribution.+ # `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+ # agree but are kept separate so a transport change (e.g. a new wrapper UA) doesn't silently+ # rewrite historical attribution.report_user_action(cast(User, request.user),"data warehouse source created",diff --git a/products/data_warehouse/backend/tests/api/test_external_data_source.py b/products/data_warehouse/backend/tests/api/test_external_data_source.pyindex 49ffef391e3a..01902688c8de 100644--- a/products/data_warehouse/backend/tests/api/test_external_data_source.py+++ b/products/data_warehouse/backend/tests/api/test_external_data_source.py@@ -363,19 +363,34 @@ class TestExternalDataSource(APIBaseTest):@parameterized.expand([- # The MCP tool injects `mcp`; a wizard user agent upgrades it to `wizard`.- (ExternalDataSource.CreatedVia.MCP, ExternalDataSource.CreatedVia.WIZARD),- # Explicit non-MCP values are never rewritten, even with a wizard user agent.- (ExternalDataSource.CreatedVia.WEB, ExternalDataSource.CreatedVia.WEB),- (ExternalDataSource.CreatedVia.API, ExternalDataSource.CreatedVia.API),+ # The MCP tool injects `mcp`; a wizard or PostHog Code 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 MCP server appends the originating client to its own UA when proxying.+ (+ "posthog/mcp-server; version: 1.0.0; for posthog/code",+ ExternalDataSource.CreatedVia.MCP,+ ExternalDataSource.CreatedVia.SELF_DRIVING,+ ),+ # Plain MCP clients keep the machine-injected value.+ (+ "posthog/mcp-server; version: 1.0.0",+ ExternalDataSource.CreatedVia.MCP,+ ExternalDataSource.CreatedVia.MCP,+ ),+ # Explicit non-MCP values are never rewritten, even with an upgrading user agent.+ ("posthog/wizard/1.0.0", ExternalDataSource.CreatedVia.WEB, ExternalDataSource.CreatedVia.WEB),+ ("posthog/wizard/1.0.0", ExternalDataSource.CreatedVia.API, ExternalDataSource.CreatedVia.API),+ ("posthog/code 1.2.3", ExternalDataSource.CreatedVia.WEB, ExternalDataSource.CreatedVia.WEB),+ ("posthog/code 1.2.3", ExternalDataSource.CreatedVia.API, ExternalDataSource.CreatedVia.API),])@patch("products.warehouse_sources.backend.temporal.data_imports.sources.stripe.source.StripeSource.validate_credentials",return_value=(True, None),)- def test_create_external_data_source_wizard_user_agent_upgrades_mcp_created_via(- self, sent_created_via, expected_created_via, _mock_validate+ def test_create_external_data_source_transport_user_agent_upgrades_mcp_created_via(+ self, user_agent, sent_created_via, expected_created_via, _mock_validate):response = self.client.post(f"/api/environments/{self.team.pk}/external_data_sources/",@@ -389,7 +404,7 @@ class TestExternalDataSource(APIBaseTest):],},},- headers={"user-agent": "posthog/wizard/1.0.0"},+ headers={"user-agent": user_agent},)assert response.status_code == 201, response.json()@@ -421,8 +436,10 @@ class TestExternalDataSource(APIBaseTest):@parameterized.expand([("garbage_value", "hacker"),- # `wizard` is derived server-side; a caller must not be able to self-label as wizard-created.+ # `wizard` and `self_driving` are derived server-side; a caller must not be able to+ # self-label as wizard- or PostHog Code-created.("wizard_is_not_caller_settable", ExternalDataSource.CreatedVia.WIZARD),+ ("self_driving_is_not_caller_settable", ExternalDataSource.CreatedVia.SELF_DRIVING),])def test_create_external_data_source_rejects_invalid_created_via(self, _name, created_via):diff --git a/products/warehouse_sources/backend/migrations/0069_alter_externaldatasource_created_via.py b/products/warehouse_sources/backend/migrations/0069_alter_externaldatasource_created_via.pynew file mode 100644index 000000000000..1c617440f0cf--- /dev/null+++ b/products/warehouse_sources/backend/migrations/0069_alter_externaldatasource_created_via.py@@ -0,0 +1,26 @@+from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("warehouse_sources", "0068_backfill_direct_query_enabled_false"),+ ]++ operations = [+ migrations.AlterField(+ model_name="externaldatasource",+ name="created_via",+ field=models.CharField(+ blank=True,+ choices=[+ ("web", "web"),+ ("api", "api"),+ ("mcp", "mcp"),+ ("wizard", "wizard"),+ ("self_driving", "self_driving"),+ ],+ max_length=20,+ null=True,+ ),+ ),+ ]diff --git a/products/warehouse_sources/backend/migrations/max_migration.txt b/products/warehouse_sources/backend/migrations/max_migration.txtindex 3feaef4bc8da..f033efc583de 100644--- a/products/warehouse_sources/backend/migrations/max_migration.txt+++ b/products/warehouse_sources/backend/migrations/max_migration.txt@@ -1 +1 @@-0068_backfill_direct_query_enabled_false+0069_alter_externaldatasource_created_viadiff --git a/products/warehouse_sources/backend/models/external_data_source.py b/products/warehouse_sources/backend/models/external_data_source.pyindex 94983932cc02..1a786e514d53 100644--- a/products/warehouse_sources/backend/models/external_data_source.py+++ b/products/warehouse_sources/backend/models/external_data_source.py@@ -30,6 +30,7 @@ class ExternalDataSource(ModelActivityMixin, CreatedMetaFields, UpdatedMetaFieldAPI = "api", "api"MCP = "mcp", "mcp"WIZARD = "wizard", "wizard"+ SELF_DRIVING = "self_driving", "self_driving"class Status(models.TextChoices):RUNNING = "Running", "Running"diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.tsindex 5f4f43d19070..5b9ab9cac6c9 100644--- a/products/warehouse_sources/frontend/generated/api.schemas.ts+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts@@ -367,6 +367,7 @@ export interface PatchedExternalDataSchemaApi {* * `api` - api* * `mcp` - mcp* * `wizard` - wizard+ * * `self_driving` - self_driving*/export type ExternalDataSourceSerializersCreatedViaEnumApi =(typeof ExternalDataSourceSerializersCreatedViaEnumApi)[keyof typeof ExternalDataSourceSerializersCreatedViaEnumApi]@@ -376,6 +377,7 @@ export const ExternalDataSourceSerializersCreatedViaEnumApi = {Api: 'api',Mcp: 'mcp',Wizard: 'wizard',+ SelfDriving: 'self_driving',} as const/**@@ -1951,12 +1953,13 @@ 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 (derived server-side from the wizard'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 Code app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api* * `mcp` - mcp- * * `wizard` - wizard */+ * * `wizard` - wizard+ * * `self_driving` - self_driving */created_via?: ExternalDataSourceSerializersCreatedViaEnumApi | nullreadonly status: stringclient_secret: string@@ -2812,7 +2815,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` cannot be set directly — it is derived server-side for wizard-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 Code-driven MCP calls. Defaults to `api`.** * `web` - web* * `api` - api@@ -2832,12 +2835,13 @@ 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 (derived server-side from the wizard'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 Code app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api* * `mcp` - mcp- * * `wizard` - wizard */+ * * `wizard` - wizard+ * * `self_driving` - self_driving */created_via?: ExternalDataSourceSerializersCreatedViaEnumApi | nullreadonly status?: stringclient_secret?: stringdiff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.tsindex 53845d5649b1..dde0ecc27aac 100644--- a/products/warehouse_sources/frontend/generated/api.zod.ts+++ b/products/warehouse_sources/frontend/generated/api.zod.ts@@ -1526,7 +1526,7 @@ export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({.describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp').default(externalDataSourcesCreateBodyCreatedViaDefault).describe(- 'Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. `wizard` cannot be set directly — it is derived server-side for wizard-driven MCP calls. Defaults to `api`.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'+ '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`.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),direct_query_enabled: zod.boolean()@@ -1548,13 +1548,15 @@ export const ExternalDataSourcesUpdateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1582,13 +1584,15 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string().optional(),account_id: zod.string().optional(),@@ -1689,13 +1693,15 @@ export const ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateBody = /* @_created_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1726,13 +1732,15 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1760,13 +1768,15 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1801,13 +1811,15 @@ export const ExternalDataSourcesDisableCdcCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1846,13 +1858,15 @@ export const ExternalDataSourcesEnableCdcCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1880,13 +1894,15 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1914,13 +1930,15 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1948,13 +1966,15 @@ export const ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateBody = /* @__created_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string().optional(),account_id: zod.string().optional(),@@ -1990,13 +2010,15 @@ export const ExternalDataSourcesUpdateCdcSettingsCreateBody = /* @__PURE__ */ zocreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -2024,13 +2046,15 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */created_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -4481,13 +4505,15 @@ export const ExternalDataSourcesSourcePrefixCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard\n\* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp\n\* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex a9e0fa54d0e4..24cef7d5bf8e 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -26087,7 +26087,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` cannot be set directly — it is derived server-side for wizard-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 Code-driven MCP calls. Defaults to `api`.** * `web` - web* * `api` - api@@ -26136,6 +26136,7 @@ export namespace Schemas {* * `api` - api* * `mcp` - mcp* * `wizard` - wizard+ * * `self_driving` - self_driving*/export type ExternalDataSourceSerializersCreatedViaEnum = typeof ExternalDataSourceSerializersCreatedViaEnum[keyof typeof ExternalDataSourceSerializersCreatedViaEnum];@@ -26145,6 +26146,7 @@ export namespace Schemas {Api: 'api',Mcp: 'mcp',Wizard: 'wizard',+ SelfDriving: 'self_driving',} as const;/**@@ -26155,12 +26157,13 @@ 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 (derived server-side from the wizard'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 Code app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api* * `mcp` - mcp- * * `wizard` - wizard */+ * * `wizard` - wizard+ * * `self_driving` - self_driving */created_via?: ExternalDataSourceSerializersCreatedViaEnum | null;readonly status: string;client_secret: string;@@ -41763,12 +41766,13 @@ 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 (derived server-side from the wizard'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 Code app (both derived server-side from the caller's user agent). Ignored on update.** * `web` - web* * `api` - api* * `mcp` - mcp- * * `wizard` - wizard */+ * * `wizard` - wizard+ * * `self_driving` - self_driving */created_via?: ExternalDataSourceSerializersCreatedViaEnum | null;readonly status?: string;client_secret?: string;diff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.tsindex 9b39e6c12236..38130b8d583e 100644--- a/services/mcp/src/generated/warehouse_sources/api.ts+++ b/services/mcp/src/generated/warehouse_sources/api.ts@@ -1458,13 +1458,15 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),client_secret: zod.string().optional(),account_id: zod.string().optional(),@@ -1513,13 +1515,15 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1556,13 +1560,15 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),@@ -1595,13 +1601,15 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),direct_query_enabled: zod.boolean()@@ -1629,13 +1637,15 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zodcreated_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),direct_query_enabled: zod.boolean()@@ -1688,13 +1698,15 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */created_via: zod.union([zod- .enum(['web', 'api', 'mcp', 'wizard'])- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard'),+ .enum(['web', 'api', 'mcp', 'wizard', 'self_driving'])+ .describe(+ '* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving'+ ),zod.null(),]).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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"),client_secret: zod.string(),account_id: zod.string(),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 57710e6da0b8..712294f16e32 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@@ -10,15 +10,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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": {"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 57710e6da0b8..712294f16e32 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@@ -10,15 +10,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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": {"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 f401dbaed7a1..11c576e13359 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@@ -10,15 +10,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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": {"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 be1715e7deac..65bcba896f0c 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@@ -4,15 +4,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"},"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 be1715e7deac..65bcba896f0c 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@@ -4,15 +4,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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"},"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 57710e6da0b8..712294f16e32 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@@ -10,15 +10,15 @@"created_via": {"anyOf": [{- "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard",- "enum": ["web", "api", "mcp", "wizard"],+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard\n* `self_driving` - self_driving",+ "enum": ["web", "api", "mcp", "wizard", "self_driving"],"type": "string"},{"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 (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"+ "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": {"anyOf": [