Skip to content

Add reproduction for sentry-javascript#18962#31

Open
nicohrubec wants to merge 2 commits intomainfrom
repro/sentry-javascript-18962-v2
Open

Add reproduction for sentry-javascript#18962#31
nicohrubec wants to merge 2 commits intomainfrom
repro/sentry-javascript-18962-v2

Conversation

@nicohrubec
Copy link
Member

@nicohrubec nicohrubec commented Mar 4, 2026

Summary

Test Results

On latest versions, the bug does not reproduce:

Endpoint Sentry Content Chunks First Byte Total
/stream-agent OFF ~40 ~0.7s ~1.2s
/stream-agent ON ~46 ~0.5s ~1.0s
/stream-model ON ~41 ~0.7s ~1.1s

Both agent and model streaming work correctly with @sentry/nestjs@10.42.0.

How to test

cd sentry-javascript/18962
npm install
# Add OPENAI_API_KEY to .env file
npm run start:without-sentry   # baseline
npm run start:with-sentry      # compare
curl http://localhost:3000/stream-agent

🤖 Generated with Claude Code

Reproduces OpenAI streaming breakage when Sentry tracing is enabled
with LangGraph agent.stream() and streamMode: ["messages"].

Based on community feedback from rad20c's comment suggesting
tracesSampleRate is the key config that causes the issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Switch from @langchain/langgraph createReactAgent to langchain v1 createAgent
- Load .env via dotenv for OPENAI_API_KEY
- Add chunk counting and timing to both endpoints
- Update README with test results: bug does not reproduce on latest
  @sentry/nestjs@10.42.0 + langchain@1.2.29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@sentry/nestjs": "^10.41.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caret version range prevents bug reproduction

Medium Severity

The @sentry/nestjs dependency uses ^10.41.0 (caret range), which resolves to the latest 10.x on npm install. The README explicitly states the bug does not reproduce on @sentry/nestjs@10.42.0 (the version a fresh install gets). This means anyone cloning and running this reproduction will not observe the reported bug. For the reproduction to be useful, the version needs to be pinned to an exact version where the bug manifests. Additionally, the README suggests "pinning to 10.41.0 may reproduce it," but notes the fix was in 10.39.0 — so 10.41.0 already includes the fix, making that guidance contradictory.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant