BerriAI/litellm · error · RuntimeError

WXO run ended with non-success status '{status}': {run_data}

Error message

WXO run ended with non-success status '{status}': {run_data}

What it means

Raised by the WXO handler after polling (or immediately) when the run's final status is not in SUCCESS_STATES. It means the watsonx Orchestrate run genuinely terminated in a failure state (or the status string is unrecognized, which also fails the membership check). The full run payload is included in the RuntimeError message for diagnosis.

Source

Thrown at litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py:167

        base_url: str,
        auth_headers: dict[str, str],
        client: AsyncHTTPHandler,
    ) -> dict[str, Any]:
        status = run_data.get("status", "")
        if status not in WatsonxOrchestrateTransformation.TERMINAL_STATES:
            run_id: Final = run_data.get("run_id") or run_data.get("id") or ""
            if not run_id:
                raise ValueError(f"WXO: No run_id in response: {run_data}")
            run_data = await WatsonxOrchestrateHandler._poll_run(
                base_url=base_url,
                run_id=run_id,
                auth_headers=auth_headers,
                client=client,
            )
            status = run_data.get("status", "")

        if status not in WatsonxOrchestrateTransformation.SUCCESS_STATES:
            raise RuntimeError(f"WXO run ended with non-success status '{status}': {run_data}")

        return run_data

    @staticmethod
    async def _accumulate_wxo_sse_text(response: Any) -> str:
        accumulated_text = ""
        async for line in response.aiter_lines():
            if not line.startswith("data:"):
                continue
            data_str = line[5:].strip()
            if not data_str or data_str == "[DONE]":
                continue
            try:
                event = json.loads(data_str)
            except json.JSONDecodeError:
                continue
            chunk_text = WatsonxOrchestrateTransformation.extract_text_from_wxo_result(event)
            if chunk_text:

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the run_data embedded in the exception message to identify the exact terminal status and any error details from watsonx Orchestrate.
  2. Fix the root cause on the WXO side (agent config, prompt/input size, backend model availability), then retry the LiteLLM call.
  3. If the status looks like a legitimate success variant missing from SUCCESS_STATES, update WatsonxOrchestrateTransformation.SUCCESS_STATES in the transformation class and report it upstream.
Defensive patterns

Strategy: retry

Type guard

def is_success_status(run_data: dict, success_states: set[str]) -> bool:
    return run_data.get("status", "") in success_states

Try / catch

terminal_statuses = {"failed", "cancelled", "error"}
for attempt in range(MAX_RETRIES):
    try:
        result = await wxo_call(...)
        break
    except RuntimeError as e:
        msg = str(e)
        if "non-success status" in msg and any(s in msg.lower() for s in terminal_statuses) and attempt < MAX_RETRIES - 1:
            await asyncio.sleep(backoff)
            continue
        raise

Prevention

When it happens

Trigger: A WXO agent run that finishes with a failed/cancelled/error status (e.g. 'FAILED', 'CANCELLED', 'ERROR'), or a status string that LiteLLM's SUCCESS_STATES set does not recognize. Produced by any WXO agent call via LiteLLM where _poll_run returns a non-success terminal status.

Common situations: The underlying agent errored in watxsonx Orchestrate (bad input, agent misconfiguration, backend LLM failure); a WXO version introducing a new success status spelling that LiteLLM's SUCCESS_STATES doesn't include; user cancels the run in the WXO UI mid-poll.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/7769f91b6b5b2efd. Report an issue: GitHub.