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

refactor: restructure microagents system #5886

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Dec 28, 2024

This PR restructures the microagents system to provide a clearer separation between repository-specific instructions and shareable microagents.

Key Changes

  1. Two Sources for Instructions

    • Repository Instructions: .openhands/microagents/repo.md in each repository
      • Private to each repository
      • Repository-specific guidelines
      • Team practices and conventions
    • Shareable Microagents: OpenHands/microagents/
      • Available to all users
      • Reusable knowledge and workflows
      • Maintained in OpenHands repository
  2. Simplified Hub Structure

    OpenHands/microagents/
    ├── knowledge/  # Keyword-triggered expertise
    └── tasks/     # Interactive workflows
    
  3. Documentation

    • Clear separation between private and shareable content
    • Better examples and guidelines
    • Clearer contribution process
    • Loading order explanation
  4. Code Changes

    • New microagent models with validation
    • Support for both knowledge and task agents
    • Improved loading and matching system
    • Comprehensive test coverage

Migration Notes

  • Move repository-specific instructions to .openhands/microagents/repo.md in each repository
  • Convert shareable agents to new YAML format
  • Keep private content in repositories, share reusable knowledge in OpenHands

Part of #5538 and #5826


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

- Move microagents to root level directory
- Convert existing agents to YAML format
- Add support for repository and keyword triggers
- Add template-based workflow support
- Remove old micro directory
- Add MicroAgentHub for centralized agent management
- Support repository and keyword triggers
- Add template-based agent support
- Update base.py to use new system
- Add tests for knowledge agent validation
- Add tests for template agent validation
- Add tests for agent loading and matching
- Add tests for template processing
- Keep legacy microagent test
- Add environment variable testing to new agents
- Add comprehensive tests for new microagent system
- Move all tests to tests/unit
- Remove repo/ directory (should be in individual repos)
- Move keyword agents to knowledge/ directly
- Update documentation to reflect new structure
- Remove official/community split
- Rename templates to tasks
- Move all agents to top-level categories
- Update documentation
- Convert all YAML files to markdown with frontmatter
- Improve readability with better formatting
- Keep YAML metadata in frontmatter
- Add better examples and documentation
- Update format guidelines to show markdown with frontmatter
- Add better examples for both agent types
- Show recommended structure for content
- Add markdown parsing with YAML frontmatter
- Update models to handle markdown content
- Rename template to task for clarity
- Add better input validation
- Update tests for new format
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