OpenHands
OpenHands copied to clipboard
Feat: Microagents Support for Resolver
What problem or use case are you trying to solve?
Perhaps I am mistaken, but it appears that neither .openhands/microagents/repo.md
nor microagent markdowns in .openhands/microagents/knowledge/
nor .openhands/microagents/tasks/
are recognized and used by the Resolver.
Describe the UX of the solution you'd like The Resolver should:
- Automatically detect and load microagents from
.openhands/microagents/
and its subdirectories (repo.md
,knowledge/
, andtasks/
) without manual configuration, which may be several steps into the Resolver's thinking process. - Trigger knowledge agents contextually based on keywords detected in conversations or file content.
- Emit directly or indirectly in the action output logs microagents.
- Display errors or warnings if microagents have invalid syntax or fail to load, ensuring users can troubleshoot issues.
Do you have thoughts on the technical implementation?
-
Loading Microagents:
- Implement a directory scanning feature in the Resolver to locate and parse files in
.openhands/microagents/
. - Use YAML parsers to validate and load metadata from the frontmatter of each microagent file.
- Prioritize loading order:
-
repo.md
for repository-specific settings. -
knowledge/
for context-based knowledge triggers. -
tasks/
for interactive workflows.
-
- Implement a directory scanning feature in the Resolver to locate and parse files in
-
Integration with OpenHands:
- Enhance the Resolver logic to allow dynamic activation of microagents based on triggers (e.g., keywords).
- Treat the thinking Resolver agent as the user for task agents
- Maintain a cache of loaded microagents for quick access and reduce redundant parsing.
-
Testing:
- Write unit tests for the Resolver to cover edge cases like missing directories or invalid microagent structures.
- Create integration tests to ensure microagents interact correctly within OpenHands workflows.
Describe alternatives you've considered
- Manual Configuration: Duplicate the frontmatter from all microagents into .openhands_instructions. This approach is less user-friendly and increases the risk of misconfiguration.