From 7f6d48175ac958096a07c247efc7b9f5e0306c21 Mon Sep 17 00:00:00 2001 From: GareArc Date: Thu, 18 Sep 2025 23:56:04 -0700 Subject: [PATCH] Refactor WorkflowService to handle missing default credentials gracefully --- api/services/workflow_service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/services/workflow_service.py b/api/services/workflow_service.py index cd0d4aca22..a3b25d977a 100644 --- a/api/services/workflow_service.py +++ b/api/services/workflow_service.py @@ -408,13 +408,13 @@ class WorkflowService: provider_manager = ProviderManager() provider_configurations = provider_manager.get_configurations(tenant_id) models = provider_configurations.get_models(provider=provider, model_type=ModelType.LLM) - + target_model = None for model in models: if model.model == model_name and model.provider.provider == provider: target_model = model break - + if target_model: target_model.raise_for_status() else: @@ -452,7 +452,8 @@ class WorkflowService: ) if not default_provider: - raise ValueError("No default credential found") + # plugin does not require credentials, skip + return # Check credential policy compliance using the default credential ID from core.helper.credential_utils import check_credential_policy_compliance