René's URL Explorer Experiment


Title: @sentry/cloudflare: errors an Agent's RPC method catches are captured as unhandled when it calls an inherited Agent method · Issue #26673 · getsentry/sentry-javascript · GitHub

Open Graph Title: @sentry/cloudflare: errors an Agent's RPC method catches are captured as unhandled when it calls an inherited Agent method · Issue #26673 · getsentry/sentry-javascript

X Title: @sentry/cloudflare: errors an Agent's RPC method catches are captured as unhandled when it calls an inherited Agent method · Issue #26673 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...

Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/cloudflare: errors an Agent's RPC method catches are captured as unhandled when it calls an inherited Agent method","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### 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\n11.15.0\n\n### Framework Version\n\nagents 0.33.0, wrangler 4.156.0, compatibility date 2026-09-17 with `nodejs_compat`\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n`worker.js`, run with `wrangler dev`. It needs a Durable Object binding `C` (class `C`, SQLite) and any slow `text/event-stream` server on `127.0.0.1:8797`.\n\n```javascript\nimport * as Sentry from '@sentry/cloudflare';\nimport { Agent } from 'agents';\n\nconst opts = () => ({\n  dsn: 'https://abc@o0.ingest.sentry.io/0',\n  beforeSend(event) {\n    console.log('captured', JSON.stringify(event.exception?.values?.[0]));\n    return null;\n  },\n});\n\nclass Conv extends Agent {\n  aborts = new Set();\n\n  async proxy() {\n    const abort = new AbortController();\n    this.aborts.add(abort);\n    const response = await fetch('http://127.0.0.1:8797/', { signal: abort.signal });\n    const [forwarded, metered] = response.body.tee();\n    void this.keepAliveWhile(async () => {\n      const reader = metered.getReader();\n      for (;;) if ((await reader.read()).done) break;\n    }).catch((error) => console.log('handled', String(error)));\n    return new Response(forwarded);\n  }\n\n  async stop() {\n    for (const abort of this.aborts) abort.abort();\n  }\n}\n\nexport class C extends Sentry.instrumentAgentWithSentry(opts, Conv) {}\n\nexport default Sentry.withSentry(opts, {\n  async fetch(request, env) {\n    const stub = env.C.getByName('x');\n    const response = await stub.proxy();\n    const reader = response.body.getReader();\n    await reader.read();\n    setTimeout(() => stub.stop(), 300);\n    try {\n      for (;;) if ((await reader.read()).done) break;\n    } catch {}\n    return new Response('ok');\n  },\n});\n```\n\n### Steps to Reproduce\n\n1. Start a server on `127.0.0.1:8797` that streams `text/event-stream` chunks slowly.\n2. Run the Worker above with `wrangler dev` and request `/`.\n3. `proxy()` is called over RPC and returns the upstream stream. `stop()` then aborts the upstream fetch, so the callback passed to the inherited `keepAliveWhile()` rejects with an `AbortError`, and `proxy()`'s `.catch` handles it.\n\n### Expected Result\n\nNothing is captured: the Agent catches the rejection itself.\n\n### Actual Result\n\nThe rejection is captured as unhandled before the Agent's own `.catch` runs:\n\n```\ncaptured {\"type\":\"AbortError\",\"value\":\"The operation was aborted\",\"mechanism\":{\"type\":\"auto.faas.cloudflare.durable_object\",\"handled\":false}}\nhandled AbortError: The operation was aborted\n```\n\nIn production the event has no stack frames, because the `AbortError` is created by the runtime's stream implementation.\n\n### Additional Context\n\nThe Agents SDK's `_autoWrapCustomMethods()` replaces the subclass's own methods on the prototype during construction. `instrumentAgentWithSentry` treats them as framework-managed and leaves them out of RPC instrumentation, so an incoming RPC call to `proxy()` runs on the default isolation scope. Inherited `Agent` methods such as `keepAliveWhile()` are not replaced, so they keep the RPC prototype wrapper. When `proxy()` calls one, `createRpcPrototypeWrapper` finds no trace metadata on the default isolation scope, treats the internal call as a new untraced RPC entry (`startNewTrace`), and captures its rejection as unhandled.\n\nThis looks like the failure fixed for constructor work in #24735 / #24829, reached here through framework-managed RPC entry points. One fix would be to give framework-managed methods an invocation scope when they are entered over RPC, without starting a span, so calls they make are not treated as new entries.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>\n","author":{"url":"https://github.com/nwalters512","@type":"Person","name":"nwalters512"},"datePublished":"2026-11-19T22:13:16Z","url":"https://github.com/getsentry/sentry-javascript/issues/26673"}

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:3d01274c-871e-ff48-d7a7-5a0624976e8e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9BD4:1425F4:39B545:50F604:6B043FD6
html-safe-nonce006c8cded3577086a109d672155538067d1f813e2de60337a17f39305cf9444e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkQ0OjE0MjVGNDozOUI1NDU6NTBGNjA0OjZCMDQzRkQ2IiwidmlzaXRvcl9pZCI6IjUxNTI3Nzk0OTkyNTUxMTk4MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd39ab52ac75905dd9530f6d4da3e3aa8dd43b48677a95b9bf6323b85592869f9
hovercard-subject-tagissue:6500116682
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/26673/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0f938e1b041a7e982218e35c7088ad334c69d4c45702f21640e94876d72cc70d/getsentry/sentry-javascript/issues/26673
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0f938e1b041a7e982218e35c7088ad334c69d4c45702f21640e94876d72cc70d/getsentry/sentry-javascript/issues/26673
og:image:altIs there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenwalters512
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
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
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/26673#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F26673
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%2F26673
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/26673
Reloadhttps://github.com/getsentry/sentry-javascript/issues/26673
Reloadhttps://github.com/getsentry/sentry-javascript/issues/26673
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests54 (54)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/26673
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/26673
#26674https://github.com/getsentry/sentry-javascript/pull/26674
@sentry/cloudflare: errors an Agent's RPC method catches are captured as unhandled when it calls an inherited Agent methodhttps://github.com/getsentry/sentry-javascript/issues/26673#top
#26674https://github.com/getsentry/sentry-javascript/pull/26674
https://github.com/andreiborza
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
https://github.com/nwalters512
nwalters512https://github.com/nwalters512
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#issue-6500116682
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
#24735https://github.com/getsentry/sentry-javascript/issues/24735
#24829https://github.com/getsentry/sentry-javascript/pull/24829
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 Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706281163
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#issuecomment-7023674978
Linear Codehttps://linear.app
JS-4133https://linear.app/getsentry/issue/JS-4133
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706287312
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673
github-actionshttps://github.com/apps/github-actions
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706291187
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706366392
https://github.com/andreiborza
andreiborzahttps://github.com/andreiborza
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#issuecomment-7023701505
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 Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706397859
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673
andreiborzahttps://github.com/andreiborza
on Nov 19, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36706746049
andreiborzahttps://github.com/andreiborza
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
674bc02https://github.com/getsentry/sentry-javascript/commit/674bc029e51f4f8a5aefdecf80d8705d1148dc5e
on Nov 20, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36750384367
JPeer264https://github.com/JPeer264
on Nov 20, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36770812748
fix(cloudflare): Instrument Agent methods before the agents SDK wraps…https://github.com/adityareddy-dev/sentry-javascript/commit/674bc029e51f4f8a5aefdecf80d8705d1148dc5e
https://docs.github.com/articles/closing-issues-via-commit-messages
674bc02https://github.com/adityareddy-dev/sentry-javascript/commit/674bc029e51f4f8a5aefdecf80d8705d1148dc5e
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Nov 20, 2026https://github.com/getsentry/sentry-javascript/issues/26673#issuecomment-7041439080
GitHub Actionshttps://help.github.com/en/actions
#26674https://github.com/getsentry/sentry-javascript/pull/26674
11.16.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.16.0
ZacWarhamhttps://github.com/ZacWarham
on Nov 20, 2026https://github.com/getsentry/sentry-javascript/issues/26673#event-36807980671
Stop reporting expected model stream aborts from the course agent (Pr…https://github.com/ZacWarham/PrairieLearn/commit/a8230c70f2280b950413b645efd3230da7a88188
Pr…https://github.com/PrairieLearn/PrairieLearn/pull/16489
a8230c7https://github.com/ZacWarham/PrairieLearn/commit/a8230c70f2280b950413b645efd3230da7a88188
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/26673
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/26673
andreiborzahttps://github.com/andreiborza
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%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.