There was an error while loading. Please reload this page.
2 parents 786fa3d + 243d82c commit 9543340Copy full SHA for 9543340
1 file changed
lib/crewai/src/crewai/agents/parser.py
@@ -173,7 +173,12 @@ def _safe_repair_json(tool_input: str) -> str:
173
tool_input = tool_input.replace('"""', '"')
174
175
result = repair_json(tool_input)
176
- if result in UNABLE_TO_REPAIR_JSON_RESULTS:
+ if not result or result in UNABLE_TO_REPAIR_JSON_RESULTS:
177
+ return tool_input
178
+
179
+ # json-repair >= 0.60 wraps non-JSON input in a single-element list;
180
+ # treat that as unrepairable and return the original.
181
+ if result.startswith("[") and not tool_input.lstrip().startswith("["):
182
return tool_input
183
184
return str(result)
0 commit comments