René's URL Explorer Experiment


Title: fix(openai-agents): also emit spans for MCP tool calls done by the LLM by constantinius · Pull Request #4875 · getsentry/sentry-python · GitHub

Open Graph Title: fix(openai-agents): also emit spans for MCP tool calls done by the LLM by constantinius · Pull Request #4875 · getsentry/sentry-python

X Title: fix(openai-agents): also emit spans for MCP tool calls done by the LLM by constantinius · Pull Request #4875 · getsentry/sentry-python

Description: Description We cannot directly intercept MCP Tool calls, as they are done remotely by the LLM and not in the Agent itself. However, we see when such a tool call took place, so we can emit a zero-length span with the tool call specifics. It will start at the same time as the parent span. Closes https://linear.app/getsentry/issue/TET-1192/openai-agents-hosted-mcp-calls-cannot-be-wrapped-in-an-execute-tool NoteEmit execute_tool spans for MCP tool calls detected in agent results, with tool metadata, input/output (PII-gated), and error status. Tracing/Spans (openai_agents): Add utils._create_mcp_execute_tool_spans to emit OP.GEN_AI_EXECUTE_TOOL spans for MCP tool calls (McpCall) found in result.output. Sets GEN_AI_TOOL_TYPE=mcp, GEN_AI_TOOL_NAME, propagates input/output when PII allowed, and marks SPANSTATUS.ERROR on error. Spans start at the parent span's start time (zero-length representation of remote call). Wire into spans/ai_client.update_ai_client_span to create these tool spans after setting usage/input/output data. Update imports to include SPANSTATUS and OP. Written by Cursor Bugbot for commit 96df8c1. This will update automatically on new commits. Configure here.

Open Graph Description: Description We cannot directly intercept MCP Tool calls, as they are done remotely by the LLM and not in the Agent itself. However, we see when such a tool call took place, so we can emit a zero-le...

X Description: Description We cannot directly intercept MCP Tool calls, as they are done remotely by the LLM and not in the Agent itself. However, we see when such a tool call took place, so we can emit a zero-le...

Opengraph URL: https://github.com/getsentry/sentry-python/pull/4875

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:966ee4a3-65f4-0783-de70-d745988338e7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCB94:2EF3:370684:49E888:6B008A78
html-safe-nonce77d3613efce57095b49561215f639cd86138a30f58266ac8d1704506596ae8a5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjk0OjJFRjM6MzcwNjg0OjQ5RTg4ODo2QjAwOEE3OCIsInZpc2l0b3JfaWQiOiI1MTcxMTA2Njc0NDYyNzIyNjgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac74f1b568daa85d4f01f4f6a9a2f4cbd9f650c8ed12ee64284cf2220c5a640a14
hovercard-subject-tagpull_request:2873620344
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/getsentry/sentry-python/pull/4875/files
twitter:imagehttps://avatars.githubusercontent.com/u/1109799?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1109799?s=400&v=4
og:image:altDescription We cannot directly intercept MCP Tool calls, as they are done remotely by the LLM and not in the Agent itself. However, we see when such a tool call took place, so we can emit a zero-le...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedb758f8e02b8257935fb03edf81a3e76eb3abd11
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/pull/4875/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fpull%2F4875%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fpull%2F4875%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/pull/4875/files
Reloadhttps://github.com/getsentry/sentry-python/pull/4875/files
Reloadhttps://github.com/getsentry/sentry-python/pull/4875/files
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests41 (41)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgetsentry%2Fsentry-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgetsentry%2Fsentry-python%2Fissues%2Fnew%2Fchoose
constantiniushttps://github.com/constantinius
masterhttps://github.com/getsentry/sentry-python/tree/master
constantinius/fix/openai-agents/mcp-execute-tool-spanshttps://github.com/getsentry/sentry-python/tree/constantinius/fix/openai-agents/mcp-execute-tool-spans
Conversation 11 https://github.com/getsentry/sentry-python/pull/4875
Commits 8 https://github.com/getsentry/sentry-python/pull/4875/commits
Checks 0 https://github.com/getsentry/sentry-python/pull/4875/checks
Files changed https://github.com/getsentry/sentry-python/pull/4875/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/4875/files
fix(openai-agents): also emit spans for MCP tool calls done by the LLM https://github.com/getsentry/sentry-python/pull/4875/files#top
Show all changes 8 commits https://github.com/getsentry/sentry-python/pull/4875/files
6cb7b43 fix(openai-agents): also emit spans for MCP tool calls done by the LLM constantinius Sep 30, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/6cb7b43591471c26196e0ca9ef4099f39f431224
96df8c1 fix(openai-agents): improve span handling in MCP tool execution constantinius Sep 30, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/96df8c1c08768d7f1d1369e66a9c4e7f6ebfc04c
99b1ddb fix(openai-agents): correct span data assignment for tool execution o… constantinius Oct 1, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/99b1ddb643c217449a2eaa8f5e11cd6ee474b45d
b219cd8 fix(openai-agents): refactor span data assignment to use set_data_nor… constantinius Oct 1, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/b219cd8ae4c52c5eff6793c0efa6846a3419bd31
3012e3a test(integrations): add tests for MCP Tool call spans constantinius Oct 1, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/3012e3a8f75b5dd395663b85556daf7d1ea01f41
94a3695 test(openai-agents): fix some tests constantinius Oct 2, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/94a369519dfd075009c0cb59fe17e3849b9e57a8
5802750 test(openai-agents): fix tests constantinius Oct 2, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/58027509fd39fe7838e6da78ccd8a4baf20a0956
c485fde Update tests/integrations/openai_agents/test_openai_agents.py constantinius Oct 2, 2025 https://github.com/getsentry/sentry-python/pull/4875/commits/c485fde4732d4418679221cabdf663b12b1306cb
Clear filters https://github.com/getsentry/sentry-python/pull/4875/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/4875/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/4875/files
ai_client.py https://github.com/getsentry/sentry-python/pull/4875/files#diff-b01bf87633a777593a593d2471a4a446e76af6b91ee2625401b3a415bd24d170
utils.py https://github.com/getsentry/sentry-python/pull/4875/files#diff-17339ab388e25807056ef77733200c6040af786fcf6cbe379cb58b2049cde38c
test_openai_agents.py https://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/integrations/openai_agents/spans/ai_client.pyhttps://github.com/getsentry/sentry-python/pull/4875/files#diff-b01bf87633a777593a593d2471a4a446e76af6b91ee2625401b3a415bd24d170
View file https://github.com/getsentry/sentry-python/blob/c485fde4732d4418679221cabdf663b12b1306cb/sentry_sdk/integrations/openai_agents/spans/ai_client.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/4875/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/4875/files#diff-b01bf87633a777593a593d2471a4a446e76af6b91ee2625401b3a415bd24d170
https://github.com/getsentry/sentry-python/pull/4875/files#diff-b01bf87633a777593a593d2471a4a446e76af6b91ee2625401b3a415bd24d170
https://github.com/getsentry/sentry-python/pull/4875/files#diff-b01bf87633a777593a593d2471a4a446e76af6b91ee2625401b3a415bd24d170
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/integrations/openai_agents/utils.pyhttps://github.com/getsentry/sentry-python/pull/4875/files#diff-17339ab388e25807056ef77733200c6040af786fcf6cbe379cb58b2049cde38c
View file https://github.com/getsentry/sentry-python/blob/c485fde4732d4418679221cabdf663b12b1306cb/sentry_sdk/integrations/openai_agents/utils.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/4875/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/4875/files#diff-17339ab388e25807056ef77733200c6040af786fcf6cbe379cb58b2049cde38c
https://github.com/getsentry/sentry-python/pull/4875/files#diff-17339ab388e25807056ef77733200c6040af786fcf6cbe379cb58b2049cde38c
cursorhttps://github.com/apps/cursor
Oct 1, 2025https://github.com/getsentry/sentry-python/pull/4875/files#r2394104339
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
sentry_sdk/integrations/openai_agents/spans/ai_client.py#L40-L41https://github.com/getsentry/sentry-python/blob/3012e3a8f75b5dd395663b85556daf7d1ea01f41/sentry_sdk/integrations/openai_agents/spans/ai_client.py#L40-L41
https://cursor.com/open?data=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImJ1Z2JvdC12MSJ9.eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjAwYzUxYTNmLTM4OWMtNDBlMC1iMDk1LTI4MjAzMWJlY2Y0OCIsImVuY3J5cHRpb25LZXkiOiI1a3JPWHFOYWlHZkJfU2pBQVZwb3c2dndkYmxwRkpQM3Jjd3Zzc09oS0Y4IiwiYnJhbmNoIjoiY29uc3RhbnRpbml1cy9maXgvb3BlbmFpLWFnZW50cy9tY3AtZXhlY3V0ZS10b29sLXNwYW5zIn0sImlhdCI6MTc1OTMxNDI3OCwiZXhwIjoxNzU5OTE5MDc4fQ.R1UIa-ZXCN-vQ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e2FuNZ-N4kFDsrl_QLq-HgmD4Kb_OoVAdavoey74BBqmSYJ6PGr9uTEVVYj_o4By2hvF_ZNDc9KSOZIxP_l7NcGK0AeC7-yvggL7dDfnIEl0pVZhmCPpwhBC94CGk_pvFbJAGH36ZqzMkpPvPLR6-xngA6ENZek224eJIUoE50W6URep1FOWO07li0Addh841c0APTDbI7r3wYyRUeg
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/4875/files
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
tests/integrations/openai_agents/test_openai_agents.pyhttps://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
View file https://github.com/getsentry/sentry-python/blob/c485fde4732d4418679221cabdf663b12b1306cb/tests/integrations/openai_agents/test_openai_agents.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/4875/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
https://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
https://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
https://github.com/getsentry/sentry-python/pull/4875/files#diff-3994ad06a0ebc1f49b0088b4c7210c4804d91e21c4886e98cf02b0da097dc06f
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.