Skip to content

fix(genui): read the skill description from SKILL.md instead of a second copy - #342

Open
SparkElf wants to merge 1 commit into
omdsh-dev:mainfrom
SparkElf:pr/skill-description-from-frontmatter
Open

SparkElf wants to merge 1 commit into
omdsh-dev:mainfrom
SparkElf:pr/skill-description-from-frontmatter

Conversation

@SparkElf

Copy link
Copy Markdown
Contributor

What

The bundled skill's routing description is declared twice: in SKILL.md's frontmatter (the copy the model routes on) and as BUNDLED_SKILL_DESCRIPTION in src/plugin/index.ts (the copy the panel shows).

They have already drifted apart. Editing the skill's own frontmatter — the natural place, and the file the model actually reads — changes nothing on screen, with no error to say so. The panel advertises one sentence while the model routes on a different one.

Parse the description out of the frontmatter the provider already reads, and fail loudly when the field is missing rather than serving a stale constant.

Why a throw instead of a fallback

A missing description is a packaging mistake, not a runtime condition. Falling back to a default would restore exactly the failure mode being fixed — a wrong sentence shown with nothing to indicate it. Failing at registration names the file and the field instead.

Test

The regression test compares the registered description against the FILE, not against a known substring.

That distinction is the point. A substring check cannot catch this class of bug: both copies happened to carry the sentence Preserve conversation language, so a toContain passed while every other word differed. Asserting equality with the parsed frontmatter is the only form that stays honest as the description is edited.

Verification

  • tsc --noEmit clean
  • tests/plugin-genui.spec.ts and tests/skill-md.spec.ts: 28 passed
  • Full suite: 1338 passed

One file (tests/fence-feedback-agentloop.spec.ts) fails to load in my local checkout because @deepseek-ai/dsh-agent-loop is not installed there. It is declared in devDependencies, the file is untouched by this PR, and it is unrelated to the skill registration path.

…ond copy

Carried over from main (d46a55f) onto the 0.13.0 line, which had kept the older
shape: the routing description existed twice, once in SKILL.md -- the copy the model
reads -- and once as BUNDLED_SKILL_DESCRIPTION in code, which the panel shows. The
two had already drifted apart, so the panel advertised one sentence while the model
routed on another, and editing the skill's own frontmatter changed nothing on screen
with no error to say so.

Parse the description out of the frontmatter the provider already reads, and fail
loudly when the field is missing rather than serving a stale constant.

The regression test compares the registered description against the FILE rather than
against a known substring. A substring check could not have caught this: both copies
carried the sentence "Preserve conversation language", so it passed while everything
else about the two strings differed. Verified red before the fix -- it reports the
code copy on the left and the file copy on the right.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant