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

Feat - browser client can now close sessions. #6088

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 6, 2025

**Client can now instruct server to delete a running session. Added framework for commanding that a session stops. **

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

Give a summary of what the PR does, explaining any non-trivial design decisions

This PR fixes an issue where conversations could not be deleted while they were running. The changes include:

  • Modified delete_conversation to properly close the session when attempting to delete a running conversation instead of returning False
  • Added close_session method to SessionManager to handle session closing across the cluster
  • Refactored session closing logic to handle both local and remote session closures
  • Added handling for close_session message type in the session manager

Testing

To test:

  1. Start a conversation and let it run
  2. Try to delete the conversation while it is running
  3. Verify that the conversation is properly deleted and the session is closed
  4. Verify that this works across multiple nodes in a cluster setup

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

@tofarr tofarr changed the title Feat - can now demand session closes anywhere in the cluster Feat - browser client can now close sessions. Jan 6, 2025
@tofarr tofarr marked this pull request as ready for review January 6, 2025 20:23
@tofarr tofarr merged commit 9515ac5 into main Jan 6, 2025
14 checks passed
@tofarr tofarr deleted the fix-delete-conversation-stops-running branch January 6, 2025 21:26
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