Skip to content

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

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

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

@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
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>
@cursor
cursor Bot force-pushed the cursor/dedupe-openai-agents-model-830c branch from e8161c5 to a6eee82 Compare September 15, 2026 19:29
@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Closing this because we won't set gen_ai.request.model in _set_agent_data() in the major anyway.

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

2 participants