# OpenAI-compatible server tolerance Status: accepted ## Context Servers (Ollama, vLLM, LM Studio, OpenRouter) vary: tool results must directly follow the assistant's tool_calls, not all accept content arrays, not all know `reasoning_effort`, some close without `[DONE]`. Custom endpoints are cheap to query and their config is edited by hand. ## Decision Emit tool results first, use plain string content, retry once without `reasoning_effort`, and still emit Done when the stream ends without `[DONE]`. Never serve the model-list cache first for custom endpoints. ## Consequences Wider server compatibility at the cost of an extra request in the retry case. Providers must always emit `Done` last with the full assembled message. Code: crates/hx-ai/src/openai_compat.rs (message conversion, request retry, stream end); crates/hx-ai/src/models.rs:list_models; crates/hx-ai/src/lib.rs:StreamEvent