fix(coding-agent): remove Vercel AI Gateway attribution

This commit is contained in:
Vegard Stikbakke
2026-07-03 15:14:01 +02:00
parent 4a9c962b59
commit 83cbfc6521
3 changed files with 4 additions and 19 deletions
+4
View File
@@ -17,6 +17,10 @@
- Fixed custom session entries appended during assistant streaming to render before the live assistant message, matching persisted session order.
- Fixed oversized bash tool timeouts to fail with a clear validation error instead of being clamped to an immediate timeout ([#6181](https://github.com/earendil-works/pi/issues/6181)).
### Removed
- Removed default attribution headers from Vercel AI Gateway requests.
## [0.80.3] - 2026-06-30
### New Features
@@ -7,7 +7,6 @@ const NVIDIA_NIM_HOST = "integrate.api.nvidia.com";
const CLOUDFLARE_API_HOST = "api.cloudflare.com";
const CLOUDFLARE_AI_GATEWAY_HOST = "gateway.ai.cloudflare.com";
const OPENCODE_HOST = "opencode.ai";
const VERCEL_GATEWAY_HOST = "ai-gateway.vercel.sh";
function matchesHost(baseUrl: string, expectedHost: string): boolean {
try {
@@ -34,10 +33,6 @@ function isCloudflareModel(model: Model<Api>): boolean {
);
}
function isVercelGatewayModel(model: Model<Api>): boolean {
return model.provider === "vercel-ai-gateway" || matchesHost(model.baseUrl, VERCEL_GATEWAY_HOST);
}
function getDefaultAttributionHeaders(
model: Model<Api>,
settingsManager: SettingsManager,
@@ -66,13 +61,6 @@ function getDefaultAttributionHeaders(
};
}
if (isVercelGatewayModel(model)) {
return {
"http-referer": "https://pi.dev",
"x-title": "pi",
};
}
return undefined;
}
@@ -197,13 +197,6 @@ describe("createAgentSession provider attribution headers", () => {
expect(headers?.["X-OpenRouter-Categories"]).toBe("provider-category");
});
it("adds default attribution headers for Vercel AI Gateway models", async () => {
const headers = await captureHeaders(createModel("vercel-ai-gateway", "https://ai-gateway.vercel.sh/v1"));
expect(headers?.["http-referer"]).toBe("https://pi.dev");
expect(headers?.["x-title"]).toBe("pi");
});
it("adds default attribution headers for direct NVIDIA NIM endpoints", async () => {
const headers = await captureHeaders(createModel("custom-nim", "https://integrate.api.nvidia.com/v1"));