Skip to content

feat(shell): add slash command alias resolution and display#2261

Open
jackfish212 wants to merge 1 commit into
MoonshotAI:mainfrom
jackfish212:refine-interact
Open

feat(shell): add slash command alias resolution and display#2261
jackfish212 wants to merge 1 commit into
MoonshotAI:mainfrom
jackfish212:refine-interact

Conversation

@jackfish212
Copy link
Copy Markdown
Collaborator

@jackfish212 jackfish212 commented May 13, 2026

Summary

This PR improves the shell slash command system so that aliases are fully resolved to their canonical commands. Users can now invoke slash commands via aliases, and the UI clearly shows when an alias match is being used. Telemetry also tracks canonical names rather than raw alias inputs.


1. Slash command alias resolution

Problem: Slash command aliases were partially supported but not consistently resolved. Invoking a command via its alias could bypass telemetry tracking or fail to match the correct handler.

What was done:

  • Index available slash commands by both primary name and aliases in Shell.
  • Added _find_available_slash_command() to resolve aliases to canonical SlashCommand instances.
  • Telemetry now records the canonical command.name even when invoked via alias.

2. Alias display in completer and help output

Problem: The shell completer and help text did not distinguish between canonical names and aliases, making it unclear when an alias was matched.

What was done:

  • Added SlashCommand.display_name(trigger) to render /name (alias) for alias matches.
  • Updated SlashCommandCompleter to show alias matches with the new display format.
  • Updated /help output to expand aliases as separate entries.
  • Fixed the /usage alias from "/status" to "status".

3. Registry and test infrastructure

Problem: The slash command registry lacked utilities to iterate over both canonical and alias entries.

What was done:

  • Added SlashCommandRegistry.iter_command_entries() to yield (trigger, command) pairs.
  • Updated all affected tests to cover alias resolution, completer behavior, and telemetry tracking.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open in Devin Review

- add SlashCommand.display_name() for canonical and alias labels\n- index available slash commands by both primary name and aliases\n- track canonical command names in telemetry when invoked via alias\n- show alias matches as "/name (alias)" in completer and help output\n- fix /usage alias from "/status" to "status"
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3caf16e53

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

git tag <tag>
git push origin <tag>
```
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix unmatched Markdown fence in release skill instructions

The new PR template example opens a fenced block at ```markdown and then introduces ```sh inside it, which causes the outer fence to terminate early and leaves the trailing ``` unmatched. In rendered Markdown, this can swallow the rest of the document into a code block, making step 11 and stop conditions hard to read and easy to miss during release execution.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

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