Title: OpenAI integration drops streamed tool calls that have no `index` · Issue #25620 · getsentry/sentry-javascript · GitHub
Open Graph Title: OpenAI integration drops streamed tool calls that have no `index` · Issue #25620 · getsentry/sentry-javascript
X Title: OpenAI integration drops streamed tool calls that have no `index` · Issue #25620 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release How do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using? @sentry/node SDK Version ...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release How do you use Sentry? Sentry SaaS (sentry.io) Which SDK ...
X Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release How do you use Sentry? Sentry SaaS (sentry.io) Which SDK ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25620
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OpenAI integration drops streamed tool calls that have no `index`","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues\n- [x] I have reviewed the documentation\n- [x] I am using the latest SDK release\n\n### How do you use Sentry?\n\nSentry SaaS (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\n11.8.0 (also `develop` at 6fb6b07)\n\n### Framework Version\n\nNode 24, `openai` SDK pointed at an OpenAI-compatible endpoint (Gemini's `/v1beta/openai`)\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n```ts\nSentry.init({ integrations: [Sentry.openAIIntegration()], tracesSampleRate: 1 });\nconst client = new OpenAI({ baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai/', apiKey });\nconst stream = await client.chat.completions.create({ model, messages, tools, stream: true });\nfor await (const _ of stream) {}\n```\n\n### Steps to Reproduce\n\n1. Stream a chat completion from an OpenAI-compatible endpoint that sends each tool call whole in its own delta without `index` (Gemini's OpenAI endpoint does; a mocked stream with two `tool_calls` deltas that carry `id`, `function.name` and `function.arguments` but no `index` reproduces it).\n2. Look at the tool-call attribute of the resulting span.\n\n### Expected Result\n\nBoth tool calls are recorded on the span, as they are for the same request without `stream: true`.\n\n### Actual Result\n\nNo tool calls are recorded. `processChatCompletionToolCalls` in `packages/server-utils/src/ai/openai/streaming.ts` skips every delta whose `index` is undefined.\n\n### Additional Context\n\nProposed fix: match unindexed deltas by `id`, start a new call on a new `id` or a function name, and otherwise append to the latest call; indexed deltas are grouped exactly as before. A patch with tests is ready; happy to open the PR.\n","author":{"url":"https://github.com/pcbeingused333","@type":"Person","name":"pcbeingused333"},"datePublished":"2026-10-21T13:51:31Z","url":"https://github.com/getsentry/sentry-javascript/issues/25620"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ee270e0a-c4c8-7fb3-b4d6-73c4c5ac9088 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C96A:13A6CC:75BCE:A385F:6B042AA3 |
| html-safe-nonce | 41fa15308a5b117e7489e146f68e196a3842d684d04422168f755c7aac7f6f36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTZBOjEzQTZDQzo3NUJDRTpBMzg1Rjo2QjA0MkFBMyIsInZpc2l0b3JfaWQiOiI4MDUzNjk5MTMwNzk2ODEyOTYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f03f9ab9eb9ca6b6480cae63ba3c8cf2ca13d0d47bee00ed59fa0353cda6204c |
| hovercard-subject-tag | issue:5961855479 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3523bd53c642cb1694f207dd820f4f11a2e557390d5828d93fad0c1fa72ded0/getsentry/sentry-javascript/issues/25620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3523bd53c642cb1694f207dd820f4f11a2e557390d5828d93fad0c1fa72ded0/getsentry/sentry-javascript/issues/25620 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release How do you use Sentry? Sentry SaaS (sentry.io) Which SDK ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pcbeingused333 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width