{"record":{"id":"86e00cc0701d9034","repo":"mlflow/mlflow","slug":"invalid-status-self-status-for-self-class","errorCode":null,"errorMessage":"Invalid status: {self.status} for {self.__class__.__name__}. Must be 'in_progress', 'completed', or 'incomplete'.","messagePattern":"Invalid status: (.+?) for (.+?)\\. Must be 'in_progress', 'completed', or 'incomplete'\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mlflow/types/responses_helpers.py","lineNumber":27,"sourceCode":"https://github.com/openai/openai-python/blob/ed53107e10e6c86754866b48f8bd862659134ca8/src/openai/types/responses/response.py#L31\nhttps://github.com/openai/openai-python/blob/ed53107e10e6c86754866b48f8bd862659134ca8/src/openai/types/responses/response_stream_event.py#L42\n\"\"\"\n\n\n#########################\n# Response helper classes\n#########################\nclass Status(BaseModel):\n    status: str | None = None\n\n    @model_validator(mode=\"after\")\n    def check_status(self) -> \"Status\":\n        if self.status is not None and self.status not in {\n            \"in_progress\",\n            \"completed\",\n            \"incomplete\",\n        }:\n            raise ValueError(\n                f\"Invalid status: {self.status} for {self.__class__.__name__}. \"\n                \"Must be 'in_progress', 'completed', or 'incomplete'.\"\n            )\n        return self\n\n\nclass ResponseError(BaseModel):\n    code: str | None = None\n    message: str\n\n\nclass AnnotationFileCitation(BaseModel):\n    file_id: str\n    index: int\n    type: str = \"file_citation\"\n\n\nclass AnnotationURLCitation(BaseModel):","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/types/responses_helpers.py#L9-L45","documentation":"The Status pydantic model in mlflow/types/responses_helpers.py validates Responses-API status values via a model validator. Any status other than None, 'in_progress', 'completed', or 'incomplete' is rejected, with the class name included in the message.","triggerScenarios":"Deserializing a ResponseOutputMessage / ResponseFunctionToolCall from JSON whose `status` is e.g. 'failed', 'done', or a truncated/typo'd value.","commonSituations":"Feeding output from a different (non-OpenAI) Responses implementation into MLflow's parsers; hand-editing captured trace payloads; SDK version drift producing new enum values the validator doesn't accept.","solutions":["Change status to one of 'in_progress', 'completed', 'incomplete'.","Set status to None if unknown.","Fix the producer of the payload to emit a valid status.","Upgrade MLflow if a newer upstream status value is legitimately supported."],"exampleFix":"// before\nResponseOutputMessage(id='m1', role='assistant', content=[...], status='done')\n// after\nResponseOutputMessage(id='m1', role='assistant', content=[...], status='completed')","handlingStrategy":"validation","validationCode":"VALID_STATUSES = {\"in_progress\", \"completed\", \"incomplete\"}\nassert payload.get(\"status\") in VALID_STATUSES or payload.get(\"status\") is None","typeGuard":"def is_valid_status(s) -> bool:\n    return s is None or s in {\"in_progress\", \"completed\", \"incomplete\"}","tryCatchPattern":"try:\n    item = ResponseOutputMessage(**payload)\nexcept ValueError as e:\n    if 'Invalid status' in str(e):\n        payload['status'] = None\n        item = ResponseOutputMessage(**payload)\n    else:\n        raise","preventionTips":["Normalize status values before parsing","Keep payloads sourced from OpenAI-compatible endpoints","Pin MLflow and SDK versions together","Whitelist statuses in ingestion code"],"tags":["pydantic","validation","mlflow","responses-api"],"backgroundTag":"invalid-enum-value","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}