[PR #7684] fix(opencode): gracefully handle malformed skill YAML frontmatter #12477

Open
opened 2026-02-16 18:17:23 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7684

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7684 **State:** open **Merged:** No --- 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: ```yaml --- name: completion-check description: Completion Check: Verify Infrastructure Is Wired --- (unquoted colon in description value) 2. Ran bun dev, typed a message and sent it - previously crashed with ConfigFrontmatterError, now works 3. Confirmed warning appears in ~/.local/share/opencode/log/dev.log
yindo added the pull-request label 2026-02-16 18:17:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12477