Skip to content

[Bug] _TemporalModelStub.get_response incompatible with latest openai-agents-python (conversation_id kwarg) #1091

@nikhil-pandey

Description

@nikhil-pandey

What are you really trying to do?

Use the Temporal Python SDK’s openai agents integration with the latest openai-agents python library to run agents.

Describe the bug

When running a workflow _TemporalModelStub.get_response, raises a TypeError because the method signature does not accept the new conversation_id argument recently added upstream in openai-agents-python.

Error trace:

TypeError: _TemporalModelStub.get_response() got an unexpected keyword argument 'conversation_id'

/.venv/lib/python3.13/site-packages/agents/run.py", line 1398, in _get_new_response
    new_response = await model.get_response(
        system_instructions=filtered.instructions,
        prompt=prompt_config,
        conversation_id=conversation_id,
    )
    ^

Upstream change that introduced this parameter:

Minimal Reproduction

  1. Install the latest openai-agents python (post conversations API support).
  2. Run a sample agents workflow.
  3. Observe TypeError.

Relevant code in SDK:
[_temporal_model_stub.py#L60](https://github.com/temporalio/sdk-python/blob/44f0c42fa8b0d48c2d13bb9b238023eb983dc07f/temporalio/contrib/openai_agents/_temporal_model_stub.py#L60)

Environment/Versions

  • OS and processor: e.g. macOS 14.5 (M1)
  • Python version: 3.13
  • Temporal SDK version: 1.4.1
  • **OpenAI Agents Python version: >0.2.10. (conversation_id was added in 0.2.10)

Additional context

This bug was introduced due to drift between the Temporal stub and the upstream openai-agents python model interface.

Possible fixes:

  • Update _TemporalModelStub.get_response to accept conversation_id: Optional[str] = None.
  • Consider adding **kwargs passthrough to reduce future breakage.

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