Conversation
Co-Authored-By: GPT-6 <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7d68234. Configure here.
| const ctx2 = buildContextWithSentryScopes(context); | ||
| const cb = thisArg == null ? fn : fn.bind(thisArg); | ||
| return this._asyncLocalStorage.run(ctx2, cb as never, ...args); | ||
| return this._asyncLocalStorage.run({ ...getScopesFromContext(ctx2)!, context: ctx2 }, cb as never, ...args); |
There was a problem hiding this comment.
Unguarded non-null assertion
Low Severity
getScopesFromContext(ctx2)! is a new non-null assertion in SDK source without a comment explaining why a safer type is not possible. This was flagged because the review rules require that comment on ! assertions.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 7d68234. Configure here.


The plain and OpenTelemetry strategies reuse one AsyncLocalStorage instance but expect different store shapes. Use a compatible shape while preserving the instance and OpenTelemetry context, preventing the reproduced crashes.
The current isolation is also preserved when the same active scope created by the plain strategy is rebound after switching back to OpenTelemetry. Captured scopes and their descendants retain their saved context. Cloned or escaped plain scopes can still restore their older context; this does not provide general support for combining SDKs.
Local
yarn build,yarn lint,yarn format:check, and rootyarn testpassed, including all 42 root test projects. The pinned Next/OpenNext fixture passed 12 tests with 16 existing skips; its OpenNext peer-version warning remains.Fixes #24603.