fix(agent-core): surface skill parse failures as session warnings#2046
Open
Fromsko wants to merge 1 commit into
Open
fix(agent-core): surface skill parse failures as session warnings#2046Fromsko wants to merge 1 commit into
Fromsko wants to merge 1 commit into
Conversation
A skill file that fails to parse (malformed YAML frontmatter, missing required fields, unsupported type) was silently dropped during session start with no user-visible feedback. The SessionSkillRegistry did not wire its onWarning callback, and getSessionWarnings only checked the AGENTS.md size warning, so skill load failures never reached the TUI. SessionSkillRegistry now collects parse failures into a warnings list alongside the existing onWarning callback, and getSessionWarnings surfaces them with code 'skill-load-failed' so the TUI status line names the offending file. Fixes MoonshotAI#1972
🦋 Changeset detectedLatest commit: 36a4ff9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Resolve #1972
Problem
A skill file that fails to parse at session start (malformed YAML frontmatter, missing required
name/descriptionfields, or an unsupportedtype) is silently dropped — it does not appear in the skill list and no warning or error is emitted. The only way to discover the failure is to notice the skill is missing and bisect the frontmatter by hand.The reporter observed that long
descriptionvalues triggered the drop and assumed a length limit, but the real trigger is that longer plain-scalar descriptions are more likely to contain a character sequence that breaks YAML parsing (e.g. a": "inside the value). Quoting the description fixes it because it becomes a valid YAML quoted scalar — confirming the root cause is a swallowed parse failure, not a length cap.Two code defects caused the silence:
SessionSkillRegistryis constructed without anonWarningcallback, so the default no-op() => {}is used. The skill scanner catchesSkillParseErrorand forwards it towarn(...), but that call goes nowhere.Session.getSession.getSessionWarnings()only checks the AGENTS.md size warning and never reads the skill layer, so even if warnings were collected they would never reach the TUI.What changed
SessionSkillRegistrynow collects skill parse failures into an internalwarningslist (newgetLoadWarnings()method), in addition to still forwarding to the optional externalonWarningcallback. This means everySessionSkillRegistryinstance — including the live session one that previously passed no callback — captures load failures.Session.getSessionWarnings()nowawaitsskillsReady(so discovery has completed) and surfaces each collected skill warning withcode: "skill-load-failed". The TUI already pollsgetSessionWarnings()and renders each entry on the status line, so the warning is now visible to the user naming the offending file.No changes to the TUI are needed — the existing
showSessionWarningspath picks up the new warnings automatically. Unsupported skill types (a deliberate skip, not a failure) are intentionally excluded, matching the existingagents-md-oversizedwarning style.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.