[GH-ISSUE #317] openai-codex-oauth 看起来没有通过代理访问 #227

Closed
opened 2026-02-27 07:18:34 +03:00 by kerem · 1 comment
Owner

Originally created by @v2up-32mb on GitHub (Feb 10, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/317

Image

已经在配置管理中设置了OpenAI Codex OAuth使用代理,保存配置后立即查看日志:

[2026-02-10 15:25:09.503] [Req:fdc090cd] [INFO] [Initialization] Initializing 2 node(s) for provider 'gemini-cli-oauth'...
[2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: 1b12ba47-0839-4572-92c3-bf9ac4828889
[2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890
[2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Gemini] Using proxy for OAuth2Client
[2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890
[2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] ✓ Initialized node: 1b12ba47-0839-4572-92c3-bf9ac4828889
[2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: 7f760522-dbd7-408b-967c-289b3ab927d5
[2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Gemini] Using proxy for OAuth2Client
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] ✓ Initialized node: 7f760522-dbd7-408b-967c-289b3ab927d5
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Initialization] Initializing 1 node(s) for provider 'openai-codex-oauth'...
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: openai-codex-oauth, uuid: 1f93eb21-c571-4496-b80e-451eb263726e
[2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] ✓ Initialized node: 1f93eb21-c571-4496-b80e-451eb263726e
[2026-02-10 15:25:09.507] [Req:fdc090cd] [INFO] [Initialization] Provider pool initialization complete: 8 succeeded, 0 failed.
.........
[2026-02-10 15:25:14.399] [Req:941655e7] [INFO] [Codex] Initializing Codex API Service...
[2026-02-10 15:25:14.402] [Req:941655e7] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737114402, 20 minutes from now: 1770738314402, Is near expiry: false
[2026-02-10 15:25:14.402] [Req:941655e7] [INFO] [Codex] Initialized with account: ****@outlook.com
[2026-02-10 15:25:14.403] [Req:941655e7] [INFO] [Codex] Initialization complete. Account: ****@outlook.com
[2026-02-10 15:25:14.403] [Req:941655e7] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737114403, 20 minutes from now: 1770738314403, Is near expiry: false

日志中可以看到openai-codex-oauth并没有像gemini-cli-oauth一样的使用代理的信息,我的Clash日志中也没有访问日志。
使用curl测试模型也报错:

curl http://192.168.4.50:3000/openai-codex-oauth/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.1-codex",
    "messages": [{"role": "user", "content": "你好!"}],
    "stream": false
  }'

错误:

{"error":{"message":"An error occurred during processing.","type":"invalid_request_error","code":"invalid_request_error"}}

控制台的日志:

[2026-02-10 15:33:45.741] [Req:b9575238] [INFO] [Server] Received request: POST http://192.168.4.50:3000/openai-codex-oauth/v1/chat/completions
[2026-02-10 15:33:45.741] [Req:b9575238] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: openai-codex-oauth
[2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [ProviderPoolManager] [Concurrency Control] Atomic selection: 1f93eb21-c571-4496-b80e-451eb263726e (Seq: 1)
[2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [API Service] Using pooled configuration for openai-codex-oauth: 1f93eb21-c571-4496-b80e-451eb263726e
[2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [Adapter] getServiceAdapter, provider: openai-codex-oauth, uuid: 1f93eb21-c571-4496-b80e-451eb263726e
[2026-02-10 15:33:45.743] [Req:b9575238] [INFO] [Content Generation] Model: gpt-5.1-codex, Stream: false
[2026-02-10 15:33:45.743] [Req:b9575238] [INFO] [Request Convert] Converting request from openai to openai-codex-oauth
[2026-02-10 15:33:45.744] [Req:b9575238] [INFO] [Codex] Initializing Codex API Service...
[2026-02-10 15:33:45.745] [Req:b9575238] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737625745, 20 minutes from now: 1770738825745, Is near expiry: false
[2026-02-10 15:33:45.745] [Req:b9575238] [INFO] [Codex] Initialized with account: ****@outlook.com
[2026-02-10 15:33:45.746] [Req:b9575238] [INFO] [Codex] Initialization complete. Account: ****@outlook.com
[2026-02-10 15:33:45.746] [Req:b9575238] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737625746, 20 minutes from now: 1770738825746, Is near expiry: false
[2026-02-10 15:33:46.009] [Req:b9575238] [ERROR] [Server] Error during unary processing: AggregateError 
        at AxiosError.from (file:///app/node_modules/axios/lib/core/AxiosError.js:92:14) 
        at RedirectableRequest.handleRequestError (file:///app/node_modules/axios/lib/adapters/http.js:620:25) 
        at RedirectableRequest.emit (node:events:536:35) 
        at eventHandlers.<computed> (/app/node_modules/follow-redirects/index.js:49:24) 
        at ClientRequest.emit (node:events:524:28) 
        at emitErrorEvent (node:_http_client:101:11) 
        at TLSSocket.socketErrorListener (node:_http_client:504:5) 
        at TLSSocket.emit (node:events:524:28) 
        at emitErrorNT (node:internal/streams/destroy:169:8) 
        at emitErrorCloseNT (node:internal/streams/destroy:128:3) 
        at Axios.request (file:///app/node_modules/axios/lib/core/Axios.js:45:41) 
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 
        at async CodexApiService.generateContent (file:///app/src/providers/openai/codex-core.js:166:30) 
        at async handleUnaryRequest (file:///app/src/utils/common.js:643:32) 
        at async handleContentGenerationRequest (file:///app/src/utils/common.js:931:9) 
        at async handleAPIRequests (file:///app/src/services/api-manager.js:39:13) 
        at async Server.requestHandler (file:///app/src/handlers/request-handler.js:244:32)
[2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] >>> Req Protocol: openai -> openai-codex-oauth | Model: gpt-5.1-codex
[2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] [Req Original]: {"model":"gpt-5.1-codex","messages":[{"role":"user","content":"你好!"}],"stream":false,"_monitorRequestId":"1770737625742omkyzndx"}
[2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] [Req Processed]: {"model":"gpt-5.1-codex","instructions":"","input":[{"type":"message","role":"user","content":[{"type":"input_text","text":"你好!"}]}],"stream":true,"store":false,"reasoning":{"effort":"medium","summary":"auto"},"parallel_tool_calls":true,"include":["reasoning.encrypted_content"]}
[2026-02-10 15:33:46.747] [INFO] [ProviderPoolManager] configs/provider_pools.json updated successfully for types: openai-codex-oauth
Originally created by @v2up-32mb on GitHub (Feb 10, 2026). Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/317 <img width="818" height="516" alt="Image" src="https://github.com/user-attachments/assets/a9d825a4-1470-4be1-8f99-ba40808da643" /> 已经在**配置管理**中设置了`OpenAI Codex OAuth`使用代理,保存配置后立即查看日志: ``` [2026-02-10 15:25:09.503] [Req:fdc090cd] [INFO] [Initialization] Initializing 2 node(s) for provider 'gemini-cli-oauth'... [2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: 1b12ba47-0839-4572-92c3-bf9ac4828889 [2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890 [2026-02-10 15:25:09.504] [Req:fdc090cd] [INFO] [Gemini] Using proxy for OAuth2Client [2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890 [2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] ✓ Initialized node: 1b12ba47-0839-4572-92c3-bf9ac4828889 [2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: 7f760522-dbd7-408b-967c-289b3ab927d5 [2026-02-10 15:25:09.505] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890 [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Gemini] Using proxy for OAuth2Client [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Proxy] Using http proxy for gemini-cli-oauth: http://192.168.4.1:7890 [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] ✓ Initialized node: 7f760522-dbd7-408b-967c-289b3ab927d5 [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Initialization] Initializing 1 node(s) for provider 'openai-codex-oauth'... [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] [Adapter] getServiceAdapter, provider: openai-codex-oauth, uuid: 1f93eb21-c571-4496-b80e-451eb263726e [2026-02-10 15:25:09.506] [Req:fdc090cd] [INFO] ✓ Initialized node: 1f93eb21-c571-4496-b80e-451eb263726e [2026-02-10 15:25:09.507] [Req:fdc090cd] [INFO] [Initialization] Provider pool initialization complete: 8 succeeded, 0 failed. ......... [2026-02-10 15:25:14.399] [Req:941655e7] [INFO] [Codex] Initializing Codex API Service... [2026-02-10 15:25:14.402] [Req:941655e7] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737114402, 20 minutes from now: 1770738314402, Is near expiry: false [2026-02-10 15:25:14.402] [Req:941655e7] [INFO] [Codex] Initialized with account: ****@outlook.com [2026-02-10 15:25:14.403] [Req:941655e7] [INFO] [Codex] Initialization complete. Account: ****@outlook.com [2026-02-10 15:25:14.403] [Req:941655e7] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737114403, 20 minutes from now: 1770738314403, Is near expiry: false ``` 日志中可以看到`openai-codex-oauth`并没有像`gemini-cli-oauth`一样的使用代理的信息,我的Clash日志中也没有访问日志。 使用curl测试模型也报错: ```bash curl http://192.168.4.50:3000/openai-codex-oauth/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-5.1-codex", "messages": [{"role": "user", "content": "你好!"}], "stream": false }' ``` 错误: ```json {"error":{"message":"An error occurred during processing.","type":"invalid_request_error","code":"invalid_request_error"}} ``` 控制台的日志: ``` [2026-02-10 15:33:45.741] [Req:b9575238] [INFO] [Server] Received request: POST http://192.168.4.50:3000/openai-codex-oauth/v1/chat/completions [2026-02-10 15:33:45.741] [Req:b9575238] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: openai-codex-oauth [2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [ProviderPoolManager] [Concurrency Control] Atomic selection: 1f93eb21-c571-4496-b80e-451eb263726e (Seq: 1) [2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [API Service] Using pooled configuration for openai-codex-oauth: 1f93eb21-c571-4496-b80e-451eb263726e [2026-02-10 15:33:45.742] [Req:b9575238] [INFO] [Adapter] getServiceAdapter, provider: openai-codex-oauth, uuid: 1f93eb21-c571-4496-b80e-451eb263726e [2026-02-10 15:33:45.743] [Req:b9575238] [INFO] [Content Generation] Model: gpt-5.1-codex, Stream: false [2026-02-10 15:33:45.743] [Req:b9575238] [INFO] [Request Convert] Converting request from openai to openai-codex-oauth [2026-02-10 15:33:45.744] [Req:b9575238] [INFO] [Codex] Initializing Codex API Service... [2026-02-10 15:33:45.745] [Req:b9575238] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737625745, 20 minutes from now: 1770738825745, Is near expiry: false [2026-02-10 15:33:45.745] [Req:b9575238] [INFO] [Codex] Initialized with account: ****@outlook.com [2026-02-10 15:33:45.746] [Req:b9575238] [INFO] [Codex] Initialization complete. Account: ****@outlook.com [2026-02-10 15:33:45.746] [Req:b9575238] [INFO] [Codex] Checking expiry date | Expiry date: 1771600651724, Current time: 1770737625746, 20 minutes from now: 1770738825746, Is near expiry: false [2026-02-10 15:33:46.009] [Req:b9575238] [ERROR] [Server] Error during unary processing: AggregateError at AxiosError.from (file:///app/node_modules/axios/lib/core/AxiosError.js:92:14) at RedirectableRequest.handleRequestError (file:///app/node_modules/axios/lib/adapters/http.js:620:25) at RedirectableRequest.emit (node:events:536:35) at eventHandlers.<computed> (/app/node_modules/follow-redirects/index.js:49:24) at ClientRequest.emit (node:events:524:28) at emitErrorEvent (node:_http_client:101:11) at TLSSocket.socketErrorListener (node:_http_client:504:5) at TLSSocket.emit (node:events:524:28) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) at Axios.request (file:///app/node_modules/axios/lib/core/Axios.js:45:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async CodexApiService.generateContent (file:///app/src/providers/openai/codex-core.js:166:30) at async handleUnaryRequest (file:///app/src/utils/common.js:643:32) at async handleContentGenerationRequest (file:///app/src/utils/common.js:931:9) at async handleAPIRequests (file:///app/src/services/api-manager.js:39:13) at async Server.requestHandler (file:///app/src/handlers/request-handler.js:244:32) [2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] >>> Req Protocol: openai -> openai-codex-oauth | Model: gpt-5.1-codex [2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] [Req Original]: {"model":"gpt-5.1-codex","messages":[{"role":"user","content":"你好!"}],"stream":false,"_monitorRequestId":"1770737625742omkyzndx"} [2026-02-10 15:33:46.012] [INFO] [AI Monitor][1770737625742omkyzndx] [Req Processed]: {"model":"gpt-5.1-codex","instructions":"","input":[{"type":"message","role":"user","content":[{"type":"input_text","text":"你好!"}]}],"stream":true,"store":false,"reasoning":{"effort":"medium","summary":"auto"},"parallel_tool_calls":true,"include":["reasoning.encrypted_content"]} [2026-02-10 15:33:46.747] [INFO] [ProviderPoolManager] configs/provider_pools.json updated successfully for types: openai-codex-oauth ```
kerem closed this issue 2026-02-27 07:18:34 +03:00
Author
Owner

@justlovemaki commented on GitHub (Feb 11, 2026):

最新版已修复

<!-- gh-comment-id:3881905662 --> @justlovemaki commented on GitHub (Feb 11, 2026): 最新版已修复
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#227
No description provided.