Skip to content

fix(shell): register /btw slash command#2205

Merged
7Sageer merged 4 commits intoMoonshotAI:mainfrom
7Sageer:fix-btw-slash-completion
May 9, 2026
Merged

fix(shell): register /btw slash command#2205
7Sageer merged 4 commits intoMoonshotAI:mainfrom
7Sageer:fix-btw-slash-completion

Conversation

@7Sageer
Copy link
Copy Markdown
Collaborator

@7Sageer 7Sageer commented May 9, 2026

Related Issue

N/A — bug fix for /btw slash completion.

Description

/btw was documented and worked, but didn't appear in agent-mode slash completion or /help because it was never registered with shell_slash_registry.

This PR fixes the registration:

Commit 1 — fix(shell): register /btw slash command

  • Add /btw <question> to shell_slash_registry so it appears in agent-mode completion and /help.

Before:

截屏2026-05-09 13 48 40

After:

截屏2026-05-09 13 49 09

Tests

  • uv run python -m pytest tests/ui_and_conv -q — 718 passed
  • make format-kimi-cli
  • make check-kimi-cli

Checklist

  • I have read the CONTRIBUTING document.
  • No related issue linked.
  • I have added tests that prove my fix is effective or that my feature works (registration regression + handler unit tests).
  • I have run make gen-changelog to update the changelog. (N/A: /btw is already documented in the release notes; this PR doesn't change user-facing behavior.)
  • I have run make gen-docs to update the user documentation. (N/A: existing docs already describe /btw; this PR keeps the implementation behavior identical.)

Copilot AI review requested due to automatic review settings May 9, 2026 05:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Registers /btw in the shell slash-command registry so it shows up in agent-mode slash completion, and adds a regression test to ensure it remains discoverable via the completer.

Changes:

  • Added a /btw shell-level slash command registration (and handler) in ui/shell/slash.py.
  • Added a test asserting /btw appears in agent-mode slash completion suggestions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/kimi_cli/ui/shell/slash.py Registers /btw on the shell slash registry so it is discoverable via agent-mode completion.
tests/ui_and_conv/test_slash_completer.py Adds coverage ensuring /btw is suggested by the slash completer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Make the /btw handler registered in shell_slash_registry actually
reachable. Idle input now goes through the standard slash dispatcher
instead of being short-circuited by classify_input.

Streaming keeps in-view recognition (no dispatcher exists in that
context), but uses parse_slash_command_call directly; the
InputAction / classify_input abstraction is removed.

- Rename Shell._run_btw_modal -> run_btw_modal (public)
- Drop idle interception block in Shell.run()
- Extract _handle_btw_command / _block_shell_only_command helpers
  shared by handle_local_input and handle_immediate_steer
- Delete src/kimi_cli/ui/shell/visualize/_input_router.py
- Update tests accordingly
@7Sageer 7Sageer changed the title fix(shell): register /btw slash command refactor(shell): route /btw through slash registry, drop input_router May 9, 2026
@7Sageer
Copy link
Copy Markdown
Collaborator Author

7Sageer commented May 9, 2026

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@7Sageer 7Sageer changed the title refactor(shell): route /btw through slash registry, drop input_router fix(shell): register /btw slash command May 9, 2026
@7Sageer 7Sageer merged commit 4409933 into MoonshotAI:main May 9, 2026
13 checks passed
@7Sageer 7Sageer deleted the fix-btw-slash-completion branch May 9, 2026 12:51
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.

4 participants