OpenAI Codex 代理不可用

Failed after 3 attempts. Last error: Cannot connect to API: 
Serialized Error: {
  reason: 'maxRetriesExceeded',
  errors: [
    {
      stack: 'AI_APICallError: Cannot connect to API: \n' +
        '    at handleFetchError (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:319:14)\n' +
        '    at postToApi (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:2234:11)\n' +
        '    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
        '    at OpenAIResponsesLanguageModel.doGenerate (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+openai@3.0.10_zod@4.1.11/node_modules/@ai-sdk/openai/dist/index.mjs:4317:9)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3833:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at _retryWithExponentialBackoff (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:2233:12)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3787:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at generateText (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3655:12)',
      message: 'Cannot connect to API: ',
      name: 'AI_APICallError',
      cause: [Object],
      url: 'http://localhost:23001/proxy/plugin:openai-codex-auth:openai-codex/v1/responses',
      requestBodyValues: [Object],
      statusCode: undefined,
      responseHeaders: undefined,
      responseBody: undefined,
      isRetryable: true,
      data: undefined,
      constructor: 'Function<APICallError>',
      toString: 'Function<toString>'
    },
    {
      stack: 'AI_APICallError: Cannot connect to API: \n' +
        '    at handleFetchError (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:319:14)\n' +
        '    at postToApi (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:2234:11)\n' +
        '    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
        '    at OpenAIResponsesLanguageModel.doGenerate (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+openai@3.0.10_zod@4.1.11/node_modules/@ai-sdk/openai/dist/index.mjs:4317:9)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3833:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at _retryWithExponentialBackoff (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:2233:12)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3787:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at generateText (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3655:12)',
      message: 'Cannot connect to API: ',
      name: 'AI_APICallError',
      cause: [Object],
      url: 'http://localhost:23001/proxy/plugin:openai-codex-auth:openai-codex/v1/responses',
      requestBodyValues: [Object],
      statusCode: undefined,
      responseHeaders: undefined,
      responseBody: undefined,
      isRetryable: true,
      data: undefined,
      constructor: 'Function<APICallError>',
      toString: 'Function<toString>'
    },
    {
      stack: 'AI_APICallError: Cannot connect to API: \n' +
        '    at handleFetchError (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:319:14)\n' +
        '    at postToApi (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:2234:11)\n' +
        '    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
        '    at OpenAIResponsesLanguageModel.doGenerate (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+openai@3.0.10_zod@4.1.11/node_modules/@ai-sdk/openai/dist/index.mjs:4317:9)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3833:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at _retryWithExponentialBackoff (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:2233:12)\n' +
        '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3787:36)\n' +
        '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
        '    at generateText (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3655:12)',
      message: 'Cannot connect to API: ',
      name: 'AI_APICallError',
      cause: [Object],
      url: 'http://localhost:23001/proxy/plugin:openai-codex-auth:openai-codex/v1/responses',
      requestBodyValues: [Object],
      statusCode: undefined,
      responseHeaders: undefined,
      responseBody: undefined,
      isRetryable: true,
      data: undefined,
      constructor: 'Function<APICallError>',
      toString: 'Function<toString>'
    }
  ],
  lastError: {
    stack: 'AI_APICallError: Cannot connect to API: \n' +
      '    at handleFetchError (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:319:14)\n' +
      '    at postToApi (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+provider-utils@4.0.6_zod@4.1.11/node_modules/@ai-sdk/provider-utils/dist/index.mjs:2234:11)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
      '    at OpenAIResponsesLanguageModel.doGenerate (file:///home/notc/projects/Nia/node_modules/.pnpm/@ai-sdk+openai@3.0.10_zod@4.1.11/node_modules/@ai-sdk/openai/dist/index.mjs:4317:9)\n' +
      '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3833:36)\n' +
      '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
      '    at _retryWithExponentialBackoff (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:2233:12)\n' +
      '    at fn (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3787:36)\n' +
      '    at file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:1974:24\n' +
      '    at generateText (file:///home/notc/projects/Nia/node_modules/.pnpm/ai@6.0.27_zod@4.1.11/node_modules/ai/dist/index.mjs:3655:12)',
    message: 'Cannot connect to API: ',
    name: 'AI_APICallError',
    cause: {
      stack: 'AggregateError: \n' +
        '    at internalConnectMultiple (node:net:1134:18)\n' +
        '    at afterConnectMultiple (node:net:1715:7)',
      errors: [Array],
      code: 'ECONNREFUSED',
      constructor: 'Function<AggregateError>',
      name: 'AggregateError',
      message: '',
      toString: 'Function<toString>'
    },
    url: 'http://localhost:23001/proxy/plugin:openai-codex-auth:openai-codex/v1/responses',
    requestBodyValues: {
      model: 'gpt-5.2',
      input: [Array],
      temperature: undefined,
      top_p: undefined,
      max_output_tokens: undefined,
      conversation: undefined,
      max_tool_calls: undefined,
      metadata: undefined,
      parallel_tool_calls: undefined,
      previous_response_id: undefined,
      store: undefined,
      user: undefined,
      instructions: undefined,
      service_tier: undefined,
      include: undefined,
      prompt_cache_key: undefined,
      prompt_cache_retention: undefined,
      safety_identifier: undefined,
      top_logprobs: undefined,
      truncation: undefined,
      tools: undefined,
      tool_choice: undefined
    },
    statusCode: undefined,
    responseHeaders: undefined,
    responseBody: undefined,
    isRetryable: true,
    data: undefined,
    constructor: 'Function<APICallError>',
    toString: 'Function<toString>'
  }
}

Alma里使用正常

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
🐛

Bug Reports

Date

About 2 months ago

Author

Kano C

Subscribe to post

Get notified by email when there are changes.