dograh/api/services/workflow
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
..
node_specs feat: add Tuner Integration to Dograh (#311) 2026-05-20 14:37:33 +05:30
qa fix(qa): tolerate non-dict JSON from QA LLM instead of crashing (#408) 2026-06-19 14:10:53 +05:30
tools feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
__init__.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
audit.py feat: add Tuner Integration to Dograh (#311) 2026-05-20 14:37:33 +05:30
disposition_mapper.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
dto.py feat: persist split user and bot audio 2026-06-16 15:19:49 +05:30
duplicate.py chore: fix duplicate workflow issue 2026-04-24 13:17:04 +05:30
errors.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
layout.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
mcp_tool_session.py chore: update pipecat to 1.3.0 (#379) 2026-05-29 16:19:42 +05:30
node_data.py feat: add Tuner Integration to Dograh (#311) 2026-05-20 14:37:33 +05:30
pipecat_engine.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
pipecat_engine_callbacks.py feat: abort immediately on max call duration exceed 2026-05-31 13:21:37 +05:30
pipecat_engine_context_composer.py feat(mcp): generic MCP tool source with per-node function filtering (#301) 2026-05-19 16:10:00 +05:30
pipecat_engine_context_summarizer.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
pipecat_engine_custom_tools.py feat: add ultravox realtime and fix signature issue in telephony (#345) 2026-05-23 12:51:55 +05:30
pipecat_engine_variable_extractor.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
run_usage_response.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
text_chat_logs.py feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30
text_chat_runner.py chore: bump pipecat submodule to 1.4.0 2026-06-18 12:17:36 +05:30
text_chat_session_service.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
trigger_paths.py fix(workflow): detect duplicate trigger paths when first node has no id (#409) 2026-06-19 13:53:34 +05:30
workflow_graph.py feat(mcp): add search_docs tool over docs corpus (closes #295) (#316) 2026-05-20 18:20:35 +05:30