René's URL Explorer Experiment


Title: Agents entered via onRequest never get gen_ai.conversation.id · Issue #22845 · getsentry/sentry-javascript · GitHub

Open Graph Title: Agents entered via onRequest never get gen_ai.conversation.id · Issue #22845 · getsentry/sentry-javascript

X Title: Agents entered via onRequest never get gen_ai.conversation.id · Issue #22845 · getsentry/sentry-javascript

Description: How do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using? @sentry/cloudflare SDK Version 10.69.0 Framework Version agents 0.20.0, ai 7.0.37, workers-ai-provider 4.0.0 Reproduction Example/SDK Setup An Agent that handles HTT...

Open Graph Description: How do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using? @sentry/cloudflare SDK Version 10.69.0 Framework Version agents 0.20.0, ai 7.0.37, workers-ai-provider 4.0.0 Reproduction Exa...

X Description: How do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using? @sentry/cloudflare SDK Version 10.69.0 Framework Version agents 0.20.0, ai 7.0.37, workers-ai-provider 4.0.0 Reproduction Exa...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/22845

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Agents entered via onRequest never get gen_ai.conversation.id","articleBody":"### How do you use Sentry?\n\nSentry SaaS (sentry.io)\n\n### Which SDK are you using?\n\n`@sentry/cloudflare`\n\n### SDK Version\n\n10.69.0\n\n### Framework Version\n\nagents 0.20.0, ai 7.0.37, workers-ai-provider 4.0.0\n\n### Reproduction Example/SDK Setup\n\nAn Agent that handles HTTP requests and makes a model call. No manual Sentry code anywhere:\n\n```ts\n// src/server.ts\nexport const OrderSupportAgent = Sentry.instrumentAgentWithSentry(sentryOptions, OrderSupportAgentBase);\n\nexport default Sentry.withSentry(sentryOptions, {\n  async fetch(request, env) {\n    return (await routeAgentRequest(request, env)) ?? new Response('Not found', { status: 404 });\n  },\n});\n\n// src/agents.ts\nexport class OrderSupportAgentBase extends Agent\u003cEnv> {\n  async onRequest(request: Request): Promise\u003cResponse> {\n    const body = await request.json();\n    return this.runTurn(body); // calls generateText() -> Workers AI\n  }\n}\n```\n\n### Steps to Reproduce\n\n1. Deploy the Worker above (`@sentry/cloudflare` 10.69.0, `agents` 0.20.0).\n2. `POST /agents/order-support-agent/\u003cinstance>` — the `agents` router sends this to `onRequest`.\n3. Open the resulting trace in Sentry and look at `gen_ai.conversation.id` on the spans.\n\n### Expected Result\n\nThe `gen_ai` spans carry `gen_ai.conversation.id` set to the agent instance name, the same way\nthey do for a chat turn or a `@callable()` RPC call. That is what the Conversations view groups on.\n\n### Actual Result\n\n`gen_ai.conversation.id` is empty on every span. In my trace: 14 spans (`http.server` ×3,\n`gen_ai.invoke_agent` ×2, `gen_ai.generate_content` ×5, `gen_ai.execute_tool` ×3, `rpc` ×1), none\nof them stamped.\n\nAdding a manual `Sentry.setConversationId()` inside the same agent stamps all of them, so\neverything downstream works — the SDK just never sets the id on this path.\n\n### Additional Context\n\n`setAgentConversationId` (`packages/cloudflare/src/instrumentations/agents/types.ts`) has exactly\ntwo callers:\n\n- `instrumentChatAgentConversation.ts` — the `onChatMessage` proxy\n- `instrumentAgentCallableRpc.ts` — the `onMessage` proxy (`@callable()` over WebSocket)\n\nAn HTTP request reaches the agent through the `obj.fetch` proxy in `durableobject.ts`, which wraps\nthe handler in `wrapRequestHandler` and never calls it. `instance.name` — the value it would use —\nis available on this path too.\n\n`onRequest` isn't an edge case: the `agents` docs list it as one of the two ways into an agent\n(\"HTTP requests via `onRequest()` — REST APIs, webhooks, file uploads\"), and a webhook can't hold\na WebSocket.\n\nWorth noting that `dev-packages/e2e-tests/test-applications/cloudflare-agent/tests/ai-streaming.test.ts`\nalready drives both fixture agents over HTTP and asserts a bunch of `gen_ai.*` attributes — it just\nnever asserts `gen_ai.conversation.id`, which is why CI is green today.\n\nI have a fix and will open a PR against this issue.\n","author":{"url":"https://github.com/sergical","@type":"Person","name":"sergical"},"datePublished":"2026-07-30T03:02:42Z","url":"https://github.com/getsentry/sentry-javascript/issues/22845"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e5e336cb-d86c-de91-6f37-0e12ffac56fd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED8E:34FCD3:2EE1E:3E7B3:6B042BC1
html-safe-nonce5b6e1390b51fdcb0418bd9b6ef89a35f3c6151b7cd5e6c744c9fa6ccebee4f07
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDhFOjM0RkNEMzoyRUUxRTozRTdCMzo2QjA0MkJDMSIsInZpc2l0b3JfaWQiOiI3NjUwMzYwNDUyODM2NTAyNDY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6870131f6139060b302822003f3579812a771c7a3fa1a44f0accb027c2258ffd
hovercard-subject-tagissue:5015636775
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/22845/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5b422eec28fede3889b10fde16f75ae40b06651a6d34365c1e07c467b39daa72/getsentry/sentry-javascript/issues/22845
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5b422eec28fede3889b10fde16f75ae40b06651a6d34365c1e07c467b39daa72/getsentry/sentry-javascript/issues/22845
og:image:altHow do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using? @sentry/cloudflare SDK Version 10.69.0 Framework Version agents 0.20.0, ai 7.0.37, workers-ai-provider 4.0.0 Reproduction Exa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesergical
hostnamegithub.com
expected-hostnamegithub.com
Noneb7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec3dd496c3da6ea6b77e69c09279d2b81604654f1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/22845#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F22845
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-javascript%2Fissues%2F22845
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22845
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22845
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22845
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues341 (341)https://github.com/getsentry/sentry-javascript/issues
Pull requests58 (58)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22845
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22845
#22846https://github.com/getsentry/sentry-javascript/pull/22846
Agents entered via onRequest never get gen_ai.conversation.idhttps://github.com/getsentry/sentry-javascript/issues/22845#top
#22846https://github.com/getsentry/sentry-javascript/pull/22846
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflarehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
agentshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22agents%22
https://github.com/sergical
sergicalhttps://github.com/sergical
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#issue-5015636775
sergicalhttps://github.com/sergical
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
agentshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22agents%22
Cloudflarehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28697272658
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28697273305
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28697276717
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#issuecomment-5125880469
Linear Codehttps://linear.app
JS-3228https://linear.app/getsentry/issue/JS-3228
github-actionshttps://github.com/apps/github-actions
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28697276702
JPeer264https://github.com/JPeer264
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#22846https://github.com/getsentry/sentry-javascript/pull/22846
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28717313496
JPeer264https://github.com/JPeer264
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28717313501
fix(cloudflare): Set agent conversation id on the `onRequest` path (#…https://github.com/getsentry/sentry-javascript/commit/96ff33c27923935823ac8c65c452d347e7b17bb3
#…https://github.com/getsentry/sentry-javascript/pull/22846
https://docs.github.com/articles/closing-issues-via-commit-messages
96ff33chttps://github.com/getsentry/sentry-javascript/commit/96ff33c27923935823ac8c65c452d347e7b17bb3
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22845#event-28717314500
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/22845
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22845
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflarehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
agentshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22agents%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.