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

Fix circular import by moving AttachConversationMiddleware to separate module #6454

Closed
wants to merge 1 commit into from

Conversation

malhotra5
Copy link
Contributor

@malhotra5 malhotra5 commented Jan 24, 2025

This PR fixes a circular import issue between middleware.py, shared.py, and openhands_config.py by:

  1. Creating a new file conversation_middleware.py containing the AttachConversationMiddleware class
  2. Removing the AttachConversationMiddleware class and its imports from middleware.py
  3. Updating openhands_config.py to import AttachConversationMiddleware from the new location

This breaks the circular dependency by establishing a clear dependency direction without cycles.


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

@malhotra5 malhotra5 closed this Jan 27, 2025
@malhotra5 malhotra5 deleted the fix-circular-import branch January 27, 2025 22:13
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