Not planned
Description
Hi everyone,
I'm having an issue with PyCharm 2025.1.1 not correctly recognizing arguments for Agent when using openai-agents==0.0.15 on Python 3.13.3.
The Problem:
PyCharm flags valid parameters like name, instructions, model, tools, etc., with warnings (yellow squiggles) and doesn't provide any auto-suggestions or parameter info for them.
Key Details:
- The code runs perfectly fine. This seems to be purely an IDE static analysis/code intelligence issue.
- The problem persists even in a brand new, minimal project with only openai-agents installed.
- Navigating to the Agent class (Ctrl+Click) works and shows it's a @DataClass.
- PyCharm caches have been invalidated multiple times.
Environment:
- openai-agents version: 0.0.15
- Python version: 3.13.3
- IDE: PyCharm 2025.1.1
Has anyone else experienced this or have any ideas what might be causing PyCharm to struggle with the Agent dataclass definition or how to get auto-suggestions working? Any tips would be appreciated!
Thanks!

Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
hudson155 commentedon May 21, 2025
Having this issue too
hettiger commentedon May 23, 2025
That seems to happen, because Agent is generic. I don't use a context in my app right now. Therefore, I've added a custom agent base class as follows:
This defines the
Generic[TContext]
to be of typeNone
and makes PyCharm happy.I'm running on
0.0.16
I think this is not a ideal solution. It would be awesome to see this fixed so my workaround is no longer needed.
masfernandez commentedon May 24, 2025
Thanks for sharing it @hettiger, it works very well. I was just begining to learning the SDK at the moment and for me it is a great help.
There is an example on the page https://openai.github.io/openai-agents-python/context/ with a
UserInfo
context and it seems that PyCharm also marks it as a warning (quite annoying).hettiger commentedon May 24, 2025
Yes, that's unfortunate @masfernandez
Hopefully, we'll get improved docs or implementation is updated so this works without some extra tricks you have to come up with.
github-actions commentedon Jun 1, 2025
This issue is stale because it has been open for 7 days with no activity.
davidheryanto commentedon Jun 5, 2025
I believe this is the related issue
https://youtrack.jetbrains.com/issue/PY-78250/Generic-dataclasses-dont-work-with-TypeVar-when-it-has-a-default-value
I tried installing PyCharm 2025.2 EAP, the warning is no longer there.
masfernandez commentedon Jun 5, 2025
I'll keep an eye on it. Thanks for sharing @davidheryanto
github-actions commentedon Jun 13, 2025
This issue is stale because it has been open for 7 days with no activity.
github-actions commentedon Jun 16, 2025
This issue was closed because it has been inactive for 3 days since being marked as stale.