fix(compat): prioritize PUBLIC/GLOBAL skills in legacy slug lookup - #750
Merged
Merged
Conversation
myml
force-pushed
the
fix/compat-public-skills-priority
branch
from
August 24, 2026 09:03
98a4505 to
d8ebf15
Compare
Member
|
Prioritizing PUBLIC + GLOBAL for bare-slug (no
|
myml
force-pushed
the
fix/compat-public-skills-priority
branch
from
August 25, 2026 02:14
4767b6d to
701b050
Compare
When multiple skills share the same slug across namespaces, findByLegacySlug now prefers PUBLIC visibility and GLOBAL namespace over NAMESPACE_ONLY/PRIVATE ones, so plain slug lookups resolve to the most accessible skill. Namespaces are batch-fetched via findByIdIn to avoid N+1 database queries. Signed-off-by: wurongjie <wurongjie@uniontech.com>
myml
force-pushed
the
fix/compat-public-skills-priority
branch
from
August 25, 2026 02:27
701b050 to
32d5de7
Compare
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
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.
What
Change
findByLegacySlugto prefer PUBLIC visibility and GLOBAL namespace skills when multiple skills share the same slug.Why
When multiple skills share the same slug across namespaces, the previous implementation just returned the first match, which could be a private or namespace-only skill. For CLI users using plain slugs (without
@namespace/prefix), this could lead to unexpected "skill not found" errors or access to the wrong skill.The new priority order ensures:
How
Add a scoring system to
findByLegacySlug:The skill with the highest score is selected.
Testing
Impact