Skip to content

fix(commands): match built-in slash command names in any case - #2116

Merged
will-lamerton merged 1 commit into
mainfrom
fix/command-name-resolution
Nov 11, 2026
Merged

will-lamerton merged 1 commit into
mainfrom
fix/command-name-resolution

Conversation

@will-lamerton

Copy link
Copy Markdown
Member

A small user-visible fix that comes before PR 3 of the command-dispatcher sequence (#2098, #2114). It is kept separate from the refactor, as the phase 2 rules ask.

What was wrong

Case handling was inconsistent. /Resume, /SESSIONS, /History and /Retry worked, because the resume and retry handlers lowercased the name themselves. Every other built-in, such as /Status, /Compact or /Setup-MCP, reported Unknown command.

Moving /resume and /retry onto StatefulCommand (PR 3) would have quietly dropped the case-insensitivity they had, because the registry looks names up exactly.

Separately, /sessions and /history were special-cased in two places: the resume handler's own name list, and a /help override that listed them as aliases. They were not in the alias table, so a fully typed /sessions did not complete to itself in the slash menu the way other old names do.

Fix

  • The dispatcher lowercases the command name once, right after the custom-command and MCP-prompt checks and before retired names, aliases, inline overrides and the registry. Custom commands and MCP prompts still match exactly, so a project command named Status still wins for /Status, and /STATUS runs the built-in.
  • /sessions and /history are now entries in COMMAND_ALIASES (target resume). The /help override duplicate and its lookup branch are removed. /help sessions still opens /resume, and the /resume help page still lists both names.

Tests

  • command-dispatcher.spec.ts:
    • /STATUS, /Setup-MCP (retired name) and /Model-Database (alias) run their built-ins
    • /sessions and /History --all open the session picker through the alias table, and --all is still passed through
    • a project command named Status still wins for its own spelling only
  • aliases.spec.ts: sessions/history are aliases, and /help resolves them.
  • Ran tsc --noEmit, biome check . and knip. AVA passes over source/commands and the app-util and dispatcher specs.

🤖 Generated with Claude Code

/resume, /sessions, /history and /retry already matched any case because
their handlers lowercased the name; every other built-in reported
"Unknown command" for /Status. The dispatcher now lowercases the name
once, after custom commands and MCP prompts (which keep exact matching),
so every built-in, alias and retired name behaves the same.

/sessions and /history move into the alias table instead of being
special-cased by the resume handler and the /help overrides.

This is groundwork for moving /resume and /retry onto StatefulCommand
without losing their case-insensitive names.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added the area:tui Terminal UI label Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

nc-review could not produce a verdict this run (agent exit 1). This is a problem with the review agent, not with your pull request. A maintainer can retry with /re-review.

@will-lamerton
will-lamerton merged commit 1a4e6f2 into main Nov 11, 2026
19 checks passed
@will-lamerton
will-lamerton deleted the fix/command-name-resolution branch November 11, 2026 19:00
jay23606 added a commit to jay23606/nanocoder that referenced this pull request Nov 12, 2026
…ollective#2116)

/resume, /sessions, /history and /retry already matched any case because
their handlers lowercased the name; every other built-in reported
"Unknown command" for /Status. The dispatcher now lowercases the name
once, after custom commands and MCP prompts (which keep exact matching),
so every built-in, alias and retired name behaves the same.

/sessions and /history move into the alias table instead of being
special-cased by the resume handler and the /help overrides.

This is groundwork for moving /resume and /retry onto StatefulCommand
without losing their case-insensitive names.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant