Code_interpreter, reasoning and previous_response_id bug? (Item ‘...’ of type ‘reasoning’ was provided without its required following item.)

happens both with o3 and o4-mini

  • first call is ok .. it returns a list of reasoning items all with same id,say ‘rs_ABCD’
  • second call .. same to the first call BUT i provide previous_response_id (and a different question of course )..
    And i get
    “error”: {
    “message”: “Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required following item.”,
    “type”: “invalid_request_error”,
    “param”: “input”,
    “code”: null
    }
    }

did not find any help googling .. can someone suggest anything to solve ?
thanks
enrico

P.S. : same flow work with gpt4.1 (that has no reasoning items)

as workaround . it looks like that it works if one omits the previous_response_id and passes “explicitly” all previous question items as item reference
“input”: [
..
{
“id”: “x1”,
“type”: “item_reference”
},
{
“id”: “x2”,
“type”: “item_reference”
},

– new question
]

still , i would prefer to store a single id (previous_response_id ) on my side than the full list

well, nope, it does not always work :frowning: .. sometime it does, some time same error

1 Like