dograh/api/services/workflow/qa
Mubashir Rahim 6ae9ba5d9e fix(qa): tolerate non-dict JSON from QA LLM instead of crashing
parse_llm_json is explicitly designed to return a list when the model emits a
top-level JSON array (it has a dedicated test for that). The QA analyzers then
call parsed.get("tags", ...) directly on the result. When parsed is a list,
that raises AttributeError, which is NOT caught by the surrounding
except (json.JSONDecodeError, ValueError) — so a single stray array response
from the QA model crashed the entire QA analysis run instead of degrading to
empty results.

The live variable-extraction path already guards this exact case with an
isinstance(..., dict) check; mirror it in both QA analysis call sites
(_run_qa_analysis per-node and _run_whole_call_qa_analysis fallback) so a
non-dict parse result coerces to {} and the run produces empty defaults.

Adds a regression test that drives the whole-call analyzer with an array
response and asserts empty results rather than a crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 14:24:03 +05:00
..
__init__.py feat: run per node QA 2026-02-25 17:17:48 +05:30
analysis.py fix(qa): tolerate non-dict JSON from QA LLM instead of crashing 2026-06-03 14:24:03 +05:00
conversation.py fix: safe parse timestamp 2026-02-25 22:59:19 +05:30
llm_config.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
metrics.py feat: run per node QA 2026-02-25 17:17:48 +05:30
node_summary.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
tracing.py feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30