Skip to content

'previous_response_id' is ignored for multi-turn conversations, maybe contradicting performance best practices #4047

@insilications

Description

@insilications

What version of Codex is running?

rust-v0.40.0-alpha.1

Which model were you using?

gpt-5

What platform is your computer?

Linux

What steps can reproduce the bug?

The Codex CLI's integration with the Responses API no longer appears to use previous_response_id for managing multi-turn conversation state, with reasoning or tool calls, even when the store parameter is set to true. This seems to be the case since circa #1641. Why?

All recent guides and documentation by OpenAI says that using previous_response_id not only facilitates multi-turn conversations, but results in better function‑calling performance and lower overall token usage. If this is still true, it wouldn't make sense to simply give up on using previous_response_id for all use cases with the Codex CLI. We want the best perform with OpenAI's responses API.

According to the official OpenAI documentation, for multi-turn conversations using the Responses API with store=true, subsequent requests should include the previous_response_id to maintain context. As stated in the Reasoning Best Practices guide:

For the best results with this change, we recommend using the Responses API with the store parameter set to true, and passing in all reasoning items from previous requests (either using previous_response_id, or by taking all the output items from an older request and passing them in as input items for a new one). OpenAI will automatically include any relevant reasoning items in the model's context and ignore any irrelevant ones. In more advanced use‑cases where you’d like to manage what goes into the model's context more precisely, we recommend that you at least include all reasoning items between the latest function call and the previous user message. Doing this will ensure that the model doesn’t have to restart its reasoning when you respond to a function call, resulting in better function‑calling performance and lower overall token usage.

Relevant Documentation:

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions