From e1b83942650d36f66d3b3a67ef4d9da13bbf82d9 Mon Sep 17 00:00:00 2001 From: "Brandon Hancock (bhancock_ai)" <109994880+bhancockio@users.noreply.github.com> Date: Wed, 26 Mar 2025 11:25:10 -0400 Subject: [PATCH] Fixed (#2481) Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com> --- src/crewai/utilities/events/utils/console_formatter.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crewai/utilities/events/utils/console_formatter.py b/src/crewai/utilities/events/utils/console_formatter.py index 3d3e03149..618238ec3 100644 --- a/src/crewai/utilities/events/utils/console_formatter.py +++ b/src/crewai/utilities/events/utils/console_formatter.py @@ -507,9 +507,10 @@ class ConsoleFormatter: # Remove the thinking status node when complete if "Thinking" in str(tool_branch.label): - agent_branch.children.remove(tool_branch) - self.print(crew_tree) - self.print() + if tool_branch in agent_branch.children: + agent_branch.children.remove(tool_branch) + self.print(crew_tree) + self.print() def handle_llm_call_failed( self, tool_branch: Optional[Tree], error: str, crew_tree: Optional[Tree] @@ -587,6 +588,7 @@ class ConsoleFormatter: for child in flow_tree.children: if "Running tests" in str(child.label): child.label = Text("✅ Tests completed successfully", style="green") + break self.print(flow_tree) self.print()