✗ WRONG

litellm 1.105.5

finish.unknown-value · anthropic

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="Octopuses change colour by" (primary); truth.text="Octopuses change colour by"
raw-finish-reportedSHOULDCONTRADICTEDfinish.raw="stop"; truth.raw_finish="WIRETRUTH_UNKNOWN_REASON"

What the provider sent

Finish
other
Raw finish
WIRETRUTH_UNKNOWN_REASON
Text
Octopuses change colour by
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 25,
  "output": 16,
  "raw": {
    "input_tokens": 25,
    "output_tokens": 16,
    "output_tokens_details": {
      "thinking_tokens": 8
    }
  },
  "reasoning": 8,
  "total": 41
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "msg_01Aq9w938a90dw8q",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "thinking",
      "thinking": "",
      "signature": "EqQBCgIYAhIM1gbcDa9GJwZA2b3hGgxBdjrkzLoky3dl1pkiMOYds..."
    },
    {
      "type": "text",
      "text": "Octopuses change colour by"
    }
  ],
  "model": "claude-sonnet-5-5",
  "stop_reason": "WIRETRUTH_UNKNOWN_REASON",
  "stop_sequence": null,
  "stop_details": null,
  "usage": {
    "input_tokens": 25,
    "output_tokens": 16,
    "output_tokens_details": {
      "thinking_tokens": 8
    }
  }
}

What the library reported

Outcome
returned
Finish
{
  "raw": "stop",
  "source": "choices[0].finish_reason",
  "surface": "primary",
  "value": "stop"
}
Text
Value
Octopuses change colour by
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 25,
  "output": 16,
  "reasoning": 8,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 41
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 285.2570731192827,
  "error": null,
  "finish": {
    "raw": "stop",
    "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": "Octopuses change colour by"
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 25,
    "output": 16,
    "reasoning": 8,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 41
  }
}

Fixture

derived anthropic/finish.unknown-value

ProvenanceValue
Transformreplace_finish_value
Source fixtureanthropic/truncation.text
RationaleThe provider sends a finish value that a library may not recognize.
Evidencehttps://github.com/BerriAI/litellm/issues/21347

Reproduce

wiretruth serve anthropic/finish.unknown-value

Plain-library snippet from the shim manifest.

litellm.completion(model='anthropic/' + model, api_base=WIRETRUTH_BASE_URL_ANTHROPIC, api_key=WIRETRUTH_API_KEY); host root, LiteLLM appends /v1/messages

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