✗ WRONG

litellm 1.105.5

finish.unknown-value · openai-chat

Back to results · Scenario

Requirements

IdLevelStatusEvidence
response-returnedMUSTSATISFIEDoutcome=returned; error.category=null; truth.error=null
finish-is-otherMUSTCONTRADICTEDfinish.value="stop" (primary: choices[0].finish_reason); truth.finish="other"; required finish="other"
text-reportedMUSTSATISFIEDtext.value="Io, Europa, and Ganymede." (primary); truth.text="Io, Europa, and Ganymede."
raw-finish-reportedSHOULDSATISFIEDfinish.raw="wiretruth_unknown_reason"; truth.raw_finish="wiretruth_unknown_reason"

What the provider sent

Finish
other
Raw finish
wiretruth_unknown_reason
Text
Io, Europa, and Ganymede.
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": 0,
  "input": 12,
  "output": 12,
  "raw": {
    "completion_tokens": 12,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens": 12,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "total_tokens": 24
  },
  "reasoning": 0,
  "total": 24
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "chatcmpl-EXmWRUbnnv27jZGJrJnukzq7uKTpC",
  "object": "chat.completion",
  "created": 1791720051,
  "model": "gpt-6-luna",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Io, Europa, and Ganymede.",
        "refusal": null,
        "annotations": []
      },
      "finish_reason": "wiretruth_unknown_reason"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 12,
    "total_tokens": 24,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": null
}

What the library reported

Outcome
returned
Finish
{
  "raw": "wiretruth_unknown_reason",
  "source": "choices[0].finish_reason",
  "surface": "primary",
  "value": "stop"
}
Text
Value
Io, Europa, and Ganymede.
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 12,
  "output": 12,
  "reasoning": 0,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 24
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 535.6366839259863,
  "error": null,
  "finish": {
    "raw": "wiretruth_unknown_reason",
    "source": "choices[0].finish_reason",
    "surface": "primary",
    "value": "stop"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "litellm.completion",
    "language": "python",
    "name": "litellm",
    "version": "1.105.5"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Io, Europa, and Ganymede."
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 12,
    "output": 12,
    "reasoning": 0,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 24
  }
}

Fixture

derived openai-chat/finish.unknown-value

ProvenanceValue
Transformreplace_finish_value
Source fixtureopenai-chat/request.max-tokens-field
RationaleThe provider sends a finish value that a library may not recognize.
Evidencehttps://github.com/BerriAI/litellm/issues/21347

Reproduce

wiretruth serve openai-chat/finish.unknown-value

Plain-library snippet from the shim manifest.

litellm.completion(model='openai/' + model, api_base=WIRETRUTH_BASE_URL_OPENAI_CHAT, api_key=WIRETRUTH_API_KEY)

Upstream

documented-behavior Issue

Fixed in: not specified

LiteLLM deliberately normalizes unfamiliar finish reasons to stop with a warning. The upstream issue requested that fallback and is closed as completed; 1.105.1 implements it in https://github.com/BerriAI/litellm/blob/v1.105.1/litellm/litellm_core_utils/core_helpers.py#L253-L258. Gemini and the OpenAI Chat path retain the original in choices[0].provider_specific_fields.native_finish_reason; Anthropic and native Ollama normalize before assigning the choice and lose the original. A raw original does not change the contradictory primary stop.

History

VersionGrade
1.105.5✗ WRONG
1.105.1✗ WRONG