🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(api): serve the v3 deprecation signal on Cloud only (#16210)
Niklas Semmler27288930b825
diff --git a/web/src/__tests__/server/deprecation-signal.servertest.ts b/web/src/__tests__/server/deprecation-signal.servertest.tsindex a373255e7c..7950f85d0a 100644--- a/web/src/__tests__/server/deprecation-signal.servertest.ts+++ b/web/src/__tests__/server/deprecation-signal.servertest.ts@@ -22,21 +22,12 @@ import {V3_SUNSET_DATE,} from "@/src/features/public-api/server/deprecations";import { OBSERVATIONS_API_V2_DOCS_URL } from "@/src/features/public-api/server/rateLimitUpgradePaths";-import { env } from "@/src/env.mjs";import { randomUUID } from "crypto";-// `_deprecation` injection is gated on LANGFUSE_MIGRATION_V4_ALLOW_PREVIEW_OPT_IN,-// which also enables the events read path (requires ClickHouse >= 25.12). The-// -azure / -redis-cluster CI modes intentionally run older ClickHouse with the-// flag off, so skip there — same pattern as the other events-read-path suites.-const maybeDescribe =- env.LANGFUSE_MIGRATION_V4_ALLOW_PREVIEW_OPT_IN === "true"- ? describe- : describe.skip;-// Legacy (v3-data-model) endpoints attach a top-level `_deprecation`-// object so coding agents get a self-correcting migration signal.-maybeDescribe("public API deprecation signal", () => {+// object so coding agents get a self-correcting migration signal. Cloud-only:+// assumes the server under test sets NEXT_PUBLIC_LANGFUSE_CLOUD_REGION.+describe("public API deprecation signal", () => {let auth: string;let projectId: string;diff --git a/web/src/features/public-api/server/createAuthedProjectAPIRoute.ts b/web/src/features/public-api/server/createAuthedProjectAPIRoute.tsindex b309597578..8c79dae461 100644--- a/web/src/features/public-api/server/createAuthedProjectAPIRoute.ts+++ b/web/src/features/public-api/server/createAuthedProjectAPIRoute.ts@@ -312,13 +312,10 @@ export const createAuthedProjectAPIRoute = <routeConfig: AuthedProjectAPIRouteConfig<TQuery, TBody, TResponse>,): ((req: NextApiRequest, res: NextApiResponse) => Promise<void>) => {return async (req: NextApiRequest, res: NextApiResponse) => {- // Only surface deprecation notices on deployments on (or opting into) v4.- // Self-hosted deployments still on v3 (opt-in unset/false) should not see- // them yet, so gate the injected `_deprecation` on the preview flag.- const deprecation =- env.LANGFUSE_MIGRATION_V4_ALLOW_PREVIEW_OPT_IN === "true"- ? routeConfig.deprecation- : undefined;+ // Cloud-only: the sunset date binds Cloud, not self-hosted deployments.+ const deprecation = env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION+ ? routeConfig.deprecation+ : undefined;// Short-circuit routes that read from legacy traces/observations tables// when the deployment is in events_only mode — those tables are no longerdiff --git a/web/src/features/public-api/server/deprecations.ts b/web/src/features/public-api/server/deprecations.tsindex 3d5dcb9ef8..ca05b02680 100644--- a/web/src/features/public-api/server/deprecations.ts+++ b/web/src/features/public-api/server/deprecations.ts@@ -13,7 +13,7 @@ export const V3_SUNSET_HUMAN = "November 16, 2026";// Shared deprecation reason — references the deprecated Langfuse v3 system// version (not an API version). Customer-facing wording lives here — edit once.-const V3_NOTICE = `Langfuse v3 is deprecated; this endpoint will be removed on ${V3_SUNSET_HUMAN}.`;+const V3_NOTICE = `On Langfuse Cloud, Langfuse v3 is deprecated and this endpoint will be removed on ${V3_SUNSET_HUMAN}.`;// v4 replacement endpoints, referenced by both the message and `replacement`.// Placeholder style matches rateLimitUpgradePaths (<from>, <to>, filters).