dograh/api/services
Mubashir R 6e194f4b59
fix(qa): tolerate non-dict JSON from QA LLM instead of crashing (#408)
* 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>

* fix(qa): log non-object QA JSON responses

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
2026-06-19 14:10:53 +05:30
..
auth feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
campaign feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
configuration feat: add Inworld TTS provider support (#420) 2026-06-19 13:23:27 +05:30
filesystem chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
gen_ai feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
gender Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
integrations fix timestamps in tuner accumelator (#335) 2026-05-21 07:43:50 +05:30
pipecat feat: add Inworld TTS provider support (#420) 2026-06-19 13:23:27 +05:30
reports feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
telephony feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
voice_prompting_guide feat: add mcp guides for various topic and stages for bot building (#380) 2026-05-31 16:07:32 +05:30
worker_sync feat: add worker sync events 2026-04-04 14:26:47 +05:30
workflow fix(qa): tolerate non-dict JSON from QA LLM instead of crashing (#408) 2026-06-19 14:10:53 +05:30
managed_model_services.py feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
mps_billing.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
mps_service_key_client.py fix: validate workflow status filter to prevent 500 on invalid enum value (#450) 2026-06-18 08:39:59 +05:30
organization_context.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
organization_preferences.py feat: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +05:30
posthog_client.py feat: add posthog signup and signin events, enable backend posthog events for oss version (#249) 2026-04-24 12:02:52 +05:30
quota_service.py feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
storage.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
tool_management.py feat: create tools using MCP 2026-05-31 16:50:44 +05:30
user_onboarding.py feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
workflow_run_billing.py chore: bump pipecat submodule to 1.4.0 2026-06-18 12:17:36 +05:30