# OpenAIResponses recovers when the chained response is gone

> When OpenAI can no longer find the previous_response_id that Agno's OpenAIResponses chained a turn to, Agno retries once with the full conversation replayed, and the run gets its answer.

- Published: 2026-10-01
- Author: Yash Pratap Solanky
- Categories: Changelog
- Canonical: https://www.agno.com/blog/openairesponses-recovers-when-the-chained-response-is-gone
- Markdown: https://www.agno.com/blog/openairesponses-recovers-when-the-chained-response-is-gone.md

Agno's `OpenAIResponses` continues a reasoning model's conversation by sending the last stored response ID as `previous_response_id` with only the new messages. OpenAI answers a stale, expired or cross-account ID with a 400 that reads `Previous response with id '...' not found.`, and earlier releases raised that as a `ModelProviderError` while Agno still held the whole conversation.

Now Agno catches that one error, logs a warning, strips the stored response IDs from copies of the messages and sends the request again with the full context. It retries once, on all four paths: sync, async and both streaming modes.

![Real output from OpenAIResponses on gpt-5-mini, run against a mocked OpenAI endpoint that rejects an expired previous_response_id. Before, the request carrying previous_response_id resp_expired and one input item fails with ModelProviderError: Previous response with id 'resp_expired' not found. Now, the same request fails, Agno logs a warning that it is retrying with the full context replayed, sends a second request with no previous_response_id and four input items, and returns the answer: Your order number is 4417.](https://www.agno.com/images/v3-1-0-responses-stale-chain.png)

The retry stays narrow. Any other 400 propagates untouched, and a `previous_response_id` you pinned through `request_params` is yours, so Agno never replaces it.

The same change fixes two related chaining bugs. With `background=True` and `store=False`, Agno forces `store=True` on the wire, and message formatting and reasoning capture now read that forced value too, so a background request stops sending `previous_response_id` alongside the full history. And when a stored reasoning model replays a tool call without its reasoning item, Agno leaves out the call's `fc_` item ID that OpenAI would reject and keeps the `call_id`, so tool outputs still pair with their calls.

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/openai/responses/stored_responses_without_chaining.py) for turning chaining off with `use_previous_response_id=False`, and learn more about [OpenAI Responses](https://docs.agno.com/models/providers/native/openai/responses/overview) in the documentation.
