Skip to content

Azure OpenAI Responses API: store=false causes 400 error on multi-turn conversations #27497

@polarbear-Yang

Description

@polarbear-Yang

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:

  1. Line 17: OPENAI_RESPONSES_PROVIDERS whitelist only contains "openai" — the Azure provider name ("azure-openai-responses") is not included
  2. Line 187: isDirectOpenAIBaseUrl() only checks for api.openai.com and chatgpt.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

  1. Configure OpenClaw with Azure OpenAI using api: "openai-responses"
  2. Set "supportsStore": true in model compat config
  3. Send a message via WebChat — first response succeeds
  4. 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 store parameter and previous_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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions