From e0c0dd3221f5fa4e177595fb5a824f8e7104aa5e Mon Sep 17 00:00:00 2001 From: busya Date: Tue, 24 Feb 2026 16:04:14 +0300 Subject: [PATCH] fix(validation): respect settings-bound provider and correct multimodal heuristic --- .../__tests__/test_llm_prompt_templates.py | 2 +- backend/src/services/llm_prompt_templates.py | 4 ---- frontend/src/components/DashboardGrid.svelte | 19 ------------------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/backend/src/services/__tests__/test_llm_prompt_templates.py b/backend/src/services/__tests__/test_llm_prompt_templates.py index 4509cb4..861abb8 100644 --- a/backend/src/services/__tests__/test_llm_prompt_templates.py +++ b/backend/src/services/__tests__/test_llm_prompt_templates.py @@ -74,7 +74,7 @@ def test_render_prompt_replaces_known_placeholders(): def test_is_multimodal_model_detects_known_vision_models(): assert is_multimodal_model("gpt-4o") is True assert is_multimodal_model("claude-3-5-sonnet") is True - assert is_multimodal_model("stepfun/step-3.5-flash:free", "openrouter") is True + assert is_multimodal_model("stepfun/step-3.5-flash:free", "openrouter") is False assert is_multimodal_model("text-only-model") is False # [/DEF:test_is_multimodal_model_detects_known_vision_models:Function] diff --git a/backend/src/services/llm_prompt_templates.py b/backend/src/services/llm_prompt_templates.py index aabbb6e..fed46d8 100644 --- a/backend/src/services/llm_prompt_templates.py +++ b/backend/src/services/llm_prompt_templates.py @@ -161,13 +161,9 @@ def is_multimodal_model(model_name: str, provider_type: Optional[str] = None) -> "internvl", "qwen-vl", "qwen2-vl", - "stepfun/step-3.5", ) if any(marker in token for marker in multimodal_markers): return True - # OpenRouter model ids are heterogeneous; keep permissive path for known StepFun family. - if provider == "openrouter" and token.startswith("stepfun/step-3.5"): - return True return False # [/DEF:is_multimodal_model:Function] diff --git a/frontend/src/components/DashboardGrid.svelte b/frontend/src/components/DashboardGrid.svelte index 11239ee..f2858d9 100644 --- a/frontend/src/components/DashboardGrid.svelte +++ b/frontend/src/components/DashboardGrid.svelte @@ -51,30 +51,11 @@ validatingIds = new Set(validatingIds); try { - // TODO: Get provider_id from settings or prompt user - // For now, we assume a default provider or let the backend handle it if possible, - // but the plugin requires provider_id. - // In a real implementation, we might open a modal to select provider if not configured globally. - // Or we pick the first active one. - - // Fetch active provider first - const providers = await api.fetchApi("/llm/providers"); - const activeProvider = providers.find((p: any) => p.is_active); - - if (!activeProvider) { - toast( - "No active LLM provider found. Please configure one in settings.", - "error", - ); - return; - } - await api.postApi("/tasks", { plugin_id: "llm_dashboard_validation", params: { dashboard_id: dashboard.id.toString(), environment_id: environmentId, - provider_id: activeProvider.id, }, });