Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When setting max_execution_time=1 for an Agent, the timeout is not being enforced as expected. The task continues to run without timing out after 1 second. #2379

Open
cdtl22 opened this issue Mar 16, 2025 · 0 comments · May be fixed by #2388
Labels
bug Something isn't working

Comments

@cdtl22
Copy link

cdtl22 commented Mar 16, 2025

Description

Create an Agent with max_execution_time=1 and assign a task that takes longer than 1 second to complete and Observe that the task continues to run without timing out

Environment:

  • CrewAI version: version 0.105.0
  • Python version: 3.12.9
  • Operating System: Ubuntu 24.04.1 LTS

Steps to Reproduce

  1. project created following the steps from https://docs.crewai.com/quickstart
  2. crewai create crew example
  3. max_execution_time is set to 1 second
	@agent
	def researcher(self) -> Agent:
		return Agent(
			config=self.agents_config['researcher'],
			verbose=True,
			max_execution_time=1      # should only be 1 second
		)
  1. The task continues to run without timing out despite exceeding 1 second. (current run takes 37 seconds)

Expected behavior

The task should timeout after 1 second.

Screenshots/Code snippets

The duration between the two timestamps is 37.10 seconds

[2025-03-16 22:05:47][🤖 LLM CALL STARTED]: 2025-03-16 22:05:47.530395
 
[2025-03-16 22:06:24][✅ LLM CALL COMPLETED]: 2025-03-16 22:06:24.633524

Operating System

Ubuntu 20.04

Python Version

3.12

crewAI Version

0.105.0

crewAI Tools Version

0.37.0

Virtual Environment

Venv

Evidence

No error messages

Possible Solution

None

Additional context

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant