Skip to content

Conversation

@ThewindMom
Copy link

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

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node
Copy link
Collaborator

that skill is valid in other agents and will be picked up ours ig needs to handle the “invalid yaml” and convert it or wrap it before parsing if possible

@ThewindMom
Copy link
Author

that skill is valid in other agents and will be picked up ours ig needs to handle the “invalid yaml” and convert it or wrap it before parsing if possible

Added a YAML fixer that automatically quotes unquoted values containing colons and other special characters before parsing, so skills from other agents work in OpenCode. Try parsing original content first, then fall back to fixed content if it fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal operation error

2 participants