Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/crewai/src/crewai/agents/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ def _safe_repair_json(tool_input: str) -> str:
tool_input = tool_input.replace('"""', '"')

result = repair_json(tool_input)
if result in UNABLE_TO_REPAIR_JSON_RESULTS:
if not result or result in UNABLE_TO_REPAIR_JSON_RESULTS:
return tool_input

# json-repair >= 0.60 wraps non-JSON input in a single-element list;
# treat that as unrepairable and return the original.
if result.startswith("[") and not tool_input.lstrip().startswith("["):
return tool_input

return str(result)
Loading