Skip to content

fix(skill): skip duplicate skill warning when same file is loaded twice #26709

@ziuus

Description

@ziuus

Description

When OpenCode starts (including when started by Kimaki), it logs many false-positive "duplicate skill name" warnings where the existing and duplicate paths are identical:

WARN service=skill name=gws-gmail-read existing=/home/user/.agents/skills/gws-gmail-read/SKILL.md duplicate=/home/user/.agents/skills/gws-gmail-read/SKILL.md duplicate skill name

The same physical skill file is being discovered through multiple scan paths (e.g., global ~/.agents/skills/ and project-level .agents/skills/ when working directory is under home). The add function logs a warning and then overwrites the same entry in the map.

Expected Behavior

  • Loading the exact same file path twice should be silently skipped (no warning, no redundant processing)
  • Warnings should only be shown when two different files have the same skill name

Actual Behavior

Every skill file that gets discovered via multiple scan paths produces a useless warning where existing === duplicate.

Fix

In packages/opencode/src/skill/index.ts, the add function should check if the parsed skill file path matches an already-loaded one before warning:

if (state.skills[parsed.data.name]) {
  if (state.skills[parsed.data.name].location === match) return
  log.warn("duplicate skill name", { ... })
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions