External Publication
Visit Post

`responses` corrupts previous conversations `assistant` item

OpenAI Developer Community May 1, 2026
Source

I can’t repro that.

Let’s make a script:

#!/usr/bin/env bash
set -euo pipefail

: "${OPENAI_API_KEY:?Set OPENAI_API_KEY first}"

BASE="https://api.openai.com/v1"
AUTH=(-H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json")

echo "1) Create conversation"
CONV_ID=$(
  curl -sS "$BASE/conversations" \
    "${AUTH[@]}" \
    -d '{}' | jq -r '.id'
)
echo "CONV_ID=$CONV_ID"

echo "2) Add hard-coded bot/assistant message to conversation"
ADD_ITEM_JSON=$(
  curl -sS "$BASE/conversations/$CONV_ID/items" \
    "${AUTH[@]}" \
    -d '{
      "items": [
        {
          "type": "message",
          "role": "assistant",
          "content": "This is a hard-coded bot message that should remain in the conversation."
        }
      ]
    }'
)
echo "$ADD_ITEM_JSON" | jq .

ITEM_ID=$(echo "$ADD_ITEM_JSON" | jq -r '.data[0].id')
echo "ITEM_ID=$ITEM_ID"

echo "3) Retrieve that item before Responses call"
curl -sS "$BASE/conversations/$CONV_ID/items/$ITEM_ID" \
  "${AUTH[@]}" | jq .

echo "4) List all items before Responses call"
curl -sS "$BASE/conversations/$CONV_ID/items?order=asc" \
  "${AUTH[@]}" | jq .

echo "5) Create a model response using the conversation"
curl -sS "$BASE/responses" \
  "${AUTH[@]}" \
  -d "{
    \"model\": \"gpt-4.1-mini\",
    \"conversation\": \"$CONV_ID\",
    \"input\": \"Please respond briefly. What was the hard-coded bot message?\"
  }" | jq .

echo "6) Retrieve original hard-coded item after Responses call"
curl -sS "$BASE/conversations/$CONV_ID/items/$ITEM_ID" \
  "${AUTH[@]}" | jq .

echo "7) List all items after Responses call"
curl -sS "$BASE/conversations/$CONV_ID/items?order=asc" \
  "${AUTH[@]}" | jq .

now run it:

export OPENAI_API_KEY="sk-..."
chmod +x repro.sh
./repro.sh

result:

1) Create conversation
CONV_ID=conv_<redacted>

2) Add hard-coded bot/assistant message to conversation
{
  "object": "list",
  "data": [
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "input_text",
          "text": "This is a hard-coded bot message that should remain in the conversation."
        }
      ],
      "role": "assistant"
    }
  ],
  "first_id": "msg_<redacted>",
  "has_more": false,
  "last_id": "msg_<redacted>"
}
ITEM_ID=msg_<redacted>

3) Retrieve that item before Responses call
{
  "id": "msg_<redacted>",
  "type": "message",
  "status": "completed",
  "content": [
    {
      "type": "input_text",
      "text": "This is a hard-coded bot message that should remain in the conversation."
    }
  ],
  "role": "assistant"
}

4) List all items before Responses call
{
  "object": "list",
  "data": [
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "input_text",
          "text": "This is a hard-coded bot message that should remain in the conversation."
        }
      ],
      "role": "assistant"
    }
  ],
  "first_id": "msg_<redacted>",
  "has_more": false,
  "last_id": "msg_<redacted>"
}

5) Create a model response using the conversation
{
  "id": "resp_<redacted>",
  "object": "response",
  "created_at": 1777658589,
  "status": "completed",
  "background": false,
  "billing": {
    "payer": "openai"
  },
  "completed_at": 1777658591,
  "conversation": {
    "id": "conv_<redacted>"
  },
  "error": null,
  "frequency_penalty": 0.0,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "model": "gpt-4.1-mini-2025-04-14",
  "moderation": null,
  "output": [
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "The hard-coded bot message was:  \n\"This is a hard-coded bot message that should remain in the conversation.\""
        }
      ],
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "presence_penalty": 0.0,
  "previous_response_id": null,
  "prompt_cache_key": null,
  "prompt_cache_retention": "in_memory",
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "safety_identifier": null,
  "service_tier": "default",
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tool_choice": "auto",
  "tools": [],
  "top_logprobs": 0,
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 37,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 23,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 60
  },
  "user": null,
  "metadata": {}
}

6) Retrieve original hard-coded item after Responses call
{
  "id": "msg_<redacted>",
  "type": "message",
  "status": "completed",
  "content": [
    {
      "type": "input_text",
      "text": "This is a hard-coded bot message that should remain in the conversation."
    }
  ],
  "role": "assistant"
}

7) List all items after Responses call
{
  "object": "list",
  "data": [
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "input_text",
          "text": "This is a hard-coded bot message that should remain in the conversation."
        }
      ],
      "role": "assistant"
    },
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "input_text",
          "text": "Please respond briefly. What was the hard-coded bot message?"
        }
      ],
      "role": "user"
    },
    {
      "id": "msg_<redacted>",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "The hard-coded bot message was:  \n\"This is a hard-coded bot message that should remain in the conversation.\""
        }
      ],
      "role": "assistant"
    }
  ],
  "first_id": "msg_<redacted>",
  "has_more": false,
  "last_id": "msg_<redacted>"
}

I wonder if your data shape is wrong or you are using the wrong properties?

Discussion in the ATmosphere

Loading comments...