`toolCallId` non-unique across steps when used with `ai-sdk` v5 `streamText`
As mentioned above, toolCallId is non-unique across steps when used with ai-sdk v5 streamText
toolCallId always starts with 0, causing each tool call across step to "step" on each other (pun not intended).
+1
+1
I’m also running into this issue and did some digging that might help narrow it down. It doesn’t seem to affect all models:
- With GPT-5, tool calls get IDs like call_randomid.
- With Gemini Flash 2.5 (google/gemini-2.5-flash), tool calls get IDs like tool_0_toolname, but the index doesn’t increment across multiple calls.
So far it looks specific to Gemini Flash 2.5 when used via the OpenRouter AI SDK provider with AI SDK v5. I haven't tested other models.
This is making it really really difficult to use the Gemini models via OpenRouter.
It seems the returned tool call id of gemini flash 2.5 has added a random number.