close
Skip to content

fix(openai_agents): Handle starting_agent keyword argument in runner patches#6428

Merged
ericapisani merged 1 commit into
masterfrom
py-2498-fix-runner-patch
May 27, 2026
Merged

fix(openai_agents): Handle starting_agent keyword argument in runner patches#6428
ericapisani merged 1 commit into
masterfrom
py-2498-fix-runner-patch

Conversation

@ericapisani
Copy link
Copy Markdown
Member

Runner.run() and Runner.run_streamed() accept starting_agent as either a positional or keyword argument. The patches were always reading args[0], which crashes when the caller uses the keyword form (e.g. Runner.run(starting_agent=agent, input=...)).

Check for the keyword argument first; fall back to the positional arg.

Fixes GH-6418
Fixes PY-2498

…patches

Runner.run() and Runner.run_streamed() accept starting_agent as either a
positional or keyword argument. The patches were always reading args[0], which
crashes when the caller uses the keyword form (e.g. Runner.run(starting_agent=agent, input=...)).

Check for the keyword argument first; fall back to the positional arg.

Fixes GH-6418
Fixes PY-2498
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 27, 2026

PY-2498

@ericapisani ericapisani marked this pull request as ready for review May 27, 2026 12:51
@ericapisani ericapisani requested a review from a team as a code owner May 27, 2026 12:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Codecov Results 📊

67 passed | Total: 67 | Pass Rate: 100% | Execution Time: 4.13s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 15108 uncovered lines.

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/openai_agents/patches/runner.py 0.00% ⚠️ 12 Missing

Generated by Codecov Action

@ericapisani ericapisani merged commit 7bf1d6e into master May 27, 2026
165 of 167 checks passed
@ericapisani ericapisani deleted the py-2498-fix-runner-patch branch May 27, 2026 14:48
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.

OpenAIAgentsIntegration crashes when Runner.run is called with starting_agent kwarg

2 participants