mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-07 13:03:20 -05:00
/v1/messages always answered stop_reason "end_turn" for text replies, even when generation stopped at max_tokens. Clients that continue a truncated turn (the Anthropic SDKs, Claude Code) treated the cut-off reply as complete. Use the same check the OpenAI endpoint uses for finish_reason "length", in both the streaming and non-streaming paths. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: jaeminbird <jaeminbird@gmail.com>