fix: always populate user-agent (#708)

This commit is contained in:
cthomas
2026-01-27 15:02:01 -08:00
committed by GitHub
parent a426e4bae3
commit edeb344ad9
10 changed files with 45 additions and 49 deletions

View File

@@ -3,6 +3,7 @@
* Unified module for managing custom LLM provider connections
*/
import { getLettaCodeHeaders } from "../agent/http-headers";
import { LETTA_CLOUD_API_URL } from "../auth/oauth";
import { settingsManager } from "../settings-manager";
@@ -113,11 +114,7 @@ async function providersRequest<T>(
const response = await fetch(url, {
method,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
"X-Letta-Source": "letta-code",
},
headers: getLettaCodeHeaders(apiKey),
...(body && { body: JSON.stringify(body) }),
});

View File

@@ -2,6 +2,7 @@
* Direct API calls to Letta for managing MiniMax provider
*/
import { getLettaCodeHeaders } from "../agent/http-headers";
import { LETTA_CLOUD_API_URL } from "../auth/oauth";
import { settingsManager } from "../settings-manager";
@@ -42,11 +43,7 @@ async function providersRequest<T>(
const response = await fetch(url, {
method,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
"X-Letta-Source": "letta-code",
},
headers: getLettaCodeHeaders(apiKey),
...(body && { body: JSON.stringify(body) }),
});

View File

@@ -4,6 +4,7 @@
* (transforms OpenAI API format → ChatGPT backend API format)
*/
import { getLettaCodeHeaders } from "../agent/http-headers";
import { LETTA_CLOUD_API_URL } from "../auth/oauth";
import { settingsManager } from "../settings-manager";
@@ -72,11 +73,7 @@ async function providersRequest<T>(
const response = await fetch(url, {
method,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
"X-Letta-Source": "letta-code",
},
headers: getLettaCodeHeaders(apiKey),
...(body && { body: JSON.stringify(body) }),
});

View File

@@ -2,6 +2,7 @@
* Direct API calls to Letta for managing Zai provider
*/
import { getLettaCodeHeaders } from "../agent/http-headers";
import { LETTA_CLOUD_API_URL } from "../auth/oauth";
import { settingsManager } from "../settings-manager";
@@ -42,11 +43,7 @@ async function providersRequest<T>(
const response = await fetch(url, {
method,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
"X-Letta-Source": "letta-code",
},
headers: getLettaCodeHeaders(apiKey),
...(body && { body: JSON.stringify(body) }),
});