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
fix(skills): serialize discovery scans, scope the quote hint, and parse frontmatter deterministically
Addresses the CodeRabbit review findings and completes the patch coverage:
- Serialize discoverSkills() runs through a promise chain so overlapping
watcher-triggered scans never interleave; an older scan can no longer
append a stale diagnostic after a newer scan has observed the repaired
file.
- Only emit the unescaped-double-quotes hint when the parser error is
located on the description line itself, so a valid quoted description
plus an unrelated YAML error elsewhere no longer produces a misleading
hint.
- Parse SKILL.md frontmatter with explicit empty options so gray-matter's
global content-keyed cache is bypassed. The cache is populated before
parsing, so a frontmatter that throws on first parse is cached with an
empty data object and every later parse of the same content silently
returns that object instead of re-throwing - which resurfaces the
misleading "missing required 'name' field" symptom from issue #859.
Tests:
- SkillsManager.spec: regression test that a delayed older scan cannot
append stale diagnostics (serialization), a regression test that a
re-scan of unchanged malformed content keeps reporting the parse
failure (gray-matter cache poisoning), a no-false-hint case with a
valid quoted description and an error on another line, and a non-Error
parse failure exercising recordDiagnostic's defensive fallbacks
(gray-matter is now vi.mocked with the real parser as the default
implementation).
- ExtensionStateContext.spec: the skills message test now asserts the
transition that clears stored skills/diagnostics, including a message
that omits skills entirely.
- skills-diagnostics e2e: the malformed fixture is now a double-quoted
description with unescaped inner quotes (the exact #859 failure mode),
skill files are written atomically (sidecar + rename) so the watcher
only observes complete files, and teardown removes only the skill
directories the suite created.
- api-get-skills-state.spec: document why the partial test doubles need
as-unknown-as casts.
- skillsMessageHandler.spec: cover the omitted newSkillModeSlugs case
(passes undefined, still refreshes the posted state).
0 commit comments