🪢 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
chore(ai-gateway): drop the staging special case for the gateway URL (#19482)
Tobias Wochingerce767a9f1525
diff --git a/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts b/web/src/__tests__/server/ai-gateway-control-plane.servertest.tsindex 39384b0b12..18b65f37ae 100644--- a/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts+++ b/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts@@ -260,7 +260,7 @@ describe("AI gateway control plane", () => {it.each([{productUrl: "https://staging.langfuse.com",- gatewayUrl: "https://staging.langfuse.com",+ gatewayUrl: "https://gateway.staging.langfuse.com/v1",},{productUrl: "http://localhost:3000",diff --git a/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.clienttest.ts b/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.clienttest.tsindex 826aa71aca..0366464ea5 100644--- a/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.clienttest.ts+++ b/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.clienttest.ts@@ -5,12 +5,6 @@ import { describe, expect, it } from "vitest";import { getGatewayBaseUrl } from "@/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl";describe("getGatewayBaseUrl", () => {- it("returns the staging product host that serves the gateway", () => {- expect(getGatewayBaseUrl(new URL("https://staging.langfuse.com/"))).toBe(- "https://staging.langfuse.com",- );- });-it("prefixes gateway. onto a product host", () => {expect(getGatewayBaseUrl(new URL("https://cloud.langfuse.com/"))).toBe("https://gateway.cloud.langfuse.com/v1",diff --git a/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.ts b/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.tsindex 0b4336139f..dc4d0b9bf4 100644--- a/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.ts+++ b/web/src/features/ai-gateway/fns/gatewayUrls/getGatewayBaseUrl.ts@@ -3,9 +3,6 @@ const LOCAL_GATEWAY_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);/** Matches numbered preview hosts that use the certificate-covered gateway hostname. */const PREVIEW_HOST = /^pr-(\d+)\.preview\.langfuse\.com$/;-/** Staging serves the gateway on the product host under `/openai/v1` and `/anthropic`. */-const STAGING_ORIGIN = "https://staging.langfuse.com";-/*** Returns the gateway URL shown to users. A configured `publicUrl` wins and is* returned without trailing slashes; otherwise it is derived from the product URL.@@ -15,10 +12,6 @@ export function getGatewayBaseUrl(productBaseUrl: URL, publicUrl?: string) {return new URL(publicUrl).toString().replace(/\/+$/, "");}- if (productBaseUrl.origin === STAGING_ORIGIN) {- return STAGING_ORIGIN;- }-const gatewayBaseUrl = new URL(productBaseUrl);if (LOCAL_GATEWAY_HOSTS.has(gatewayBaseUrl.hostname)) {diff --git a/web/src/features/ai-gateway/types/agentSetupInstructions.ts b/web/src/features/ai-gateway/types/agentSetupInstructions.tsindex 43bcf06235..2e93bcf4cc 100644--- a/web/src/features/ai-gateway/types/agentSetupInstructions.ts+++ b/web/src/features/ai-gateway/types/agentSetupInstructions.ts@@ -2,7 +2,7 @@ import type { GatewayProvider } from "@/src/features/ai-gateway/types/gatewayPro/** What the snippets are rendered from; the secret key is deliberately not part of it. */export type AgentSetupContext = {- /** Gateway origin without a path, e.g. `https://staging.langfuse.com`. */+ /** Gateway origin without a path, e.g. `https://gateway.staging.langfuse.com`. */gatewayOrigin: string;/** Providers with an enabled connection in the organization. */providers: GatewayProvider[];