[1.x] Replay reasoning on the OpenAI-compatible provider in tool loops

Merged
TA
7d ago
+130-110

Fixes #1243

The openai-compatible provider reads reasoning off the response but drops it on the next tool step. Reasoning models served by vLLM or SGLang expect it back on the assistant's tool call message.

This PR:

  • keeps the reasoning in replayBlocks, under the field the server returned it in (reasoning for vLLM, reasoning_content for SGLang and DeepSeek), for both generated and streamed steps
  • sends it back from the shared MapsChatCompletionMessages on assistant messages with tool calls, like DeepSeek and OpenRouter already do
  • reduces DeepSeek's copy of the trait to its one difference: it sends an empty reasoning_content when there is none, which its thinking mode requires

Groq, Mistral and Cohere use the same trait but don't capture reasoning blocks, so their requests don't change.

Tests cover both field names, generated and streamed tool loops, and a server that returns no reasoning. The DeepSeek reasoning tests pass unchanged.