diff --git a/src/crewai/agents/parser.py b/src/crewai/agents/parser.py index 05c5bc0034..88a869c160 100644 --- a/src/crewai/agents/parser.py +++ b/src/crewai/agents/parser.py @@ -136,7 +136,7 @@ def _extract_thought(self, text: str) -> str: def _clean_action(self, text: str) -> str: """Clean action string by removing non-essential formatting characters.""" - return re.sub(r"^\s*\*+\s*|\s*\*+\s*$", "", text).strip() + return text.strip().strip("*").strip() def _safe_repair_json(self, tool_input: str) -> str: UNABLE_TO_REPAIR_JSON_RESULTS = ['""', "{}"]