fix(skills): surface invalid SKILL.md files with their skip reasons - #3680
Open
liukx0205 wants to merge 2 commits into
Open
fix(skills): surface invalid SKILL.md files with their skip reasons#3680liukx0205 wants to merge 2 commits into
liukx0205 wants to merge 2 commits into
Conversation
Skill discovery recorded only unsupported-type skips; parse failures (missing frontmatter, invalid YAML, missing required fields) were logged as warnings that daemon users never see, so a broken SKILL.md looked exactly like a hot-reload no-op. Record parse failures as skipped entries (path, type, reason) in both discovery implementations and expose them as invalid_skills in the session and workspace skill-list responses. Fixes #3673
🦋 Changeset detectedLatest commit: c58d574 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 774dac7f27
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
normalizeMetadata only overrode metadata.type when it was a non-empty
string, so a SKILL.md with type: 123 or type: {} kept the raw YAML
value, UnsupportedSkillTypeError stored it in skillType, and the
number/object leaked into the invalid_skills listing response where
invalidSkillSchema requires a string, breaking strict consumers.
Reject the skill with a stringified type label instead and cover the
session listing path with a schema-parsing regression test.
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
Fixes #3673
Problem
A
SKILL.mdmissing frontmatter, with invalid YAML, or missing required fields fails parsing during discovery, but the failure was only recorded as awarnlog line — and the daemon defaults toLogs: off, so users see nothing. A broken skill file looks exactly like a hot-reload no-op.Root cause: both discovery implementations (
FileSkillDiscovery.parseAndRegister,RuntimeSkillDiscovery.register) only recordedUnsupportedSkillTypeErrorin theskippedlist that flows into the catalog (recordSkipped/getSkippedByPolicy);SkillParseErrorwent to the log only. And even the recorded skips had no user-visible outlet: the session/workspace skill-list endpoints returned only valid skills.What changed
agent-core-v2: both skill discovery implementations now recordSkillParseErrorfailures in the discovery result'sskippedlist ({ path, type: 'invalid', reason }), alongside the existing warning. These entries already flow through the workspace catalog into the session catalog via the existingrecordSkippedchain.kap-server: the session (GET /api/v1/sessions/{id}/skills) and workspace (GET /api/v1/workspaces/{id}/skills) skill-list responses gain aninvalid_skillsarray ({ path, type, reason }), sourced fromgetSkippedByPolicy()for sessions and from the discovery results for the workspace preview. Clients (e.g. the desktop app) can now show exactly which file failed and why.invalid_skillswith file name + reason (kap-server).Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.