-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Azure OpenAI Responses API: store=false causes 400 error on multi-turn conversations #27497
Description
Bug Description
When using Azure OpenAI with the openai-responses API, multi-turn conversations fail with HTTP 400:
HTTP 400: Item with id 'rs_xxx' not found.
Items are not persisted when `store` is set to false.
Try again with `store` set to true, or remove this item from your input.
The first message works fine, but any follow-up message triggers this error because OpenClaw sends previous_response_id referencing a response that was never stored.
Root Cause
The function shouldForceResponsesStore() in src/agents/pi-embedded-runner/extra-params.ts controls whether store=true is sent with Responses API requests. However, it only recognizes direct OpenAI endpoints:
- Line 17:
OPENAI_RESPONSES_PROVIDERSwhitelist only contains"openai"— the Azure provider name ("azure-openai-responses") is not included - Line 187:
isDirectOpenAIBaseUrl()only checks forapi.openai.comandchatgpt.com— Azure URLs (*.openai.azure.com) are not matched
As a result, shouldForceResponsesStore() always returns false for Azure OpenAI, and the underlying pi-ai library defaults to store=false.
Steps to Reproduce
- Configure OpenClaw with Azure OpenAI using
api: "openai-responses" - Set
"supportsStore": truein model compat config - Send a message via WebChat — first response succeeds
- Send a follow-up message — HTTP 400 error
Expected Behavior
Multi-turn conversations should work with Azure OpenAI, with store=true sent in API requests.
Environment
- OpenClaw: latest (2026.2.25)
- Deployment: Docker on Azure VM
- Provider:
azure-openai-responses - Base URL:
https://<resource>.openai.azure.com/openai/v1 - Azure OpenAI fully supports the
storeparameter andprevious_response_id(Microsoft docs)
Proposed Fix
A 3-line change in src/agents/pi-embedded-runner/extra-params.ts — PR incoming.
🤖 AI-assisted (Claude Code)