← Back to PRs

#22306: Warn on malformed skill parsing failures in load path

by AIflow-Labs open 2026-02-21 01:09 View on GitHub →
agents size: M
## Summary - Add diagnostics logging for skill load warnings so malformed `SKILL.md` files are no longer silent. - Keep behavior resilient by continuing to load other valid skills. - Preserve current fallback path by warning and continuing if local frontmatter parsing fails. - Add regression coverage in `src/agents/skills/workspace.test.ts` to assert malformed `SKILL.md` emits a warning and valid skills still load. ## Related - https://github.com/openclaw/openclaw/issues/22134 ## Testing - `pnpm test src/agents/skills/workspace.test.ts` - `pnpm check` (format passed; `pnpm tsgo` currently reports unrelated pre-existing TS issue in `src/auto-reply/reply/commands-export-session.test.ts:77` and did not proceed to lint) ## Confidence - 5/5 - Low-risk, narrow patch: no runtime behavior change for valid skills, only additive warning logging and a regression test. <!-- greptile_comment --> <h3>Greptile Summary</h3> Added diagnostics logging for malformed SKILL.md files during skill loading, ensuring failures are visible while preserving resilient behavior. Also fixed template placeholder formatting in the export-session HTML template that was preventing proper payload replacement. **Key changes:** - Added `logSkillLoadDiagnostics` helper to surface skill load warnings/errors from `loadSkillsFromDir` diagnostics - Enhanced frontmatter parsing error handling with contextual logging - New regression test verifies malformed skills emit warnings without blocking valid skills - Fixed template.html placeholder syntax (`{{MARKED_JS}}` instead of malformed `{{ MARKED_JS; }}`) - Added comprehensive test coverage for export-session functionality <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are narrow and well-tested: skill loading adds only diagnostic logging without modifying load behavior, regression test validates resilience, and the template fix corrects malformed placeholders. No breaking changes or risky logic modifications. - No files require special attention <sub>Last reviewed commit: ddd8a56</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs