https://gitlab.synchro.net/main/sbbs/-/commit/2a48d15a6f3e497f8af7b03a
Modified Files:
exec/chat_llm.js
Log Message:
chat_llm: reject a provider/endpoint mismatch at config load
Ollama serves both its native /api/chat and an OpenAI-compatible /v1/chat/completions on the same port, so pairing the wrong provider with
an endpoint doesn't fail at the HTTP level. provider=openai against
/api/chat failed only after the full generation, with "no choices in
response: <raw JSON>"; a sysop (Keyop) hit exactly that in #synchronet
while following the advice to switch endpoints.
load_config() now compares the endpoint's path with the provider
(/api/chat = ollama, .../chat/completions = openai) for both endpoint and endpoint_fallback, and throws an error naming the fix, before any
request. For URLs whose path doesn't say (e.g. behind a proxy), the
response parsers also recognize the other API's reply shape and say so
instead of dumping the raw JSON.
Tested against Ollama: both mismatches fail at once (0.0s) with the new messages; both correct pairings still reply; the live config still
loads; chat_openai() aimed at /api/chat reports the native shape.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)