MoonshotAI / MoonshotAI/kimi-cli
docs: Hooks documentation example for desktop notification on approval is non-functional
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 For Coding
Which model were you using?
Kimi-k2.6
What platform is your computer?
macOS
What issue are you seeing?
The official documentation at Hooks Configuration provides the following example:
# 需要审批时发送桌面通知
[[hooks]]
event = "Notification"
matcher = "permission_prompt"
command = "osascript -e 'display notification \"Kimi needs attention\" with title \"Kimi CLI\"'"
This configuration never triggers.
After reviewing the source code, the string permission_prompt has zero references in the entire src/kimi_cli codebase. The permission request (approval) flow is handled directly by the Approval class and ApprovalRuntime via the ACP wire path (ApprovalRequest → request_permission). It does not create a NotificationEvent or call NotificationManager.publish().
Therefore, the Notification hook with matcher = "permission_prompt" can never match any event, leaving users who configure this per the documentation without any desktop notifications.
What steps can reproduce the bug?
- Add the documented configuration to
~/.kimi/config.toml:
[[hooks]]
event = "Notification"
matcher = "permission_prompt"
command = "osascript -e 'display notification \"Kimi needs attention\" with title \"Kimi CLI\"'"
- Start Kimi Code CLI (non-yolo mode)
- Trigger an operation requiring approval (e.g.
Shelltool execution) - Expect a desktop notification — but nothing is triggered
What is the expected behavior?
Either of the following:
- Short term: Update the documentation to remove or correct this non-functional example.
- Long term: Add a new hook event (e.g.
ApprovalRequested) insrc/kimi_cli/soul/approval.pyrequest()so users can receive external notifications when approval is actually needed.
Additional information
- The
Notificationhook trigger is insrc/kimi_cli/soul/kimisoul.py, and only fires when notifications fromNotificationManagerare delivered to thellmsink. The matcher matches the notification'stypefield. - Currently the only source of
Notificationevents is background task completion (task.completed,task.failed, etc.) insrc/kimi_cli/background/manager.py. - As a workaround, users can use the
PreToolUsehook with matchers likeShell|WriteFile|StrReplaceFile|TaskStop, but this is imprecise (it also fires in yolo/afk mode when no actual approval is requested).
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 Hooks Configuration page and compare its permission_prompt example with src/kimi_cli/soul/kimisoul.py, src/kimi_cli/soul/approval.py, and src/kimi_cli/background/manager.py. Confirm which hook events are actually emitted and whether the scope is to correct the documentation or pursue a new approval event; done means the published example reflects working behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100