-
Notifications
You must be signed in to change notification settings - Fork 105
feat(plugin): Load commands as keyword-triggered skills #1676
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
Draft
jpshackelford
wants to merge
7
commits into
main
Choose a base branch
from
feat/plugin-commands-as-skills
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements #1645 - adds the ability to fetch plugins from remote sources (GitHub repositories, git URLs) and cache them locally. Changes: - Add Plugin.fetch() classmethod to fetch from remote sources - Add parse_plugin_source() to parse various source formats: - GitHub shorthand: 'github:owner/repo' - Git URLs: HTTPS, SSH, git:// protocol - Local paths (returned as-is) - Add PluginFetchError exception for fetch failures - Implement caching at ~/.openhands/cache/plugins/ - Support shallow clones for efficiency - Support specific ref (branch/tag/commit) checkout - Add comprehensive unit tests (34 new tests) Co-authored-by: openhands <[email protected]>
- Add blank line after imports in fetch.py - Remove unused import PluginFetchError in plugin.py - Reformat long lines in test file Co-authored-by: openhands <[email protected]>
- Add plugin_source and plugin_ref fields to StartConversationRequest - Add _load_and_merge_plugin() method to fetch and load plugins - Add _merge_plugin_into_request() method to merge plugin skills and MCP config - Plugin skills override existing skills with the same name - Plugin MCP config is merged with existing config - Add comprehensive tests for plugin loading scenarios Closes #1650
Plugin commands from the commands/ directory are now converted to keyword-triggered skills and merged into the agent context. Changes: - Add CommandDefinition.to_skill() method that converts a command to a Skill with a KeywordTrigger using Claude Code namespace format: /<plugin-name>:<command-name> - Add Plugin.get_all_skills() method that returns all skills from both skills/ and commands/ directories - Update _merge_plugin_into_request() to use get_all_skills() so commands are included when merging plugin content Example: For a plugin 'city-weather' with command 'now.md': - Trigger keyword: '/city-weather:now' - When user types '/city-weather:now Tokyo', the skill activates Closes #1674 Co-authored-by: openhands <[email protected]>
Contributor
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
- Fix line too long in log message - Add None check for allowed_tools in test Co-authored-by: openhands <[email protected]>
Co-authored-by: openhands <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Plugin commands from the
commands/directory are now automatically converted to keyword-triggered skills and merged into the agent context.This enables Claude Code format plugins that use
commands/(which is the standard location for slash commands) to work correctly with OpenHands - the agent now receives the command instructions as skills.Changes
CommandDefinition.to_skill()method that converts a command to aSkillwith aKeywordTriggerusing Claude Code namespace format:/<plugin-name>:<command-name>Plugin.get_all_skills()method that returns all skills from bothskills/andcommands/directories_merge_plugin_into_request()to useget_all_skills()so commands are included when merging plugin contentExample
For a plugin named
city-weatherwith a commandnow.md:/city-weather:now/city-weather:now Tokyo, the skill activates with$ARGUMENTS=TokyoTesting
CommandDefinition.to_skill()Plugin.get_all_skills()_merge_plugin_into_request()with commandsAll tests pass:
Closes #1674
@jpshackelford can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:038f92e-pythonRun
All tags pushed for this build
About Multi-Architecture Support
038f92e-python) is a multi-arch manifest supporting both amd64 and arm64038f92e-python-amd64) are also available if needed