Skip to content

TypeError object of type 'Omit' has no len() #2007

@browniebroke

Description

@browniebroke

Please read this first

  • Have you read the docs?Agents SDK docs
  • Have you searched for related issues? Others may have faced similar issues.

Describe the bug

After upgrading from openai-agents from 0.1.0 to 0.4.1, we got this error in production. We didn't observe this error on our staging or development environments and even after the fact we're unable to reproduce.

This happens when calling await Runner.run(agent, ...) and the stack trace points to this line:

ret = await self._get_client().chat.completions.create(

So my best guess is that it's somewhat related to:

As the NotGiven was changed to Omit but several arguments were changed, so it's a bit tricky to track which one causes an issue.

Debug information

  • Agents SDK version: 0.4.1
  • OpenAI version: 2.6.0
  • Python version 3.13.9

Repro steps

I can't reproduce outside of our production environment yet, but I'm still investigating. We also use Datadog for observability (ddtrace 3.16.1), and it's typically not installed in the dev environment, so I'm suspecting that it might patch something in a weird way causing that.

Has anyone else encountered this error?

Expected behavior

No error when calling the runner.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions