opencode
opencode copied to clipboard
fix(opencode): gracefully handle malformed skill YAML frontmatter
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:
- Created a skill file with invalid YAML:
--- name: completion-check description: Completion Check: Verify Infrastructure Is Wired ---
(unquoted colon in description value)
- Ran bun dev, typed a message and sent it - previously crashed with ConfigFrontmatterError, now works
- Confirmed warning appears in ~/.local/share/opencode/log/dev.log