◐ Shell
clean mode source ↗

fix(openai_agents): Handle starting_agent keyword argument in runner patches by ericapisani · Pull Request #6428 · getsentry/sentry-python

…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

@ericapisani marked this pull request as ready for review

May 27, 2026 12:51

sentrivana