Skip to content

Bug: Unquoted {PRINCIPAL.NAME} in Traits.yaml breaks ComposeAgent --load for all custom agents #1002

@DAESA24

Description

@DAESA24

Description

Traits.yaml line 175 has {PRINCIPAL.NAME}: as a bare YAML mapping key. Because {...} is YAML flow mapping syntax, any standard YAML parser throws a YAMLParseError on this line. This completely breaks ComposeAgent.ts --load for all custom agents, not just those referencing {PRINCIPAL.NAME}.

Impact

  • ComposeAgent.ts --load <any-agent> fails with YAMLParseError before it ever reads the agent file
  • The Agents skill cannot load Traits.yaml for any operation that parses the full file
  • All custom agents created via --save cannot be reloaded via --load
  • This affects PAI v4.0.3 (confirmed in Releases/v4.0.3/.claude/skills/Agents/Data/Traits.yaml)

Steps to Reproduce

# 1. Create any custom agent
bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts \
  --traits "technical,systematic,thorough" \
  --task "test agent" --save

# 2. Try to reload it
bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts --load technical-specialist-systematic

Expected: Agent reloads successfully
Actual: YAMLParseError at line 175

YAMLParseError: Map comment with trailing content at line 175, column 5:
    {PRINCIPAL.NAME}:
    ^

Root Cause

In skills/Agents/Data/Traits.yaml, line 175:

    {PRINCIPAL.NAME}:
      voice_id: "onwK4e9ZLuTAKqWW03F9"

The curly braces are interpreted as YAML flow mapping syntax, not as a template variable placeholder.

Fix

Quote the key. One-character change:

    "{PRINCIPAL.NAME}":
      voice_id: "onwK4e9ZLuTAKqWW03F9"

This was the only unquoted {PRINCIPAL.NAME}: instance used as a YAML mapping key in the file. Other occurrences (as values like default: "{PRINCIPAL.NAME}") are already properly quoted.

Related Issues

Environment

  • PAI v4.0.3
  • macOS Darwin 25.3.0
  • bun 1.x
  • yaml npm package (used by ComposeAgent.ts)

How We Found It

While building a custom Agent Browser orchestration skill (_ABWORKFLOWS), we created a custom agent (AgentBrowserAgent.md) and attempted to use ComposeAgent --load to verify it could be reloaded. The YAML parse error occurred immediately, before our agent file was even read. Tracing the error to position 6585 in Traits.yaml led us to the unquoted {PRINCIPAL.NAME}: key at line 175.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions