SDK
@sentry/cloudflare 10.69.0 with Cloudflare Agents 0.20.1.
Reproduction
- Wrap a supervisor
Agent with instrumentAgentWithSentry and set enableRpcTracePropagation: true.
- Address either a top-level Agent with
getAgentByName() or a child with native Durable Object facets (ctx.facets.get()), as Agents SDK subAgent() does.
- Let the Agents SDK bootstrap the instance through native Durable Object RPC (
setName()).
Facets and direct RPC on their Durable Object-style stubs are documented Cloudflare runtime behavior: https://developers.cloudflare.com/dynamic-workers/usage/durable-object-facets/
Expected
Native Agent/facet/DO RPC invokes the method with the underlying Durable Object instance as its receiver.
Actual
Sentry returns a proxy from finalizeWithRpcInstrumentation, and native RPC invokes the prototype method with that proxy as this. Any native private field access then fails. PartyServer's setName() exposes this concretely through its #_name field:
TypeError: Cannot read private member #_name from an object whose class did not declare it
Setting enableRpcTracePropagation: false avoids the error.
SDK
@sentry/cloudflare10.69.0 with Cloudflare Agents 0.20.1.Reproduction
AgentwithinstrumentAgentWithSentryand setenableRpcTracePropagation: true.getAgentByName()or a child with native Durable Object facets (ctx.facets.get()), as Agents SDKsubAgent()does.setName()).Facets and direct RPC on their Durable Object-style stubs are documented Cloudflare runtime behavior: https://developers.cloudflare.com/dynamic-workers/usage/durable-object-facets/
Expected
Native Agent/facet/DO RPC invokes the method with the underlying Durable Object instance as its receiver.
Actual
Sentry returns a proxy from
finalizeWithRpcInstrumentation, and native RPC invokes the prototype method with that proxy asthis. Any native private field access then fails. PartyServer'ssetName()exposes this concretely through its#_namefield:Setting
enableRpcTracePropagation: falseavoids the error.