fix: _parse_llm_response now handles empty/invalid JSON gracefully
test: add gap coverage tests (hina_agent/JCL/quality gate edge cases)
This commit is contained in:
+5
-2
@@ -151,8 +151,11 @@ def _parse_llm_response(raw: str) -> dict:
|
||||
end = text.index("```", start) if "```" in text[start:] else len(text)
|
||||
text = text[start:end].strip()
|
||||
|
||||
parsed = json.loads(text)
|
||||
return _validate_result(parsed)
|
||||
try:
|
||||
parsed = json.loads(text)
|
||||
return _validate_result(parsed)
|
||||
except (json.JSONDecodeError, ValueError):
|
||||
return _validate_result({})
|
||||
|
||||
|
||||
def _validate_result(parsed: dict) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user