Skip to content

openai-responses provider: 404 on previous_response_id when store=false (default) #88499

Description

@xneone

Bug Description

When using a provider configured with api: openai-responses (e.g. a GPT-5.5 proxy), the gateway sends store=false (or omits store, which defaults to false) in responses API requests. However, on subsequent turns within the same session, the gateway includes previous_response_id referencing the previous response. Since that response was never persisted server-side, the API returns a 404:

HTTP 404: Item with id "rs_xxxxx" 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.

Once this happens, every subsequent request in the session fails with the same 404, because the stale previous_response_id is never cleared. The session is permanently broken until the user runs /new.

Steps to Reproduce

  1. Configure a provider with api: openai-responses pointing to an OpenAI-compatible endpoint (e.g. GPT-5.5 via a proxy):
    "wlkgpt": {
      "baseUrl": "https://api.example.com/v1",
      "api": "openai-responses",
      "models": [{"id": "gpt-5.5"}]
    }
  2. Set this as the default model for the main agent
  3. Start a conversation via Feishu/webchat — first few messages work fine
  4. After some time (or after session compaction/reload), send another message
  5. Observe: FailoverError: HTTP 404: Item with id "rs_xxx" not found

Environment

  • OpenClaw CLI/Gateway: 2026.5.27
  • OS: Windows 11
  • Provider: third-party OpenAI-compatible proxy serving GPT-5.5
  • API type: openai-responses
  • Fallback chain: configured but does NOT trigger (session-level model selection bypasses global fallbacks, separate issue)

Expected Behavior

The gateway should either:

  • (A) Send store: true in responses API requests so previous responses are available for follow-up turns, OR
  • (B) Strip previous_response_id from requests when the referenced response was not stored, OR
  • (C) On receiving a 404 for a previous_response_id, automatically clear the stale reference and retry without it

Actual Behavior

The stale previous_response_id is never cleared. The error propagates to the user as ⚠️ Something went wrong while processing your request. The only recovery is /new to start a fresh session.

Additional Context

This affects any provider using api: openai-responses with a backend that defaults store=false. The OpenAI Responses API documentation states that store=false means responses are not persisted, so referencing them in subsequent requests is invalid.

Related: session-level model overrides also prevent fallback chains from activating when the primary model fails, compounding the issue — a single model failure breaks the entire session with no automatic recovery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions