opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(opencode): gracefully handle malformed skill YAML frontmatter

Open ThewindMom opened this issue 4 days ago • 3 comments

Fixes #7582

When a skill file (from ~/.claude/skills/ or project .claude/skills/) has invalid YAML frontmatter, OpenCode crashes with ConfigFrontmatterError after sending a message (see #7582). As @paulp-o noted, malformed config files can cause this terminal operation error.

This change catches the error and logs a warning instead, allowing OpenCode to continue loading other skills.

How I verified:

  1. Created a skill file with invalid YAML:
    ---
    name: completion-check
    description: Completion Check: Verify Infrastructure Is Wired
    ---
    

(unquoted colon in description value)

  1. Ran bun dev, typed a message and sent it - previously crashed with ConfigFrontmatterError, now works
  2. Confirmed warning appears in ~/.local/share/opencode/log/dev.log

ThewindMom avatar Jan 10 '26 18:01 ThewindMom