Skip to content

fix(cli): prevent immediate submit when selecting /skill completions (#1830)#1838

Draft
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1830-skill-completion-submit
Draft

fix(cli): prevent immediate submit when selecting /skill completions (#1830)#1838
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1830-skill-completion-submit

Conversation

@bloodycoder
Copy link
Copy Markdown

Summary

Fixes #1830 by preventing immediate submission when a /skill:* slash completion is selected before user adds task text.

Root cause

Slash completion submission behavior was not driven by command semantics. Selecting certain slash completions could trigger submit immediately in paths where the completion accept flow is coupled with submit handling.

What changed

  1. Added command metadata for completion submit behavior:
    • completion_submit = "auto_submit" | "insert_only"
  2. Marked skill:* commands as insert_only.
  3. Updated completion Enter handling to decide submit behavior by selected command metadata.
  4. Kept non-skill commands defaulting to auto_submit to preserve existing behavior.

Files touched

  • src/kimi_cli/utils/slashcmd.py
  • src/kimi_cli/soul/kimisoul.py
  • src/kimi_cli/ui/shell/prompt.py
  • tests/ui_and_conv/test_slash_completer.py
  • tests/core/test_kimisoul_slash_commands.py
  • tests/e2e/test_slash_completion_enter_tmux.py

Expected behavior after fix

  • Selecting /skill:* completion with Enter/Tab: insert only, no immediate submit.
  • After appending task text and pressing Enter: submit normally.
  • Non-skill slash commands keep existing behavior.

Test plan

Added/updated tests to cover:

  • skill vs non-skill completion policy
  • Enter/Tab behavior for skill completion
  • insert-then-submit flow

Current status

Draft PR due to local environment mismatch:

  • local Python: 3.9
  • repo requires: >=3.12 (.python-version is 3.14)
  • missing local tools: uv, tmux

I will update this PR with full passing logs after rerunning on a matching environment.

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.

A VSCode extension Can't slash skills before type something

1 participant