Problem
The SLM admin LLM settings page's Test button cannot test a saved cloud provider.
autobot-slm-frontend/src/views/settings/admin/LLMSettings.vue testProvider() sends provider.api_key from browser state to POST /settings/admin/llm/test, and autobot-slm-backend/api/llm_config.py test_llm_connection uses request.api_key verbatim as the Bearer token.
Why the obvious fix is wrong
"When api_key is empty, resolve the stored key by provider name" would send a stored secret to a client-supplied endpoint, behind ADMIN_CONFIG_READ (not WRITE). Anyone with read access could point the endpoint at a host they control and receive any provider's key as a Bearer header.
Fix
Testing a saved provider resolves the stored key server-side and uses the stored endpoint, ignoring any client-supplied endpoint for that case. A client-supplied key, used only with the client-supplied endpoint, remains the path for testing an unsaved provider.
Acceptance criteria
Problem
The SLM admin LLM settings page's Test button cannot test a saved cloud provider.
autobot-slm-frontend/src/views/settings/admin/LLMSettings.vuetestProvider()sendsprovider.api_keyfrom browser state toPOST /settings/admin/llm/test, andautobot-slm-backend/api/llm_config.pytest_llm_connectionusesrequest.api_keyverbatim as theBearertoken.sk-a...b3f2), so every test of a saved provider authenticated with the mask and failed.Why the obvious fix is wrong
"When
api_keyis empty, resolve the stored key by provider name" would send a stored secret to a client-suppliedendpoint, behindADMIN_CONFIG_READ(not WRITE). Anyone with read access could point the endpoint at a host they control and receive any provider's key as aBearerheader.Fix
Testing a saved provider resolves the stored key server-side and uses the stored endpoint, ignoring any client-supplied endpoint for that case. A client-supplied key, used only with the client-supplied endpoint, remains the path for testing an unsaved provider.
Acceptance criteria
Authorizationheader, or is refused)