Description
Using @ai-sdk/azure with the Responses API in stateless mode (store: false enforced server-side), multi-turn sessions consistently fail after 3-4 tool-calling turns with:
{
"error": {
"message": "The encrypted content gAAA...= could not be verified. Reason: Encrypted content could not be decrypted or parsed.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_encrypted_content"
}
}
This happens on a fresh session with GPT-5.5 (gpt-5.5-2026-04-24) after just a few tool calls. It's 100% reproducible.
Environment
- OpenCode v1.15.12
- Provider:
@ai-sdk/azure with custom baseURL pointing to an Azure OpenAI-compatible gateway
- Model:
gpt-5.5-2026-04-24
store: false enforced by the backend (stateless mode, no data retention)
- Responses API endpoint:
/responses?api-version=2025-04-01-preview
Config (relevant section)
{
"npm": "@ai-sdk/azure",
"options": {
"baseURL": "http://localhost:9000/openai",
"apiKey": "key",
"apiVersion": "2025-04-01-preview"
},
"models": {
"gpt-5.5-2026-04-24": {
"name": "GPT-5.5",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
}
}
}
Steps to Reproduce
- Configure a custom provider using
@ai-sdk/azure with a backend that enforces store: false
- Start a new session with GPT-5.5
- Send a prompt that triggers multiple tool calls (e.g., any multi-step task requiring 3+ tool invocations)
- After 3-4 successful Responses API round-trips, the next request fails with
invalid_encrypted_content
Analysis
PRs #28678 and #29000 fixed similar issues for the @ai-sdk/openai path (preserving native continuation metadata, splitting reasoning summary blocks). However, these fixes may not cover the @ai-sdk/azure code path.
The @ai-sdk/azure SDK's createResponsesModel is used (default provider.languageModel), and include: ["reasoning.encrypted_content"] is set by OpenCode's transform layer. The encrypted blob returned in one response is passed back in subsequent requests but becomes unverifiable after a few turns.
Possibly related closed issues:
Expected Behavior
Multi-turn sessions with tool calling should work beyond 3-4 turns without encrypted content verification failures when using @ai-sdk/azure with store: false.
Description
Using
@ai-sdk/azurewith the Responses API in stateless mode (store: falseenforced server-side), multi-turn sessions consistently fail after 3-4 tool-calling turns with:{ "error": { "message": "The encrypted content gAAA...= could not be verified. Reason: Encrypted content could not be decrypted or parsed.", "type": "invalid_request_error", "param": null, "code": "invalid_encrypted_content" } }This happens on a fresh session with GPT-5.5 (
gpt-5.5-2026-04-24) after just a few tool calls. It's 100% reproducible.Environment
@ai-sdk/azurewith custombaseURLpointing to an Azure OpenAI-compatible gatewaygpt-5.5-2026-04-24store: falseenforced by the backend (stateless mode, no data retention)/responses?api-version=2025-04-01-previewConfig (relevant section)
{ "npm": "@ai-sdk/azure", "options": { "baseURL": "http://localhost:9000/openai", "apiKey": "key", "apiVersion": "2025-04-01-preview" }, "models": { "gpt-5.5-2026-04-24": { "name": "GPT-5.5", "modalities": { "input": ["text", "image"], "output": ["text"] } } } }Steps to Reproduce
@ai-sdk/azurewith a backend that enforcesstore: falseinvalid_encrypted_contentAnalysis
PRs #28678 and #29000 fixed similar issues for the
@ai-sdk/openaipath (preserving native continuation metadata, splitting reasoning summary blocks). However, these fixes may not cover the@ai-sdk/azurecode path.The
@ai-sdk/azureSDK'screateResponsesModelis used (defaultprovider.languageModel), andinclude: ["reasoning.encrypted_content"]is set by OpenCode's transform layer. The encrypted blob returned in one response is passed back in subsequent requests but becomes unverifiable after a few turns.Possibly related closed issues:
Expected Behavior
Multi-turn sessions with tool calling should work beyond 3-4 turns without encrypted content verification failures when using
@ai-sdk/azurewithstore: false.