Skip to content

feat: add bell_on_completion config option#1218

Closed
gitt510 wants to merge 3 commits intoMoonshotAI:mainfrom
gitt510:feat/bell-on-completion
Closed

feat: add bell_on_completion config option#1218
gitt510 wants to merge 3 commits intoMoonshotAI:mainfrom
gitt510:feat/bell-on-completion

Conversation

@gitt510
Copy link

@gitt510 gitt510 commented Feb 24, 2026

Why / Background

When using terminal multiplexers like tmux, there was no way to detect when the AI agent finished processing while working in another window.

Both Codex CLI and Claude CLI have a feature to play a bell character (\a) when the agent completes processing, but Kimi CLI lacked this functionality.

This PR adds the ability to play a bell sound when an agent's turn completes, allowing users to be notified of processing completion even when Kimi is running in the background.

What / Changes (Summary)

Code Changes

  • Config (src/kimi_cli/config.py): Added bell_on_completion config option (default: true)
  • Shell UI (src/kimi_cli/ui/shell/):
    • visualize.py: Modified to pass config to _LiveView
    • replay.py: Play bell on TurnEnd when bell_on_completion is enabled
    • __init__.py: Added config initialization

Tests

  • Updated test_default_config_dump to include bell_on_completion
  • Added test_visualize_bell.py with tests for:
    • Bell is played when bell_on_completion=True
    • Bell is not played when bell_on_completion=False
    • Default value is True

Documentation (auto-generated via make gen-docs)

  • Updated config-files.md (en/zh) with new bell_on_completion option
  • Updated changelog (en/zh) with feature entry

Not in scope / Out of scope

  • Customizing the bell sound
  • Integration with visual notifications (notification center, etc.)
  • Applying to other UI modes (Web UI, ACP, etc.)

Impact / Affected areas

Target Impact
User config bell_on_completion option can be added to ~/.kimi/config.toml
Default behavior Existing users will have this enabled automatically (true)
tmux users Can detect processing completion via window-bell-style or similar settings

Risk・Mitigation / Risks and mitigations

Risk Mitigation
Existing users may be annoyed by unexpected bell sounds Can be easily disabled by setting bell_on_completion = false
Bell may not work on some terminals \a (BEL character) is an ANSI standard and supported by virtually all terminals

Testing / Verification

  • Unit tests added and passing
  • Manual test: tmux with window-bell-style detects completion
  • Manual test: bell_on_completion = false disables the bell
  • Manual test: Default behavior (true) works as expected

Diff breakdown / Summary

  • Code (src): 4 files +18 -4
  • Code (test): 2 files +46 -0
  • Docs: 5 files +48 -32
  • Other: 0 files +0 -0

Checklist

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

Open with Devin

Play bell sound when agent turn completes.
This helps users notice when kimi-code finishes processing,
especially useful in tmux where window-bell-style can highlight
the active window.

- Add bell_on_completion config option (default: true)
- Pass config through visualize -> _LiveView
- Play bell on TurnEnd when enabled
- Update test_default_config_dump to include bell_on_completion
- Add test_visualize_bell.py with tests for TurnEnd bell behavior
@gitt510
Copy link
Author

gitt510 commented Mar 2, 2026

I'm closing this PR because I've determined that ringing the bell at turn-end, in addition to the existing user action events where the bell is already defined, would compromise the uniqueness of the event.

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.

1 participant