Skip to content

Commit e1d6a71

Browse files
authored
Fix/provider name (#102)
* Pass gateway provider name through to Codex config * Allow providerName in gateway auth request metadata
1 parent aada83f commit e1d6a71

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/CodexAcpClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export class CodexAcpClient {
102102
if (!gatewaySettings) throw RequestError.invalidRequest();
103103

104104
const baseUrl = gatewaySettings.baseUrl;
105+
const providerName = typeof gatewaySettings.providerName === "string" && gatewaySettings.providerName.trim().length > 0
106+
? gatewaySettings.providerName
107+
: "User-provided gateway";
105108
const headers: Record<string, string> = {
106109
"X-Client-Feature-ID": "codex",
107110
...gatewaySettings.headers
@@ -110,7 +113,7 @@ export class CodexAcpClient {
110113
this.gatewayConfig = {
111114
modelProvider: "custom-gateway",
112115
config: {
113-
name: "User-provided gateway",
116+
name: providerName,
114117
base_url: baseUrl,
115118
http_headers: headers,
116119
wire_api: "responses"

src/CodexAuthMethod.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface GatewayAuthRequest extends AuthenticateRequest {
4949
"gateway": {
5050
baseUrl: string;
5151
headers: Record<string, string>;
52+
providerName?: string;
5253
}
5354
};
5455
}
@@ -59,4 +60,4 @@ export type CodexAuthRequest = ApiKeyAuthRequest | ChatGPTAuthRequest | GatewayA
5960

6061
export function isCodexAuthRequest(request: AuthenticateRequest): request is CodexAuthRequest {
6162
return request.methodId === "api-key" || request.methodId === "chat-gpt" || request.methodId === "gateway";
62-
}
63+
}

0 commit comments

Comments
 (0)