Agent loader silently drops agent files whose frontmatter fails strict YAML parse (e.g. unquoted description containing ": ")
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript, yaml
- Domain
- cli, developer-experience
Research direction
Look for the agent loader code, likely in a file like src/agent/loader.ts or similar. Find where it reads and parses .md files from ~/.kimi-code/agents/. The YAML parsing is likely done with a library like js-yaml. Add error handling to log a warning for each file that fails to parse, including the filename and error message. Test by creating a malformed agent file with an unquoted description containing ': ' and verifying the warning appears in the session log.
Written by the indexing model from the issue text.
Description
Summary
Kimi Code's subagent loader parses each ~/.kimi-code/agents/*.md file's frontmatter as strict YAML and silently skips any file that fails to parse. A very natural authoring pattern — an unquoted description: value containing : (colon+space), which is a hard YAML error (mapping values are not allowed here) — removes the agent from the runtime roster with no warning anywhere: not in the session log, not in the wire log, not at startup. Dispatches to the missing agent then fall back to the built-in coder profile, so the failure is invisible in daily use.
Observed in the wild: 15/15 agent files correctly installed, 9/15 registered at runtime, an entire day of sessions silently running roster fallbacks. (Downstream report with full evidence: mattjanson/claude-skills#227.)
Reproduction (verified on kimi 2.0.2, macOS)
The roster oracle below reads the Agent tool's "Available agent types" from a session's agents/main/wire.jsonl llm.tools_snapshot event.
-
Baseline. Two agent files in an otherwise empty scratch
$HOME/.kimi-code/agents/:good.md:--- name: good description: A fine agent with no colon-space in the description. model: sonnet --- # goodbad.md:--- name: bad description: A broken agent: this colon-space makes the plain scalar a hard YAML error. model: sonnet --- # bad -
Run
HOME=<scratch> kimi -p "Reply with exactly: ok"in a scratch cwd. -
Read the roster from the new session's wire: only
goodappears.badis gone, with no diagnostic anywhere. -
Field-level bisect. Change only the description line to
description: "A broken agent: quoted now."→badappears in the roster. The trigger travels with the file content (not filename, ordering, or agent count — a 15-file set registers 15/15 once all descriptions are quoted).
Expected behavior
At minimum: a loud warning at session start naming each skipped agent file and the parse error. Ideally the frontmatter parser would be as tolerant as other harnesses (Claude Code registers all 15 files in the same set), but the silent skip is the defect that costs days — a malformed-file warning turns this from "invisible for weeks" to "obvious at first launch".
Impact
Any user hand-authoring or generating agent files. : inside prose descriptions is extremely common (description: Runs when X fails: collects evidence…). YAML requires quoting such scalars; nothing tells the author their file was dropped.
Environment
- kimi 2.0.2, macOS (darwin/arm64)
- Reproduced in clean scratch HOMEs with symlinked and copied agent files alike
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 350
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MoonshotAI/kimi-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
MoonshotAI/kimi-code#4010 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
MoonshotAI/kimi-code#3947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MoonshotAI/kimi-code#3836 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
MoonshotAI/kimi-code#3790 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MoonshotAI/kimi-code#3755 ·
All issues in MoonshotAI/kimi-code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100