Skip to content

Azure OpenAI: TypeError: Cannot use 'in' operator to search for 'tool_calls' in undefined #1077

@lazorfuzz

Description

@lazorfuzz

What version of Codex is running?

0.1.2505172129

Which model were you using?

o3

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

Using Azure OpenAI with the o3 model crashes after the first input and first response.
Consistently crashing with this error after the first input:
TypeError: Cannot use 'in' operator to search for 'tool_calls' in undefined

What is the expected behavior?

Expecting it to not throw

What do you see instead?

TypeError: Cannot use 'in' operator to search for 'tool_calls' in undefined
    at $ze (file:///Users/leonli/workspace/codex/codex-cli/dist/cli.js:425:7661)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Iy.run (file:///Users/leonli/workspace/codex/codex-cli/dist/cli.js:599:2785)

Additional information

~/.codex/config.json

{
  "model": "o3",
  "providers": {
    "azure": {
      "name": "AzureOpenAI",
      "baseURL": "https://myhost.openai.azure.com/openai",
      "envKey": "AZURE_OPENAI_API_KEY"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions