Skip to content

fix(opencode): stabilize duplicate skill discovery#32203

Open
ualtinok wants to merge 1 commit into
anomalyco:devfrom
ualtinok:stable-skill-dedupe
Open

fix(opencode): stabilize duplicate skill discovery#32203
ualtinok wants to merge 1 commit into
anomalyco:devfrom
ualtinok:stable-skill-dedupe

Conversation

@ualtinok

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #32202

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Makes duplicate skill discovery deterministic.

The skill catalog already renders sorted by skill name, but duplicate skill names were resolved while loading files with unbounded concurrency. Since duplicate names overwrite the previous entry, whichever file finished loading last won. That made the selected skill location unstable across restarts when the same skill name existed in multiple roots.

This PR sorts matches within each scan and loads discovered skill files in discovery order, preserving the existing source precedence while removing the I/O race.

How did you verify your code works?

  • bun test test/skill/skill.test.ts
  • bun typecheck

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate found:

@ualtinok ualtinok force-pushed the stable-skill-dedupe branch from 3f27d94 to 4e5f471 Compare June 14, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skill duplicate roots can change available_skills across restarts

1 participant