Crew hangs for 10 minutes without providing a final answer or raising an error when an agent with the allow_code_execution parameter set to True is executed

@agent
  def chart_generation_agent(self) -> Agent:
    return Agent(
      config = self.agents_config['chart_generation_agent'],
        allow_code_execution=True,
      llm=self.llm
      
)

allow_code_execution=True , requires docker, i have docker installed and engine running and when i kickoff the crew when the task of the generation of charts, it gets stuck.
by the way without the :
allow_code_execution=True , the agent generates perfect code but without executing
and with allow execution the task just starts and nothing happened it gets stuck.

this is an example of what i’m getting

Agent: chart specialist

Task: ( task of the agent )

What does that mean? What output do you see in the terminal? What error do you see in the terminal?

it simply stuck in this status, everytime i have to interrupt the terminal with cmd+c to stop the process.

How long have you waited before interrupting the process? This is quite a complex task, which might take more time to get the final answer. That’s why I asked you what you mean by saying “it gets stuck”, because that never happened to me before. I suggest you leave it as long as it takes to get some output in the terminal. You should get a final answer or an error.

I leaved the code for more than 10 min and nothing happened , i don’t know why :confused:
the allow_code_execution=True works only with docker right ?
can i do it with another method or tool. like the CodeInterpreterTool tool

I think the task is too complex. Try to break this giant task into multiple small ones.

Yes, correct.

When you set the allow_code_execution parameter to True, it uses the CodeInterpreterTool as an internal code execution tool in the background. See the docs. As I said, most probably the task is too complex. Break it down into multiple small ones.

1 Like