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 microagent loading with trailing slashes and nested directories #6239

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Jan 13, 2025

Fixes #6237

This PR fixes the issue with microagent loading when directory paths have trailing slashes. The solution:

  1. Refactors get_microagents_from_selected_repo to use the more robust load_microagents_from_dir function
  2. Adds test cases for:
    • Loading microagents from directories with trailing slashes
    • Loading microagents from nested directories

The fix is more general than just handling trailing slashes, as it uses the existing load_microagents_from_dir function which already handles various path formats correctly using Path objects and rglob.


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

- Refactor get_microagents_from_selected_repo to use load_microagents_from_dir
- Add tests for trailing slashes and nested directories
- Fix #6237
@xingyaoww xingyaoww marked this pull request as ready for review January 14, 2025 23:56
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.

[Bug]: Micro-agent doesn't work due to trailing slash in directory paths
2 participants