Repository navigation
fix(agent-guard): discover skill guards on a marketplace install - #1762
Merged
Merged
Conversation
A marketplace caches every plugin on its own, as <marketplace>/<plugin>/<version>/, so the published magpie-agent-guard plugin has no framework tree above it and framework_root() is None there. The skill-owned guards (mention, mark-ready, security-language) were therefore never discovered on a marketplace install, leaving only the bundled guards.d active. When there is no framework tree, the engine now scans the skills/*/guards of the family plugins cached beside its own, using each one's copy at the engine's own version (the families are released together), else its most recently installed version. Generated-by: Claude Opus 5
potiuk
enabled auto-merge (squash)
October 22, 2026 23:56
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
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.
A marketplace caches every plugin on its own, as
<marketplace>/<plugin>/<version>/, so the publishedmagpie-agent-guardplugin has no framework tree above it andframework_root()returnsNonethere.The skill-owned guards (
mention,mark_ready,security_language) were therefore never discovered on a marketplace install — only the bundledguards.dran.#1757 fixed discovery for checkouts and snapshots; this closes the remaining marketplace case, raised in its review.
Summary
installed_plugin_guard_dirs(): when the engine runs from<marketplace>/magpie-agent-guard/<version>/(no framework tree), scanskills/*/guardsof the sibling family plugins in the same cache.framework_root()still wins, andplugins/in a checkout is never mistaken for a plugin cache.tools/agent-guard/README.mdand the marketplace-distribution spec updated.Test plan
tools/agent-guard/tests/test_discovery.pyon a fake plugin cache: siblings discovered, own version preferred over a newer leftover, latest-install fallback, a checkout never scans a cache.tools/agent-guardsuite passes.prekhooks pass on the changed files.Gen-AI disclosure
Generated with Claude Code (Claude Opus 5); reviewed by the committer.
🤖 Generated with Claude Code