{"record":{"id":"63de28ad0f35b36e","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-response-id-but-r-63de28","errorCode":null,"errorMessage":"Expected a non-empty value for `response_id` but received {response_id!r}","messagePattern":"Expected a non-empty value for `response_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/responses/input_items.py","lineNumber":86,"sourceCode":"\n          limit: A limit on the number of objects to be returned. Limit can range between 1 and\n              100, and the default is 20.\n\n          order: The order to return the input items in. Default is `desc`.\n\n              - `asc`: Return the input items in ascending order.\n              - `desc`: Return the input items in descending order.\n\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not response_id:\n            raise ValueError(f\"Expected a non-empty value for `response_id` but received {response_id!r}\")\n        return self._get_api_list(\n            path_template(\"/responses/{response_id}/input_items\", response_id=response_id),\n            page=SyncCursorPage[ResponseItem],\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                query=maybe_transform(\n                    {\n                        \"after\": after,\n                        \"include\": include,\n                        \"limit\": limit,\n                        \"order\": order,\n                    },\n                    input_item_list_params.InputItemListParams,\n                ),\n                security={\"bearer_auth\": True},","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/responses/input_items.py#L68-L104","documentation":"Raised by Responses.sync input_items.list() when `response_id` is empty or None. The SDK validates the path parameter before requesting /responses/{response_id}/input_items, because a blank id would hit an invalid endpoint.","triggerScenarios":"client.responses.input_items.list(response_id=\"\") or response_id=None; often from unpacking a response object whose id field was missing.","commonSituations":"Storing ids from truncated logs, passing the whole response object instead of response.id, or defaulting response_id to \"\" when no id is known yet.","solutions":["Pass response.id from the created Response: client.responses.input_items.list(response_id=response.id)","Validate the id is a non-empty str before calling","Fix variable mix-ups where the Response object (not its id) or a wrong field is passed"],"exampleFix":"# before\nitems = client.responses.input_items.list(response_id=resp_id or \"\")\n# after\nif not resp_id:\n    raise ValueError(\"response_id required\")\nitems = client.responses.input_items.list(response_id=resp_id)","handlingStrategy":"validation","validationCode":"if not isinstance(response_id, str) or not response_id.strip():\n    raise ValueError(f\"invalid response_id: {response_id!r}\")\nclient.responses.input_items.list(response_id=response_id)","typeGuard":"def is_response_id(v: object) -> bool:\n    return isinstance(v, str) and v.startswith(\"resp_\")","tryCatchPattern":"try:\n    items = client.responses.input_items.list(response_id=rid)\nexcept ValueError as e:\n    logger.error(\"bad response_id: %s\", e)","preventionTips":["Always pass response.id, not the response object","Check ids start with 'resp_'","Avoid defaulting ids to empty strings"],"tags":["responses","parameter-validation","sync","pagination"],"backgroundTag":"invalid-argument-value","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}