Skip to content

fix(opencode): stabilize duplicate skill discovery - #32203

Closed
ualtinok wants to merge 2 commits into
anomalyco:devfrom
ualtinok:stable-skill-dedupe
Closed

ualtinok wants to merge 2 commits 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 0b533db to bbb6515 Compare July 7, 2026 08:56
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@github-actions github-actions Bot closed this Jul 13, 2026
randomvariable added a commit to randomvariable/opencode that referenced this pull request Aug 3, 2026
Sort scan matches and discovered directories, and load skills sequentially
instead of with unbounded concurrency, so that duplicate skill names resolve
deterministically by source precedence (.opencode overrides .claude) rather
than by nondeterministic load order.

Ported from anomalyco#32203 (already Effect-based; applied as-is).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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