{"record":{"id":"0889276bc2a126f1","repo":"mlflow/mlflow","slug":"empty-response-from-databricks-judge","errorCode":null,"errorMessage":"Empty response from Databricks judge","messagePattern":"Empty response from Databricks judge","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/genai/judges/adapters/databricks_managed_judge_adapter.py","lineNumber":296,"sourceCode":"                system_prompt or \"\",\n                tools=tools,\n                model=_DATABRICKS_AGENTIC_JUDGE_MODEL,\n                use_case=use_case,\n            )\n\n            # Surface API errors from the response before checking output_json,\n            # so users see the actual error (e.g. \"Model context limit exceeded\")\n            # instead of a misleading \"Empty response\" message.\n            error_code = getattr(llm_result, \"error_code\", None)\n            error_message = getattr(llm_result, \"error_message\", None)\n            if error_code or error_message:\n                raise MlflowException(\n                    f\"Databricks judge API error (code={error_code}): {error_message}\"\n                )\n\n            output_json = llm_result.output_json\n            if not output_json:\n                raise MlflowException(\"Empty response from Databricks judge\")\n\n            parsed_json = json.loads(output_json) if isinstance(output_json, str) else output_json\n            message = _create_message_from_databricks_response(parsed_json)\n\n            if not message.tool_calls:\n                return on_final_answer(message.content)\n\n            messages.append(message)\n            tool_response_messages = _process_tool_calls(\n                tool_calls=message.tool_calls,\n                trace=trace,\n            )\n            messages.extend(tool_response_messages)\n        except Exception:\n            _logger.debug(\"Failed during Databricks agentic loop iteration\", exc_info=True)\n            raise\n\n","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/genai/judges/adapters/databricks_managed_judge_adapter.py#L278-L314","documentation":"After a successful agentic loop with no error fields, if llm_result.output_json is empty, the code raises MlflowException 'Empty response from Databricks judge' because there is nothing to parse into a message.","triggerScenarios":"Judge endpoint returns HTTP 200 but no output_json payload; agentic loop ends without a final answer.","commonSituations":"Judge model returning blank content intermittently; endpoint-side truncation; internal Databricks issues.","solutions":["Retry the judge invocation (often transient)","Check Databricks service status and endpoint logs","Update mlflow/databricks-agents; report if persistent"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# call, then check before parsing\nresult = call_judge(...)\nif not getattr(result, 'output_json', None):\n    raise RetryableError('empty judge output')","typeGuard":"def has_output(r) -> bool:\n    return bool(getattr(r, 'output_json', None))","tryCatchPattern":"for attempt in range(3):\n    try:\n        out = invoke_judge(inputs)\n        if not out:\n            raise MlflowException('Empty response from Databricks judge')\n        break\n    except MlflowException:\n        time.sleep(2 ** attempt)\nelse:\n    raise","preventionTips":["Add bounded retries with backoff for judge calls","Alert on repeated empty responses (endpoint issue)","Keep SDK versions current to pick up judge fixes"],"tags":["databricks","judge","empty-response"],"backgroundTag":"empty-api-response","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}