You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invalid YAML in agent .md frontmatter silently ignored — agent loads with degraded config #24181
When an agent .md file contains invalid YAML frontmatter, OpenCode loads the
agent anyway — but all frontmatter is silently discarded. The agent loads
with its filename-derived name and without its prompt, permissions, or tool
configuration. No error is shown to the user.
## Root cause
gray-matter (the YAML frontmatter parser) does not throw on invalid
YAML by default. When js-yaml fails (e.g., skill:true without space),
gray-matter returns the raw frontmatter as a string in md.data instead
of a parsed object.
This means:
ConfigMarkdown.parse() never throws → the catch block in loadAgent
is never reached → no Session.Event.Error is published
{ ...md.data } spreads a string → garbage instead of config
The explicit name: agentName (from filename) survives, masking the error
Activity
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.