Solution skill
Streaming tool calls come back with empty args when Sentry is initialized
Complete solution
Shows how to fix streaming tool calls come back with empty args when Sentry is initialized. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
With stream=True and tool\choice={"type": "any"}, streamed tooluse blocks arrived with empty input args. The real fix landed in the Sentry SDK itself, getsentry/sentry-python#3615, not in the Anthropic SDK.
Steps
- With
stream=Trueandtool_choice={"type": "any"}, streamed tool_use blocks arrived with empty input args. The maintainer could not reproduce it with the reporter's dependency list, which meant the difference was environmental. The reporter bisected it: args were present without Sentry initialized, and empty with sentry-sdk initialized. The real fix landed in the Sentry SDK itself, getsentry/sentry-python#3615, not in the Anthropic SDK. - If your streamed tool calls arrive with empty args, check whether sentry-sdk is initialized in the same process. This exact symptom turned out to be caused by Sentry's instrumentation swallowing the streamed input chunks, and the maintainer could not reproduce it without Sentry present. The fix was in sentry-python, so upgrade sentry-sdk past the version containing PR getsentry/sentry-python#3615. To confirm the diagnosis, rerun your streaming script once with Sentry disabled and see if the tool args come back.
When to use
You are seeing this: The maintainer could not reproduce it with the reporter's dependency list, which meant the difference was environmental. Use this skill when you run into "Streaming tool calls come back with empty args when Sentry is initialized".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
The thread asked: With stream=True and tool_choice={"type": "any"}, streamed tool_use blocks arrived with empty input args. The maintainer could not reproduce it with the reporter's dependency list, which meant the difference was environmental. The reporter bisected it: args were present without Sentry initialized, and empty with sentry-sdk initialized. The real fix landed in the Sentry SDK itself, getsentry/sentry-python#3615, not in the Anthropic SDK.
The verified answer: If your streamed tool calls arrive with empty args, check whether sentry-sdk is initialized in the same process. This exact symptom turned out to be caused by Sentry's instrumentation swallowing the streamed input chunks, and the maintainer could not reproduce it without Sentry present. The fix was in sentry-python, so upgrade sentry-sdk past the version containing PR getsentry/sentry-python#3615. To confirm the diagnosis, rerun your streaming script once with Sentry disabled and see if the tool args come back.
Thread: https://vectle.com/threads/thr_IGJRr0rpOHsxIGqrkcWKuQ
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_f0EyF8Swfene0Wb6lREW9A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Streaming tool calls come back with empty args when Sentry is initialized <span>— Vectle</span></a>