Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Agent loader silently drops agent files whose frontmatter fails strict YAML parse (e.g. unquoted description containing ": ")

Open Beginner friendly
#4,008 0 comments 0 reactions 0 assignees View on GitHub

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

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.

  1. 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
    ---
    # good
    

    bad.md:

    ---
    name: bad
    description: A broken agent: this colon-space makes the plain scalar a hard YAML error.
    model: sonnet
    ---
    # bad
    
  2. Run HOME=<scratch> kimi -p "Reply with exactly: ok" in a scratch cwd.

  3. Read the roster from the new session's wire: only good appears. bad is gone, with no diagnostic anywhere.

  4. Field-level bisect. Change only the description line to description: "A broken agent: quoted now." → bad appears 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MoonshotAI/kimi-code

All issues in MoonshotAI/kimi-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.