Skip to content

Accept dict run_config in openai_agents Temporal runner - #1739

Merged
DABH merged 5 commits into
mainfrom
openai-agents-dict-run-config
Aug 11, 2026
Merged

Accept dict run_config in openai_agents Temporal runner#1739
DABH merged 5 commits into
mainfrom
openai-agents-dict-run-config

Conversation

@DABH

@DABH DABH commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changed

  • openai-agents >= 0.19.0 (just out of cooldown quarantine) accepts a RunConfig or - now - a plain dict. So CI (pyright) was failing. We update things to ensure valid functionality whether a plain dict or RunConfig is used by a user, and normalize either to a RunConfig. Note we need it to be a RunConfig not a dict so that the plugin correctly wraps the model (by intercepting/overwriting the model config); see below.

Why

See test-latest-deps failure:
https://github.com/temporalio/sdk-python/actions/runs/31451259813

This was also a runtime bug, not just a typing one: on openai-agents >= 0.19,
Runner.run(..., run_config={...}) inside a workflow crashed in our
_prepare_workflow_run with AttributeError: 'dict' object has no attribute 'model' before reaching the agents runner's own coercion.

How tested

CI

@DABH
DABH requested review from a team as code owners August 11, 2026 05:34
Comment thread temporalio/contrib/openai_agents/_openai_runner.py
@DABH
DABH enabled auto-merge (squash) August 11, 2026 06:10
if run_config is None:
run_config = RunConfig()
run_config = (
RunConfig() if run_config is None else _coerce_run_config(run_config)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could move the None check into the function and call it _normalize_run_config() so this is more compact.

@DABH
DABH merged commit c5baec9 into main Aug 11, 2026
29 of 31 checks passed
@DABH
DABH deleted the openai-agents-dict-run-config branch August 11, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants