Repository navigation
Commit 5153db6
committed
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).1 parent ae9b80a commit 5153db6
6 files changed
Lines changed: 319 additions & 22 deletions
File tree
- apps/vscode-e2e/src/suite
- src
- core/webview/__tests__
- extension/__tests__
- services/skills
- __tests__
- webview-ui/src/context/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
| |||
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
57 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
58 | 74 | | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
63 | 79 | | |
64 | | - | |
| 80 | + | |
| 81 | + | |
65 | 82 | | |
66 | | - | |
| 83 | + | |
67 | 84 | | |
68 | | - | |
| 85 | + | |
| 86 | + | |
69 | 87 | | |
70 | 88 | | |
71 | 89 | | |
| |||
96 | 114 | | |
97 | 115 | | |
98 | 116 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
102 | 120 | | |
103 | 121 | | |
104 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
429 | 464 | | |
430 | 465 | | |
431 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
70 | 82 | | |
71 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
72 | 91 | | |
73 | 92 | | |
74 | 93 | | |
| |||
135 | 154 | | |
136 | 155 | | |
137 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
138 | 164 | | |
139 | | - | |
| 165 | + | |
140 | 166 | | |
141 | 167 | | |
142 | 168 | | |
143 | 169 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
147 | 181 | | |
148 | 182 | | |
149 | 183 | | |
| |||
0 commit comments