: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(warehouse_sources): keep Cohere on v1, mark connectors deprecated (#95587)
Tom Owers212bebfab201
diff --git a/.agents/skills/warehouse-source-new-version/SKILL.md b/.agents/skills/warehouse-source-new-version/SKILL.mdindex ff9ae85348d5..2bb1682bebbf 100644--- a/.agents/skills/warehouse-source-new-version/SKILL.md+++ b/.agents/skills/warehouse-source-new-version/SKILL.md@@ -43,6 +43,12 @@ Add it when any of these hold:"Nothing changed" needs the same docs evidence as a divergence. An unread changelog is not a clean diff.+Run that diff against the new version's own reference page for each endpoint this source reads, not against the+changelog or the docs URL. A vendor's new generation often covers only part of its product surface, so its v2 docs+section keeps printing v1 request lines for everything v2 never replaced; a source that reads only the untouched part+gets no new version at all. For the same reason, a dated announcement that retires individual endpoints is not a+version sunset - confirm the version itself stops being served before deprecating it or writing a repin.+## Adding a new version, step by step1. **Read the vendor's changelog** (the source's `api_docs_url`) and list what changed between the currently supported version(s) and the new one: renamed/removed fields, changed pagination, new required headers, changed webhook payloads, or a field the source reads becoming opt-in behind a new query parameter (a field returned by default in the old version now empty unless requested — restore it by adding that parameter on the new version's request path). Verification is docs-only — there are no stored credentials and no live-sync harness, so the docs are the sole source of truth for what each version serves. When the vendor's docs page renders client-side and comes back as an empty shell, read its machine-readable mirror (an `llms.txt`, a `sitemap.md`, or the same path with a `.md` suffix) rather than treating the version as undocumented. This is also the evidence the gate above runs on.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/canonical_descriptions.pyindex 61c6fecde471..920ea4745129 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/canonical_descriptions.py@@ -26,7 +26,11 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {},},"connectors": {- "description": "A connector that lets Cohere's chat models retrieve documents from an external data source.",+ "description": (+ "A connector that lets Cohere's chat models retrieve documents from an external data source. "+ "Cohere deprecated connectors on September 15, 2025 and closed them to new accounts, so only "+ "accounts that already used connectors can sync this table."+ ),"docs_url": "https://docs.cohere.com/reference/list-connectors","columns": {"id": "Unique identifier for the connector.",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/cohere.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/cohere.pyindex da028f34724a..6714ea853edc 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/cohere.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/cohere.py@@ -19,8 +19,14 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.resfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.source_helpers import validate_via_probefrom products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceResponse+# Cohere versions its API in the URL path. Every list endpoint this source reads is served at+# /v1/; Cohere's v2 generation covers the inference surface only (/v2/chat, /v2/embed, /v2/rerank),+# which this source does not touch. The source-level version label is bound to this constant so a+# declared version can never drift from the path the requests actually use.+COHERE_API_VERSION_V1 = "v1"+# Cohere serves a single global API host; there are no regional variants.-COHERE_BASE_URL = "https://api.cohere.com/v1"+COHERE_BASE_URL = f"https://api.cohere.com/{COHERE_API_VERSION_V1}"def _headers() -> dict[str, str]:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/source.pyindex 3470ef1e672a..41e770e65768 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/source.py@@ -10,6 +10,7 @@ from posthog.schema import ()from products.warehouse_sources.backend.temporal.data_imports.sources.cohere.cohere import (+ COHERE_API_VERSION_V1,cohere_source,validate_credentials as validate_cohere_credentials,)@@ -28,8 +29,13 @@ from products.warehouse_sources.backend.types import ExternalDataSourceType@SourceRegistry.registerclass CohereSource(SimpleSource[CohereSourceConfig]):lists_tables_without_credentials = True # static endpoint catalog — safe for public docs- supported_versions = ("v1",)- default_version = "v1"+ # Cohere's v2 generation adds no route for anything this source reads: its own v2 reference+ # documents datasets, models, finetuned models, and embed jobs at /v1/ paths, and connectors has+ # no v2 successor at all. A "v2" pin would therefore name a wire Cohere does not serve for these+ # tables. v1 is not sunset either - the 2025-09-15 announcement retires individual endpoints+ # (/v1/connectors here), not the version - so v1 stays supported and undeprecated.+ supported_versions = (COHERE_API_VERSION_V1,)+ default_version = COHERE_API_VERSION_V1api_docs_url = "https://docs.cohere.com/reference/about"@propertydiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/tests/test_cohere_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/tests/test_cohere_source.pyindex 0ee7734a9bdc..91768a7efd99 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/tests/test_cohere_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cohere/tests/test_cohere_source.py@@ -3,6 +3,10 @@ from unittest.mock import patchfrom parameterized import parameterizedfrom products.warehouse_sources.backend.temporal.data_imports.sources.cohere import source as source_module+from products.warehouse_sources.backend.temporal.data_imports.sources.cohere.cohere import (+ COHERE_API_VERSION_V1,+ COHERE_BASE_URL,+)from products.warehouse_sources.backend.temporal.data_imports.sources.cohere.settings import ENDPOINTSfrom products.warehouse_sources.backend.temporal.data_imports.sources.cohere.source import CohereSourcefrom products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs.cohere import CohereSourceConfig@@ -35,6 +39,17 @@ class TestCohereSourceClass:assert self.source.lists_tables_without_credentials is Trueassert {t["name"] for t in self.source.get_documented_tables()} == set(ENDPOINTS)+ def test_declares_only_the_api_version_its_requests_use(self) -> None:+ # Cohere's v2 generation serves the inference surface only, and every list endpoint this+ # source reads stays on /v1/. Declaring a version the request layer never builds would pin+ # customers to a wire Cohere does not serve for these tables, so the declaration is bound to+ # the same constant the base URL is built from. v1 is not sunset - the 2025-09-15+ # announcement retires individual endpoints, not the version - so nothing is deprecated.+ assert self.source.supported_versions == (COHERE_API_VERSION_V1,)+ assert self.source.default_version == COHERE_API_VERSION_V1+ assert self.source.deprecated_versions == ()+ assert COHERE_BASE_URL == f"https://api.cohere.com/{COHERE_API_VERSION_V1}"+def test_validate_credentials_success(self) -> None:with patch.object(source_module, "validate_cohere_credentials", return_value=True):assert self.source.validate_credentials(_config(), self.team_id) == (True, None)