Skip to content

ref(openai-agents): Deduplicate request model lookup - #7461

Open
tiagovilasboas wants to merge 1 commit into
getsentry:masterfrom
tiagovilasboas:cursor/dedupe-openai-agents-model-830c
Open

ref(openai-agents): Deduplicate request model lookup#7461
tiagovilasboas wants to merge 1 commit into
getsentry:masterfrom
tiagovilasboas:cursor/dedupe-openai-agents-model-830c

Conversation

@tiagovilasboas

Copy link
Copy Markdown

Description

The openai-agents integration resolved the request model name in two places (spans/ai_client.py and utils.py) with the same precedence: agent.model (Model instance or string) over _sentry_request_model.

This extracts that lookup into _get_request_model_name() and uses it from both call sites so the precedence cannot drift. Scope is dedupe only — no intended behavior change.

Issues

Reminders

Extract shared agent/request model resolution into one helper and
reuse it from the AI client span and agent-data call sites.

Co-authored-by: Tiago Vilas Boas <tcarvalhovb@gmail.com>
@tiagovilasboas

Copy link
Copy Markdown
Author

Hi — first-time contributor here. Could a maintainer please approve and run the pending workflows when you have a moment? Thanks!

@tiagovilasboas
tiagovilasboas marked this pull request as ready for review September 10, 2026 23:27
@tiagovilasboas
tiagovilasboas requested a review from a team as a code owner September 10, 2026 23:27
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.

Deduplicate logic for getting request model in openai-agents

1 participant