I’m working with the Responses API and using previous_response_id to manage conversational state. My goal is to set a system instruction once, along with all the previous input messages, and have it persist across multiple turns without manually re-sending it. The previous_response_id parameter will reference the context across the generated responses.
The documentation notes that when using previous_response_id, any system/developers instructions provided directly in the instructions property of a new request will not be carried over from the previous turn. But it is not strictly necessary to use the instructions property to insert system/developers instructions. One can still use the old way: input messages with the developer role.
This leads to my question: If I create a response where one of the input messages has the role: "developer", will that developer instruction be automatically carried over and applied when I create a subsequent response using its previous_response_id?
In other words, is using a developer role message a valid way to create a persistent system prompt for a conversation managed via previous_response_id?
Example Scenario:
-
I create an initial response (
resp_abc) and include adevelopermessage in its input items.Input Messages for
resp_abc:[ { "role": "developer", "content": [ { "type": "input_text", "text": "You are a world-class developer." } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Hello! Bla Bla Bla Bla Bla Bla Bla Bla Bla" } ] } ] -
Now, I want to create a new response (
resp_xyz) and continue the conversation by referencing the first one.Request Body for
resp_xyz:{ "previous_response_id": "resp_abc", "input": [ { "role": "user", "content": [ { "type": "input_text", "text": "Write a simple 'hello world' function in Python." } ] } ] }
Will the model generating resp_xyz still remember and adhere to the “You are a world-class developer” instruction from resp_abc’s context?
TL;DR: When using the Responses API, if I include a message with role: "developer" in a response’s context, will that instruction persist for future turns that reference this context via previous_response_id? Or do I need to re-supply the developer message every time?