v3.18.1
Bug fixes for OpenAI-compatible providers (DeepSeek, OpenAI, Groq, Mistral, Qwen).
Fixed
- DeepSeek/OpenAI-compatible 400 on mixed-format history. A follow-up turn could fail with
Messages with role 'tool' must be a response to a preceding message with 'tool_calls'. Conversation history is now normalized before every request: Claude-formattool_use/tool_resultblocks (left by a turn that ran on Claude, including via failover) are converted to OpenAItool_calls/toolmessages, orphantoolmessages (from an interrupt or compaction) are dropped, and any unansweredtool_callgets a stub reply — so the request is always structurally valid regardless of how the history was built. - A malformed request (400/422) no longer triggers failover. Because a 400 fails identically on every provider, it was silently cascading a valid paid provider (e.g. DeepSeek) down the failover chain to the next one — straight into, e.g., Qwen's free-quota wall. The real error is now surfaced and the active provider is kept. Transient/availability failures (401, 429, 5xx, network errors) still fail over as before.