Skip to content

fix(agent-scan): quote YAML frontmatter description to prevent parse error - #578

Open
NY1024 wants to merge 1 commit into
Tencent:mainfrom
NY1024:fix/skill-yaml-frontmatter-colon
Open

fix(agent-scan): quote YAML frontmatter description to prevent parse error#578
NY1024 wants to merge 1 commit into
Tencent:mainfrom
NY1024:fix/skill-yaml-frontmatter-colon

Conversation

@NY1024

@NY1024 NY1024 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Problem

Running Agent Scan with the agentic-supply-chain-detection skill produces a YAML frontmatter parse error:

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 47

As a result, the skill file fails to load and the agent cannot obtain the skill content, falling back to a degraded mode.

Root Cause

The description field in agent-scan/agent_scan/prompt/skills/agentic-supply-chain-detection/SKILL.md contains a bare colon:

description: Detect agentic supply-chain risks: compromised dependencies, malicious plugins/tools/models, and untrusted update sources.

YAML parsers interpret the second colon (risks:) as a nested mapping indicator, triggering the "mapping values are not allowed in this context" error.

Fix

Wrap the description value in double quotes so the colon is treated as part of the string:

description: "Detect agentic supply-chain risks: compromised dependencies, malicious plugins/tools/models, and untrusted update sources."

Verification

Validated all 15 SKILL.md files under agent-scan/agent_scan/prompt/skills/ with yaml.safe_load — all pass after the fix.

Scope

Single-line change, one file only.

…error

The description field in agentic-supply-chain-detection/SKILL.md contains
a bare colon ('risks:') which YAML parsers interpret as a nested mapping,
causing 'mapping values are not allowed in this context at line 2 column 47'.

Wrapping the value in double quotes resolves the parse error and allows
Agent Scan to load the skill correctly.
@boy-hack

Copy link
Copy Markdown
Collaborator

Thanks @NY1024 for the thorough root-cause analysis — the explanation of why the bare colon trips the YAML parser ("mapping values are not allowed") is spot on, and validating all 15 SKILL.md files with yaml.safe_load is a nice touch.

One heads-up: this is a duplicate of PR #580 by @cloudbypriyank — both fix the exact same line in the same file (and #580 explicitly Closes #577). Could you two coordinate and consolidate into a single PR to avoid merge conflicts? Either diff is correct; keeping one is enough. Thanks!

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.

2 participants