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

Agent session no longer stuck in starting on raised exception #6703

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Feb 12, 2025

Now making sure that the starting flag is no longer left in a True state if an error is thrown while starting

  • [] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Improves agent session error handling in two ways:

  1. Ensures the starting flag is properly reset when an exception occurs during startup, preventing the session from getting stuck in a "starting" state
  2. Adds proper error handling for unknown errors from start_or_attach_to_runtime, ensuring HTTP sessions are properly closed in all error cases

These changes prevent unnecessary waits during local shutdown and improve the overall robustness of the session management.


Link of any specific issues this addresses


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:0f34af3-nikolaik   --name openhands-app-0f34af3   docker.all-hands.dev/all-hands-ai/openhands:0f34af3

@tofarr tofarr marked this pull request as ready for review February 12, 2025 16:48
Sometimes the call to start_or_attach_to_runtime throws unkown errors, and in this case the http session was getting left in an open state. We now close the runtime in this case
@tofarr tofarr merged commit cb5e7f0 into main Feb 13, 2025
13 checks passed
@tofarr tofarr deleted the fix-agent-session-stuck-in-starting branch February 13, 2025 12:24
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.

2 participants