diff --git a/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py b/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py index aa04f1afa..2360dafd9 100644 --- a/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py +++ b/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py @@ -123,19 +123,6 @@ class OpenAIResponsesImpl: # Use stored messages directly and convert only new input message_adapter = TypeAdapter(list[OpenAIMessageParam]) messages = message_adapter.validate_python(previous_response.messages) - # When managing conversation state with the previous_response_id parameter, - # the instructions used on previous turns will not be carried over in the context - previous_instructions = previous_response.instructions - if previous_instructions: - if ( - isinstance(previous_instructions, str) - and previous_instructions == messages[0].content - and messages[0].role == "system" - ): - # Omit instructions from previous response - del messages[0] - else: - raise ValueError("Instructions from the previous response could not be validated") new_messages = await convert_response_input_to_chat_messages(input, previous_messages=messages) messages.extend(new_messages) else: diff --git a/tests/unit/providers/agents/meta_reference/test_openai_responses.py b/tests/unit/providers/agents/meta_reference/test_openai_responses.py index 5e95439f5..54c1820fb 100644 --- a/tests/unit/providers/agents/meta_reference/test_openai_responses.py +++ b/tests/unit/providers/agents/meta_reference/test_openai_responses.py @@ -38,7 +38,6 @@ from llama_stack.apis.inference import ( OpenAIJSONSchema, OpenAIResponseFormatJSONObject, OpenAIResponseFormatJSONSchema, - OpenAISystemMessageParam, OpenAIUserMessageParam, ) from llama_stack.apis.tools.tools import ListToolDefsResponse, ToolDef, ToolGroups, ToolInvocationResult, ToolRuntime @@ -840,7 +839,6 @@ async def test_create_openai_response_with_previous_response_instructions( text=OpenAIResponseText(format=OpenAIResponseTextFormat(type="text")), input=[input_item_message], messages=[ - OpenAISystemMessageParam(content="You are a helpful assistant."), OpenAIUserMessageParam(content="Name some towns in Ireland"), OpenAIAssistantMessageParam(content="Galway, Longford, Sligo"), ],