anomalyco / anomalyco/opencode

Skill commands appear in random order in the slash command picker

Open
#43,397 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 19, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

In the desktop app (and TUI) slash command picker, skills are listed in a random/non-deterministic order instead of alphabetical order. The order changes between sessions because skill loading is fully concurrent.

Root cause
  • command.list() in packages/opencode/src/command/index.ts returns Object.values(s.commands) with no sorting.
  • Skills are appended to the commands map from skill.all(), which returns Object.values(s.skills) unsorted (packages/opencode/src/skill/index.ts).
  • Skill frontmatter parsing happens with concurrency: "unbounded", so the insertion order (and therefore the displayed order) is nondeterministic.

Meanwhile the model-facing listing (Skill.available() / fmt()) already sorts alphabetically via toSorted((a, b) => a.name.localeCompare(b.name)), so the inconsistency is only in the UI path.

Reproduction
  1. Run opencode desktop (or TUI) with multiple installed skills.
  2. Type / to open the slash command picker.
  3. Observe skill entries appear in arbitrary order, varying across restarts.
Expected behavior

Skills (ideally all commands) are listed in deterministic alphabetical order.

Suggested fix

Sort in command.list():

const list = Effect.fn("Command.list")(function* () {
  const s = yield* InstanceState.get(state)
  return Object.values(s.commands).toSorted((a, b) => a.name.localeCompare(b.name))
})
Environment
  • opencode latest
  • macOS desktop app

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.