Skip to content

cli: --agent rejects hyphen/case variants that install and doctor already use (claude-code → claude_code) #884

Closed

Description

@Birfy

Phenomenon

agentdescent init <skill> --agent claude-code and algorithms run … --agent openai-compatible fail, even though install / doctor print hyphenated host names (claude-code, grok-bot) and algorithm names, parameter names, and --kind already fold case and -/_. Users copying the host spelling from doctor or install --help hit a hard reject instead of a starter spec.

The CLI already recognises the alias (did you mean --agent claude_code?) but refuses to write it. plan cannot resolve a literal claude-code agent ref — folding to the canonical short ref before write would make the spec valid, same as --kind skill-library now writes "kind": "skill_library" (#882).

Evidence

On current main (53a99fcc57b87515be73d89202d8b9c66203492d):

Install-only aliases whose worker name is not a hyphen/case variant (deepseek-harness → dsh, claudecode → claude_code, open-code → opencode) already point at the worker with a did-you-mean; those should keep the hint. grok-bot is an install host with no worker CLI and should keep its explanatory error.

Expected

A --agent value that matches exactly one built-in short ref (claude_code, codex, dsh, opencode, cli_agent, openai_compatible, host_model, claude, echo) once case and -/_ are ignored resolves to that name (claude-code → claude_code, openai-compatible → openai_compatible, CLI_AGENT → cli_agent). init and algorithms run write the canonical agent.ref. Kind mismatch checks (#456) still run on the folded name (--agent claude-code on kind=text is still refused as a WorkspaceAgent).

Unchanged: install-only aliases that are not a case/-/_ fold of a worker ref (deepseek-harness, claudecode, open-code) still hint; grok-bot / grok still explain there is no worker; unrelated names like bogus still list the refs with no guess; custom module:attribute refs are not rewritten.

Acceptance

Non-goals

  • Auto-accepting install-only aliases that are not a case/-/_ fold (deepseek-harness → dsh)
  • Folding agent.ref inside an already-written spec / plan (only the --agent flag)
  • Giving Grok Bot a worker CLI
  • Folding spaces or other punctuation (claude code, claude.code)

Risk hint

T1/T2 (CLI --agent validation only; no evolve-loop change).

Related

#882 / #883 (--kind fold), #876 / #877 (parameter-name fold), #752 (install host aliases), #745 (refuse unknown --agent before write), #456 (never silently swap a mismatched agent).

Activity

  1. added
    bugSomething isn't working
    area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions