diff --git a/src/CodexAcpClient.ts b/src/CodexAcpClient.ts index a47a8cfb..923ecbcf 100644 --- a/src/CodexAcpClient.ts +++ b/src/CodexAcpClient.ts @@ -102,6 +102,9 @@ export class CodexAcpClient { if (!gatewaySettings) throw RequestError.invalidRequest(); const baseUrl = gatewaySettings.baseUrl; + const providerName = typeof gatewaySettings.providerName === "string" && gatewaySettings.providerName.trim().length > 0 + ? gatewaySettings.providerName + : "User-provided gateway"; const headers: Record = { "X-Client-Feature-ID": "codex", ...gatewaySettings.headers @@ -110,7 +113,7 @@ export class CodexAcpClient { this.gatewayConfig = { modelProvider: "custom-gateway", config: { - name: "User-provided gateway", + name: providerName, base_url: baseUrl, http_headers: headers, wire_api: "responses" diff --git a/src/CodexAuthMethod.ts b/src/CodexAuthMethod.ts index 4e5fe2c0..e80f7ff7 100644 --- a/src/CodexAuthMethod.ts +++ b/src/CodexAuthMethod.ts @@ -49,6 +49,7 @@ export interface GatewayAuthRequest extends AuthenticateRequest { "gateway": { baseUrl: string; headers: Record; + providerName?: string; } }; } @@ -59,4 +60,4 @@ export type CodexAuthRequest = ApiKeyAuthRequest | ChatGPTAuthRequest | GatewayA export function isCodexAuthRequest(request: AuthenticateRequest): request is CodexAuthRequest { return request.methodId === "api-key" || request.methodId === "chat-gpt" || request.methodId === "gateway"; -} \ No newline at end of file +}