← Back to PRs

#19664: fix(skills): log skill YAML parsing diagnostics with skill name

by orchidsun open 2026-02-18 02:25 View on GitHub →
agents size: XS
## Problem Previously, when a skill's SKILL.md had YAML parsing errors (e.g., unquoted colons in description), the error was silently ignored and the skill failed to load without any indication of what went wrong. Example of broken YAML: ```yaml --- name: my-skill description: Transcribe podcasts: using tool X --- ``` This causes: `Nested mappings are not allowed in compact mappings` ## Solution This change logs skill YAML parsing diagnostics with the skill name to help users identify and fix issues: 1. **Logs warnings when YAML parsing fails** in the catch block 2. **Logs diagnostics returned from pi-coding-agent's `loadSkillsFromDir()`** - the underlying library already returns diagnostics, but they were being ignored 3. **Includes the skill name in the warning message** for better debugging Example warning output: ``` [skills] Skill "my-skill": Nested mappings are not allowed in compact mappings at line 2, column 14: description: Transcribe podcasts: using tool X ``` ## Testing - Built the project successfully - Ran unit tests (664 passed, 1 unrelated failure in Slack) - Tested locally with a skill containing a colon in description - warning now shows skill name ## Related - CONTRIBUTING.md notes: "Test locally with your OpenClaw instance" - This is an alternative approach to fixing the root cause in pi-coding-agent <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds diagnostic logging for skill YAML parsing failures in `src/agents/skills/workspace.ts`. Previously, YAML parsing errors in skill files were silently swallowed, making it difficult for users to debug why a skill failed to load. - Logs diagnostics returned by `loadSkillsFromDir()` (from the `pi-coding-agent` library) at both call sites, including the extracted skill name from the file path - Replaces a silent `catch` block in frontmatter parsing with a `skillsLogger.warn()` call that includes the file path and error message - Includes a minor formatting cleanup of a long array literal in `buildWorkspaceSkillSnapshot` <h3>Confidence Score: 4/5</h3> - This PR is safe to merge — it only adds logging to previously silent error paths with no behavioral changes. - The changes are straightforward additions of warning-level log messages to existing catch blocks and after library calls. No control flow is altered, no new dependencies are introduced, and the logging uses the established subsystem logger pattern. The only minor concern is the forward-slash-only path splitting for skill name extraction, but this only affects log output cosmetics on Windows, not functionality. - No files require special attention <sub>Last reviewed commit: b2286cf</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs