mlflow/mlflow · error · MlflowException

Empty response from Databricks judge

Error message

Empty response from Databricks judge

What it means

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.

Source

Thrown at mlflow/genai/judges/adapters/databricks_managed_judge_adapter.py:296

                system_prompt or "",
                tools=tools,
                model=_DATABRICKS_AGENTIC_JUDGE_MODEL,
                use_case=use_case,
            )

            # Surface API errors from the response before checking output_json,
            # so users see the actual error (e.g. "Model context limit exceeded")
            # instead of a misleading "Empty response" message.
            error_code = getattr(llm_result, "error_code", None)
            error_message = getattr(llm_result, "error_message", None)
            if error_code or error_message:
                raise MlflowException(
                    f"Databricks judge API error (code={error_code}): {error_message}"
                )

            output_json = llm_result.output_json
            if not output_json:
                raise MlflowException("Empty response from Databricks judge")

            parsed_json = json.loads(output_json) if isinstance(output_json, str) else output_json
            message = _create_message_from_databricks_response(parsed_json)

            if not message.tool_calls:
                return on_final_answer(message.content)

            messages.append(message)
            tool_response_messages = _process_tool_calls(
                tool_calls=message.tool_calls,
                trace=trace,
            )
            messages.extend(tool_response_messages)
        except Exception:
            _logger.debug("Failed during Databricks agentic loop iteration", exc_info=True)
            raise

View on GitHub (pinned to 6a27f2decc)

Solutions

  1. Retry the judge invocation (often transient)
  2. Check Databricks service status and endpoint logs
  3. Update mlflow/databricks-agents; report if persistent
Defensive patterns

Strategy: retry

Validate before calling

# call, then check before parsing
result = call_judge(...)
if not getattr(result, 'output_json', None):
    raise RetryableError('empty judge output')

Type guard

def has_output(r) -> bool:
    return bool(getattr(r, 'output_json', None))

Try / catch

for attempt in range(3):
    try:
        out = invoke_judge(inputs)
        if not out:
            raise MlflowException('Empty response from Databricks judge')
        break
    except MlflowException:
        time.sleep(2 ** attempt)
else:
    raise

Prevention

When it happens

Trigger: Judge endpoint returns HTTP 200 but no output_json payload; agentic loop ends without a final answer.

Common situations: Judge model returning blank content intermittently; endpoint-side truncation; internal Databricks issues.

Related errors


AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29). Data as JSON: /api/errors/0889276bc2a126f1. Report an issue: GitHub.