Skip to content

OpenAIAgentsIntegration crashes when Runner.run is called with starting_agent kwarg #6418

@guadalupe-duolingo

Description

@guadalupe-duolingo

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.53.0

Steps to Reproduce

  1. Initialize Sentry with OpenAIAgentsIntegration enabled

  2. Call OpenAI Agents SDK Runner.run with the agent passed as the documented keyword argument:

from agents import Agent, Runner

agent = Agent(name="test", instructions="Be concise.")

await Runner.run(
    starting_agent=agent,
    input="hello",
)

### Expected Result


`OpenAIAgentsIntegration` should support valid `Runner.run` call shapes where the starting agent is passed by keyword:

Runner.run(starting_agent=agent, input=input, ...)

Actual Result

The integration crashes with:

IndexError: tuple index out of range

on this line

# sentry_sdk/integrations/openai_agents/patches/runner.py
agent = args[0].clone()

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions