MoonshotAI / MoonshotAI/kimi-cli
UserPromptSubmit hook receives empty prompt when input comes from shell UI
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
What version of Kimi Code CLI is running?
1.44.0
Which open platform/subscription were you using?
Kimi Code (managed:kimi-code)
Which model were you using?
kimi-code/kimi-for-coding (Kimi-k2.6)
What platform is your computer?
macOS Sonoma 14.7 (Apple Silicon M1 Max), Darwin 23.6.0 arm64
What issue are you seeing?
The UserPromptSubmit hook always receives "prompt": "" even when the user types plain text in the interactive shell. The matcher_value is also empty, so regex-based prompt filtering hooks never match.
What steps can reproduce the bug?
- Add a UserPromptSubmit hook to config.toml:
[[hooks]]
event = "UserPromptSubmit"
command = "cat > /tmp/prompt_payload.json"
timeout = 5
- Start an interactive shell session:
uv run python -m kimi_cli
- Type any plain text message (e.g., hello world) and submit.
- Inspect the captured payload:
cat /tmp/prompt_payload.json
Actual result:
{
"hook_event_name": "UserPromptSubmit",
"session_id": "abc123",
"cwd": "/Users/...",
"prompt": ""
}
What is the expected behavior?
The prompt field should contain the actual user input text ("hello world"). The matcher_value passed to the hook engine should also be the user's text so that regex matchers work correctly.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the interactive entry point run by uv run python -m kimi_cli and trace the UserPromptSubmit hook payload and matcher value for shell-entered text. Reproduce the issue with the provided config.toml hook and /tmp/prompt_payload.json capture. Done means the payload and matcher contain the submitted text, and the reproduction confirms regex matchers can match it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100