{"record":{"id":"51099229043b6c68","repo":"openai/openai-python","slug":"response-id-must-be-provided-when-streaming-an-exi","errorCode":null,"errorMessage":"response_id must be provided when streaming an existing response","messagePattern":"response_id must be provided when streaming an existing response","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/responses/responses.py","lineNumber":3151,"sourceCode":"                top_p=top_p,\n                truncation=truncation,\n                user=user,\n                background=background,\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n            )\n\n            return AsyncResponseStreamManager(\n                api_request,\n                text_format=text_format,\n                input_tools=tools,\n                starting_after=None,\n            )\n        else:\n            if isinstance(response_id, Omit):\n                raise ValueError(\"response_id must be provided when streaming an existing response\")\n\n            api_request = self.retrieve(\n                response_id,\n                stream=True,\n                include=include or [],\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n            )\n            return AsyncResponseStreamManager(\n                api_request,\n                text_format=text_format,\n                input_tools=tools,\n                starting_after=starting_after if is_given(starting_after) else None,\n            )\n\n    async def parse(","sourceCodeStart":3133,"sourceCodeEnd":3169,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/responses/responses.py#L3133-L3169","documentation":"Async Responses.stream() raises this when you provide no create arguments and response_id is the Omit sentinel (explicitly omitted) — i.e. neither the create path nor the resume path can be taken. It is the resume-branch counterpart to the input/model checks.","triggerScenarios":"Calling async stream() with response_id explicitly set to Omit (e.g. OMIT constant from the SDK) and no new-response arguments; wrappers that forward an OMIT placeholder id.","commonSituations":"Using the SDK's Omit/OMIT sentinels for optional params and accidentally applying Omit to response_id while relying on resumption; generic parameter forwarding code.","solutions":["Pass a real response id: await client.responses.stream(response_id='resp_abc')","Don't use Omit for response_id — omit the argument entirely or pass input+model to create","Fix wrapper code that substitutes OMIT for missing ids"],"exampleFix":"// before\nawait client.responses.stream(response_id=OMIT)\n// after\nawait client.responses.stream(response_id=\"resp_abc\")","handlingStrategy":"validation","validationCode":"if response_id is None or response_id is OMIT:\n    raise ValueError('a real response id is required to resume streaming')\nawait client.responses.stream(response_id=response_id)","typeGuard":"def is_resume_id(response_id) -> bool:\n    return isinstance(response_id, str) and bool(response_id.strip())","tryCatchPattern":"try:\n    await client.responses.stream(response_id=rid)\nexcept ValueError as e:\n    if 'existing response' in str(e):\n        rid = await lookup_latest_response_id()\n        await client.responses.stream(response_id=rid)\n    else:\n        raise","preventionTips":["Never substitute OMIT/None sentinels for response_id","Branch your code explicitly between create-mode and resume-mode","Validate ids from persistence before resuming streams"],"tags":["responses","stream","missing-argument","omit-sentinel","async","python"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}