feat(examples): add plugin and skill lifecycle demos#2362
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
API breakage checks (Griffe)Result: Passed |
Agent server REST API breakage checks (OpenAPI)Result: Failed Log excerpt (first 1000 characters) |
|
@OpenHands Understand what this PR adds (read linked issue too). Check what examples do we have in examples/ directory working with plugins and what they do. I'm concerned about redundancy and too many slightly relevant examples, not relevant enough to warrant a new example file, maybe? Could we add enable / disable information to some existing example, either for plugins or for skills or both? Actually do we already do some enable / disable in some pre-existing example? I have a feeling I've seen that... |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
I reviewed the PR, the linked issue, and the existing plugin/skill examples. Final answer: the PR adds three new runnable lifecycle examples:
I confirmed that the underlying coverage requested by the issue is genuinely missing today: existing examples cover skill activation, skill loading, marketplace installation, and plugin install/load/uninstall, but none of the pre-existing examples demonstrate persistent installed enable/disable state via The likely example you were remembering is My conclusion was:
So the concern about redundancy is valid, but the lifecycle coverage itself is still needed. The best simplification would be consolidation, not removal. |
- merge plugin enable/disable into the existing plugin example - replace split skill lifecycle demos with one installed-skill example Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands read this entire PR comments; understand the goal. Fix the PR description if necessary. Look up the docs/ repo (clone it for yourself) and make sure the companion docs PR is up to date with what this PR is doing. Push. Then test the examples manually, with gpt-5-nano and your openai key. Verify if they work and confirm every function or fix if not. Publish your results when I tell you to summarize. I mean it: in this session, when I tell you to summarize, don't summarize, repeat verbatim what you told me. |
|
I'm on it! enyst can track my progress at all-hands.dev |
Co-authored-by: openhands <openhands@all-hands.dev>
|
Done.
Manual validation results:
Also:
When you tell me to summarize, I’ll repeat this verbatim. |
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Good lifecycle documentation, but there's a critical bug that will break the skill example.
The plugin example refactoring looks solid - moving skill inspection after send_message() correctly handles lazy loading, and the early-continue pattern is cleaner. The new skill lifecycle example mirrors this well, which is good for consistency.
However, there's a copy-paste bug in the skill example that will cause it to fail. See inline comment.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean, pragmatic examples that correctly demonstrate the lifecycle APIs.
What works well:
- Correctly handles lazy loading (skills/plugins inspected after
send_message()) - Previous
enable_pluginvsenable_skillbug is already fixed - Clear demonstration of
.installed.jsonmetadata format for CLI developers - Appropriate assertions verify behavior at each step
- Early-continue patterns keep nesting shallow
Minor note:
The skill example ends with print("\nEXAMPLE_COST: 0") while the plugin example doesn't. This might matter if these are run in CI for cost tracking, though it could be intentional since the plugin example has optional LLM interaction with variable cost.
✅ Verdict: Worth merging - solid examples for real use cases.
Summary
Closes #2339.
examples/05_skills_and_plugins/02_loading_plugins/main.py, including persistent install metadata, enable/disable, and uninstall flowsexamples/05_skills_and_plugins/03_managing_installed_skills/main.pyfor installed skill enable/disable + uninstall lifecycle flows.installed.jsonenabledstate so the CLI has concrete reference examples for lifecycle commandsopenhands.sdk.pluginandopenhands.sdk.skillsexports plus targeted lifecycle tests/plugintracking already exists in [CLI] Feature Request: Support /plugin command for installing skills OpenHands-CLI#405, and/skilllifecycle command tracking is now in [CLI] Feature Request: Support /skill lifecycle commands for installed AgentSkills OpenHands-CLI#582Checklist
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.13-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:eac2c4d-pythonRun
All tags pushed for this build
About Multi-Architecture Support
eac2c4d-python) is a multi-arch manifest supporting both amd64 and arm64eac2c4d-python-amd64) are also available if needed