Skip to content

docs(roadmap): add #454 — claw list/run/exec/ask fall through to prompt dispatch; suggest_similar_subcommand KNOWN_SUBCOMMANDS too narrow#3067

Open
Yeachan-Heo wants to merge 1 commit into
mainfrom
docs/roadmap-454-typo-suggestion-asymmetry
Open

docs(roadmap): add #454 — claw list/run/exec/ask fall through to prompt dispatch; suggest_similar_subcommand KNOWN_SUBCOMMANDS too narrow#3067
Yeachan-Heo wants to merge 1 commit into
mainfrom
docs/roadmap-454-typo-suggestion-asymmetry

Conversation

@Yeachan-Heo
Copy link
Copy Markdown
Contributor

ROADMAP pinpoint #454 — typo-suggestion candidate list is too narrow

Dogfooded for the 2026-05-24 06:30 Clawhip pinpoint nudge (message 1507994083769974825).

The asymmetry

$ claw ls   # caught as typo because "skills".contains("ls")
[error-kind: unknown] error: unknown subcommand: ls.
  Did you mean     skills

$ claw list  # falls through to LLM prompt dispatch
[error-kind: missing_credentials] error: missing Anthropic credentials; ...

The missing_credentials envelope proves "list" was sent to Claude as a user prompt.

Code

rust/crates/rusty-claude-cli/src/main.rs:1324-1364:

fn suggest_similar_subcommand(input: &str) -> Option<Vec<String>> {
    const KNOWN_SUBCOMMANDS: &[&str] = &[
        "help", "version", "status", "sandbox", "doctor", "state",
        "dump-manifests", "bootstrap-plan", "agents", "mcp", "skills",
        "system-prompt", "acp", "init", "export", "prompt",
    ];
    // Levenshtein ≤ 2, prefix match ≥ 4, or substring match
    ...
}

list has Levenshtein ≥ 3 from every entry, prefix < 4 with every entry, and no substring overlap → returns None, typo arm at :983-994 is skipped, falls through to CliAction::Prompt.

ls only works by coincidence ("skills".contains("ls")). Any refactor of KNOWN_SUBCOMMANDS could silently regress that.

Other natural CLI-discovery shapes that fall through

Spelling Today Should be
claw ls ✅ typed typo (coincidence) typed typo
claw list ❌ prompt dispatch typed typo → skills list/mcp list/agents list
claw run hello ❌ prompt dispatch typed typo → prompt
claw exec hello ❌ prompt dispatch typed typo → prompt
claw ask what ❌ prompt dispatch typed typo → prompt / REPL
claw models ❌ prompt dispatch (#452) CliAction::Models once #452 lands
claw providers ✅ guard (covered by #453 once extra-args fix lands)
claw profiles ❌ prompt dispatch typed typo
claw aliases ❌ prompt dispatch typed typo
claw logs ❌ prompt dispatch typed typo
claw settings ❌ prompt dispatch typed typo

Why distinct from #78 / #145 / #452 / #453

Required fix shape (full detail in ROADMAP entry)

(a) Extend KNOWN_SUBCOMMANDS to include list, ls, models, providers, profiles, aliases, logs, settings, run, exec, ask, chat, auth, login, logout with explicit did_you_mean mappings. (b) Replace Levenshtein/prefix/substring coincidence with explicit did-you-mean targets. (c) Structured kind:"unknown_subcommand" JSON envelope with prompt_dispatch_blocked:true. (d) Regression coverage for every spelling in the table.

Acceptance check (one-liner)

env -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN claw list should NOT exit with missing_credentials; it should exit with unknown subcommand: list. Did you mean skills list / mcp list / agents list?.


[repo owner's gaebal-gajae (clawdbot) 🦞]

…pt dispatch; suggest_similar_subcommand KNOWN_SUBCOMMANDS too narrow
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