ROADMAP "Backend → more tests around endpoint probing and provider setup" and the "Provider setup/probing audit" item. test_provider_endpoints.py covers URL/header building; this adds the provider-identification and degraded-state error reporting around it, against the real src.llm_core: - _detect_provider: host-based (not substring) provider matching, with look-alike-host and domain-in-path guards, and the OpenAI-compatible fallback that xAI / DeepSeek / Gemini correctly use. - _provider_label: human names used in error messages (incl. native vs cloud Ollama and the generic local-endpoint case). - _format_upstream_error: 401/403/404/429/5xx → provider-aware sentences, with JSON / string / plain-text / bytes body detail extraction. - _uses_max_completion_tokens: gpt-5 / o-series detection (gpt-4o stays on plain max_tokens).
8.0 KiB
8.0 KiB