You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1163e36
Browse filesBrowse the repository at this point in the historyBrowse files
fix: repair LLM test-connection and make silent model/template fallbacks visible (#281)
* fix: repair admin LLM test-connection endpoint
POST /settings/test-connection calls LLMService.test_connection(), which has
never existed, so the endpoint always raised AttributeError and the UI reported
a generic failure regardless of whether the key was valid.
Add the missing method. It probes the provider's models endpoint without
spending completion tokens and without falling back to other providers, so a
failure identifies this provider/base URL/key combination specifically.
Credentials are sent only in headers, never in the URL. OpenRouter's /models is
public and therefore cannot validate a key, so use /auth/key there and flag
provisioning/management keys, which pass /auth/key but are rejected by chat
completions.
Also surface the template fallback from indicator aiGenerate through
debug.generation_error: the built-in template passes validation, so previously
a failed model call was indistinguishable from a successful response and the
client reported success.
Refs #280
* test: cover LLM test_connection probe
Cases: unconfigured key, OpenRouter authenticated endpoint selection, the
provisioning/management key trap, HTTP failure surfacing, and that the Google
key is sent as a header rather than in the URL.
* feat: report the model that actually answered an LLM call
A model-level fallback (requested model -> configured default -> static fallback)
was only observable in the provider dashboard, so a misconfigured or unavailable
model id silently produced answers from a different model while the client
reported success.
LLMService now records last_model_used / last_provider_used / model_fallback_used,
the indicator generation path carries them in its edit plan, and aiGenerate
returns them as generation_model / generation_provider /
generation_model_fallback in the streamed debug frame.
---------
Co-authored-by: TIANHE <TIANHE@GMAIL.COM>
0 commit comments