{"record":{"id":"f7c02dc299bdac13","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-run-id-but-receiv-f7c02d","errorCode":null,"errorMessage":"Expected a non-empty value for `run_id` but received {run_id!r}","messagePattern":"Expected a non-empty value for `run_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/evals/runs/output_items.py","lineNumber":74,"sourceCode":"        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> OutputItemRetrieveResponse:\n        \"\"\"\n        Get an evaluation run output item by ID.\n\n        Args:\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 eval_id:\n            raise ValueError(f\"Expected a non-empty value for `eval_id` but received {eval_id!r}\")\n        if not run_id:\n            raise ValueError(f\"Expected a non-empty value for `run_id` but received {run_id!r}\")\n        if not output_item_id:\n            raise ValueError(f\"Expected a non-empty value for `output_item_id` but received {output_item_id!r}\")\n        return self._get(\n            path_template(\n                \"/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}\",\n                eval_id=eval_id,\n                run_id=run_id,\n                output_item_id=output_item_id,\n            ),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"bearer_auth\": True},\n            ),\n            cast_to=OutputItemRetrieveResponse,\n        )","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/evals/runs/output_items.py#L56-L92","documentation":"The sync EvalRunOutputItem.retrieve() method requires run_id to be non-empty because it is interpolated into the request path /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}. An empty or None run_id would yield a malformed URL, so the SDK raises ValueError before any network call.","triggerScenarios":"Calling client.evals.runs.output_items.retrieve() with run_id='' or None while eval_id is valid. Common when run_id is stored from a previous run but the run creation failed or returned no id.","commonSituations":"Run id fetched from client.evals.runs.create(...) whose response lacked an id, ids read from a database/CSV with empty cells, or variables shadowed/typo'd so run_id is never assigned.","solutions":["Verify run_id is set to the id of an existing eval run (created via client.evals.runs.create).","Log or debug-print run_id right before the call to confirm its value.","If it comes from storage, add a check for missing/empty values at load time.","Guard with: if not run_id: raise ValueError('run_id is required')."],"exampleFix":"// before\nitem = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)\n\n// after\nif not run_id:\n    raise ValueError(f\"run_id is required, got {run_id!r}\")\nitem = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)","handlingStrategy":"validation","validationCode":"if not isinstance(run_id, str) or not run_id.strip():\n    raise ValueError(f\"run_id must be a non-empty string, got {run_id!r}\")","typeGuard":"def is_valid_run_id(run_id: object) -> bool:\n    return isinstance(run_id, str) and bool(run_id.strip())","tryCatchPattern":"try:\n    item = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)\nexcept ValueError as e:\n    if 'run_id' in str(e):\n        raise ValueError(f'Skipping retrieve: {e}') from e\n    raise","preventionTips":["Store run ids immediately after creating runs.","Treat a failed run-creation call as fatal before using its would-be id.","Skip loop entries with falsy ids."],"tags":["openai","evals","value-error","path-parameter","client-side-validation"],"backgroundTag":"empty-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}