{"record":{"id":"8287462b9610da38","repo":"unslothai/unsloth","slug":"provider-config-display-name-is-disabled","errorCode":null,"errorMessage":"Provider '{config['display_name']}' is disabled.","messagePattern":"Provider '(.+?)' is disabled\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/providers.py","lineNumber":449,"sourceCode":"                except Exception:\n                    logger.exception(\n                        \"provider.delete_credential_rollback_failed\", provider_id = provider_id\n                    )\n                raise\n\n\ndef _bind_saved_provider_target(payload):\n    \"\"\"Use the saved provider's endpoint whenever its saved credential may be used.\"\"\"\n    if not payload.provider_id or payload.encrypted_api_key:\n        return payload\n    config = providers_db.get_provider(payload.provider_id)\n    if config is None:\n        raise HTTPException(\n            status_code = 404,\n            detail = f\"Provider config not found: {payload.provider_id}\",\n        )\n    if not config[\"is_enabled\"]:\n        raise HTTPException(\n            status_code = 400,\n            detail = f\"Provider '{config['display_name']}' is disabled.\",\n        )\n    return payload.model_copy(\n        update = {\n            \"provider_type\": config[\"provider_type\"],\n            \"base_url\": config[\"base_url\"],\n        }\n    )\n\n\n# ── Test connectivity ─────────────────────────────────────────────\n\n\n@router.post(\"/test\", response_model = ProviderTestResult)\nasync def test_provider(\n    payload: ProviderTestRequest,\n    _current_subject: str = Depends(get_current_subject),","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/providers.py#L431-L467","documentation":"A 400 from _bind_saved_provider_target: the referenced provider row exists but is_enabled is false, and the request has no explicit encrypted_api_key (so it would use the saved credential). Disabled providers are excluded from saved-credential use; the message includes the provider's display name.","triggerScenarios":"Calling a connectivity test or inference endpoint with the provider_id of a provider toggled off in the UI; requests racing a user disabling the provider.","commonSituations":"Providers disabled during incident response or key rotation but still referenced by pinned client state; stale UI selections after an admin disables a shared provider.","solutions":["Re-enable the provider in the UI (or via PUT with is_enabled: true) and retry.","Switch the request to a different enabled provider.","Send an explicit encrypted_api_key if you intend to test the endpoint independently of the saved, disabled config."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const target = providers.find(p => p.id === payload.provider_id);\nif (target && !target.is_enabled && !payload.encrypted_api_key) {\n  throw new Error(`Provider '${target.display_name}' is disabled`);\n}","typeGuard":"function usableSavedProvider(p: { is_enabled: boolean } | undefined): boolean {\n  return !!p && p.is_enabled === true;\n}","tryCatchPattern":"try { await testConnectivity(payload); } catch (e) { if (e.status === 400 && /disabled/i.test(e.detail)) { promptEnableProvider(payload.provider_id); return; } throw e; }","preventionTips":["Filter saved-provider pickers to enabled rows.","Offer to re-enable or switch provider on this specific 400."],"tags":["disabled-provider","saved-credential","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}