feat(validation): chunk screenshots by max_images limit + fix websocket crash

- analyze_dashboard_multimodal now splits screenshots into chunks
  of max_images (from provider config) and sends them in parallel
- Results merged: worst status, deduped issues by (severity, msg, loc)
- New helper methods: _deduplicate_issues, _merge_chunk_results, _call_llm_for_images
- Plugin passes db_provider.max_images to the LLM client
- Report UI shows 'Chunked ×N' badge when analysis used multiple chunks
- i18n: added 'chunked' / 'По частям' key to validation.json
- Fix: isinstance(StopIteration) -> isinstance(_ws_exc, StopIteration)
  which crashed the websocket and broke task execution mid-flight
- Fix: update test mocks (_FakeLLMClient, _FakeScreenshotService)
This commit is contained in:
2026-05-31 22:43:06 +03:00
parent 9b938fcb81
commit 2760fa09ea
7 changed files with 134 additions and 18 deletions

View File

@@ -104,6 +104,10 @@ async def test_dashboard_validation_plugin_persists_task_and_environment_ids(
async def capture_dashboard(self, _dashboard_id, _screenshot_path):
return [], []
@staticmethod
def _cleanup_temp_files(_paths):
pass
# endregion _FakeScreenshotService
# region _FakeLLMClient [TYPE Class]
@@ -127,6 +131,22 @@ async def test_dashboard_validation_plugin_persists_task_and_environment_ids(
"issues": [],
}
async def analyze_dashboard_multimodal(self, *_args, **_kwargs):
return {
"status": "PASS",
"summary": "Dashboard healthy",
"issues": [],
}
async def analyze_dashboard_text_batch(self, *_args, **_kwargs):
return {
"dashboards": [{
"status": "PASS",
"summary": "Dashboard healthy",
"issues": [],
}],
}
# endregion _FakeLLMClient
# region _FakeNotificationService [TYPE Class]