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

@@ -634,8 +634,8 @@ async def websocket_endpoint(
extra={"task_id": task_id, "message": result.message},
)
await asyncio.sleep(2)
except (WebSocketDisconnect, StopIteration):
if isinstance(StopIteration):
except (WebSocketDisconnect, StopIteration) as _ws_exc:
if isinstance(_ws_exc, StopIteration):
# Task reached terminal state — close cleanly with code 1000
try:
await websocket.close(code=1000, reason="Task completed")