enhancement
major
minor
defect
critical
major
minor
major
#30254
tl-chat: A missing API key is reported as a rejected key ("The model rejected the access key")
tl-chat / tl-ai-core 8.0.0-alpha12.819, application E-Home (haumacher/ehome #126).
Without the secret ` tl_anthropic_api_key ` (no other provider configured), a chat message is responded to with the headline "The model has rejected the access key. Please contact your administrator."—the text of the AUTHENTICATION-type provider error. Only the detail below it states that the secret `tl_anthropic_api_key ` is missing. The key was not rejected; there simply isn’t one. An administrator reading the headline will check for the key instead of providing one.
Expected: A missing key should have its own error type and headline (“No language model is available: the secret `tl_anthropic_api_key` is not set.”), as described in the article ai/index (“a chat message is answered with the names of the secrets that would make a provider available”).
Workaround in E-Home: none.
Solution
- New error type ProviderException.Kind.NO_CREDENTIALS: a provider without credentials was not called at all. AgentLoop reports a run for which no model with credentials remains using this type (previously AUTHENTICATION, the type of a request rejected by the provider), as does AbstractStreamingProvider when credentials are missing during transmission.
- ModelAvailability does not set a flag against the model for this type (failover skips a provider without a key without setting a flag).
- In the case of NO_CREDENTIALS, the chat displays the server’s message as a header, which specifies the missing secret (e.g., “The AI model mistral-medium-latest cannot be used: The credentials for its provider, mistral, are unavailable. Please enter the secret tl_mistral_api_key."), once and without an additional detail line, instead of "The model rejected the access key." If the message is missing, a general note appears stating that no AI model is available.
- The message reporting a provider error is displayed once in the chat thread of the run that is executing in the context of the window from which the message was sent—that is, in the user’s language. This text is received by both the live display (ChatSSEHandler) and the saved conversation (ConversationLogListener). Previously, the live text was first translated in the SSE worker without user context, and the conversation stored the text in the log language, so the message appeared in English on a German interface. Conversations that have already been saved retain their text.
- The Eval evaluation (tl-ai-eval) classifies NO_CREDENTIALS as an infrastructure error, just like AUTHENTICATION; the article ai/providers describes this behavior.