GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [Bug] @ai-sdk/amazon-bedrock: Tool call IDs incompatible with Mistral models - "must be a-z, A-Z, 0-9, with a length of 9" · Issue #11802 · vercel/ai Labels ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelmerged-mainprovider/amazon-bedrockIssues related to the @ai-sdk/amazon-bedrock providersupporttask-identify-issue-type-done DescriptionDescriptionWhen using Mistral models via Code to reproduce: import {createAmazonBedrock} from '@ai-sdk/amazon-bedrock'; import {generateText, jsonSchema} from 'ai'; const bedrock = createAmazonBedrock({ region: 'us-east-1', // ... credentials }); const model = bedrock('mistral.ministral-3-14b-instruct'); const result = await generateText({ model, tools: { searchWeb: { description: 'Search the web for information', parameters: jsonSchema({ type: 'object', properties: { query: {type: 'string', description: 'Search query'}, }, required: ['query'], }), }, }, toolChoice: 'auto', messages: [ { role: 'user', content: 'Search for the projected revenue for Alphabet Inc. in 2026', }, ], maxRetries: 1, }); Expected Behavior Tool calling should work correctly with Mistral models on Bedrock, similar to how it works with Anthropic models on Bedrock. Actual Behavior The first tool call succeeds, but when sending the tool result back for the next turn, the request fails with: Root Cause Analysis
Related IssuesThis is a known compatibility issue that has been addressed in other projects:
Suggested FixAdd Mistral-specific tool call ID normalization in
Example transformation:
WorkaroundCurrently, there is no workaround other than avoiding tool use with Mistral models on Bedrock, or implementing a custom transformation layer at the application level. Additional ContextFull error response from Bedrock: {
"statusCode": 400,
"responseHeaders": {
"x-amzn-errortype": "ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/",
"x-amzn-requestid": "1db5f47e-7335-4051-bea0-224852765024"
},
"responseBody": {
"message": "The model returned the following errors: {\"code\":\"validation_error\",\"message\":\"Tool call id was i-nKGDr5g but must be a-z, A-Z, 0-9, with a length of 9.\"}"
}
}AI SDK VersionEnvironment:
Mistral models affected:
Code of Conduct
Reacted by Heinrich Wendel Activity
MetadataMetadataAssigneesLabelsai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelmerged-mainprovider/amazon-bedrockIssues related to the @ai-sdk/amazon-bedrock providersupporttask-identify-issue-type-done TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |