Skip to content

Azure OpenAI Responses API: 'Item with id rs_... not found' when store is false #21782

@EdwardWu7

Description

@EdwardWu7

Bug Description

When using openai-responses API with Azure OpenAI (e.g. gpt-5.2-codex-4), multi-turn conversations fail with:

HTTP 400: Item with id 'rs_...\ 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.

Root Cause

The Responses API returns reasoning output items with an id (e.g. rs_xxx) and encrypted_content: null. On the next turn, OpenClaw includes these reasoning items in the input array. Since the items were not persisted server-side (store: false or Azure default behavior), the API cannot resolve the referenced id and returns 400.

Expected Behavior

OpenClaw should either:

  1. Strip reasoning items (type reasoning) with encrypted_content: null from the input when building multi-turn requests
  2. Or set store: true explicitly when using the Responses API
  3. Or provide a model-level config option to control store behavior

Reproduction

  1. Configure a provider with "api": "openai-responses" pointing to Azure OpenAI
  2. Start a conversation (first turn succeeds)
  3. Send a second message in the same session → 400 error

Environment

  • OpenClaw: 2026.2.19-2
  • Provider: Azure OpenAI (east-us-grandline-prod.openai.azure.com)
  • Model: gpt-5.2-codex-4
  • API: openai-responses

Related

Same issue reported in Vercel AI SDK: vercel/ai#7543

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