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: Add microagent knowledge integration to resolver workflow #6867

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

Conversation

h55nick
Copy link

@h55nick h55nick commented Feb 20, 2025

Fixes #6191

This PR adds integration between the resolver workflow and microagent knowledge system.

Changes

  • Add microagent trigger checking in resolver's
  • Use for consistent trigger handling
  • Add tests verifying microagent integration with examples

Implementation Details

  • Uses existing microagent trigger system
  • Checks all issue content (body, comments, review threads) for triggers
  • Maintains consistency with how microagents are used elsewhere
  • No new microagents needed - uses existing knowledge agents

Testing

Added tests that verify:

  1. Knowledge is included when triggers match
  2. Knowledge is excluded when no triggers match
  3. Triggers work across issue body and comments

Example

If an issue mentions 'flarglebargle', and we have a knowledge microagent with that trigger, its knowledge will be included in the resolver context.

h55nick and others added 2 commits February 20, 2025 19:18
- Add microagent trigger checking in resolver's get_context_from_external_issues_references
- Use KnowledgeMicroAgent.match_trigger for consistent trigger handling
- Add tests verifying microagent integration with examples
@h55nick
Copy link
Author

h55nick commented Feb 20, 2025

@malhotra5 do you mind taking a look? and maybe @mamoodi do you mind taking a look?

Here is the forked PR: h55nick#5 with linting/tests passing

content = ' '.join(content_parts)

# Add knowledge from microagents that have matching triggers
from openhands.agenthub.micro.registry import all_microagents
Copy link
Collaborator

@enyst enyst Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think there is a strange thing here. This registry gets agenthub old micro, and not the .openhands/microagents here.

I know, this is confusing, sorry about that. I think we may rename some more or something to make it less confusing.

I'm not really sure why the (knowledge/etc) microagents don't get loaded automatically when starting from the resolver. 🤔 For example, code like this should do the job when starting CLI environments. Maybe that isn't executed?

Edited to add:
I think this is how they're loaded in a run with the web UI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good place in the resolver, to plug in something like the above:\

# Check for .openhands_instructions file in the workspace directory

The `.openhands_instructions' are the legacy way of customizing the prompt, and it should not be necessary in the resolver anyway anymore, because it's done in the runtime.

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.

Feat: Microagents Support for Resolver
2 participants