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
LLM connection test reports OK with an invalid API key #1006
The LLM profile "Test connection" button can report success with an invalid API key.
SettingsTestProbe.TestLlmAsync (src/NodePilot.Api/Services/SettingsTestProbe.cs) only sends GET {ApiRoot}/models and treats any 2xx as success. Some OpenAI-compatible servers answer /models without authentication. llama.cpp's llama-server started with --api-key serves /models (and /v1/models) as a public endpoint, so the probe returns "accepted the probe" with a wrong or missing key. Real requests (chat/responses) then fail with LLM_UNAUTHORIZED.
Expected
A green test result means the configured key is accepted for real requests.
Notes
The probe's doc comment claims /models is a check for "does my key work". That holds for OpenAI Cloud but not for every server the probe targets.
Possible directions: a minimal authenticated request after /models (e.g. a one-token completion against the profile's model), or an explicit hint in the success message that the key was not verified. A completion costs tokens, so this is a trade-off to decide.
The connection test now performs a small inference request with the draft model, endpoint and API key, so a public model list cannot produce a successful credential check. It preserves both chat-completions and Responses API handling, stored-key lookup, compatibility retries, cancellation and bounded diagnostics. The UI explains the token usage before running the probe.
Validation: 146 focused API tests, 23 settings UI tests and 235 documentation tests passed. The PR's backend, frontend, database-provider, desktop, all four Playwright shards, CodeQL and secret-scan checks have also passed.
Activity
mikemikimike commentedon Dec 2, 2026
Implemented in #1030.
The connection test now performs a small inference request with the draft model, endpoint and API key, so a public model list cannot produce a successful credential check. It preserves both chat-completions and Responses API handling, stored-key lookup, compatibility retries, cancellation and bounded diagnostics. The UI explains the token usage before running the probe.
Validation: 146 focused API tests, 23 settings UI tests and 235 documentation tests passed. The PR's backend, frontend, database-provider, desktop, all four Playwright shards, CodeQL and secret-scan checks have also passed.