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

Improve agent loop tracking and make concurrent limit configurable #6944

Closed
wants to merge 0 commits into from

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Feb 25, 2025

This PR improves how we track and manage concurrent agent loops:

  • Add max_concurrent_conversations to AppConfig (default: 3)
  • Add start_time tracking to Session class
  • Use accurate start time to determine oldest session when limit is reached

Previously, when the limit of concurrent agent loops was reached, the system would try to guess which was the oldest by reversing the list of session IDs. This was inaccurate. Now we track the actual start time of each session and use that to accurately determine which session is the oldest when we need to close one.

The limit of 3 concurrent conversations has also been moved from a hardcoded constant to a configurable value in AppConfig.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:6eaa039-nikolaik   --name openhands-app-6eaa039   docker.all-hands.dev/all-hands-ai/openhands:6eaa039

@rbren rbren closed this Feb 25, 2025
@rbren rbren force-pushed the improve-agent-loop-tracking branch from 6eaa039 to 6ba79c4 Compare February 25, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant