Conversation state includes model output items as well as user-visible text. Dropping an intermediate function call can leave a later tool result with no matching request. Preserve the sequence deliberately and reject unmatched results so the next step can reconstruct what happened.
Return a new list containing case.history followed by every case.response.output item and each matching case.tool_results item, in that order. Include only tool results whose call_id appears in the response function calls. Do not mutate case.history.
The notebook executes your Python against an original local mock. Use the supplied case rather than copying visible values. The hidden checks change identities, revisions and boundary inputs; no provider endpoint or external tool is contacted.
An example implementation of the function contract.