Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cecli/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2768,6 +2768,7 @@ async def process_tool_calls(self, tool_call_response):

def _print_tool_call_info(self, server_tool_calls):
"""Print information about an MCP tool call."""
self.io.ring_bell()
# self.io.tool_output("Preparing to run MCP tools", bold=False)

for server, tool_calls in server_tool_calls.items():
Expand Down
33 changes: 20 additions & 13 deletions cecli/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,7 @@ async def _confirm_ask(
self.user_input(f"{question} - {res}", log_only=False)
else:
# Ring the bell if needed
self.notify_user_input_required()
self.ring_bell()
self.start_spinner("Awaiting Confirmation...", False)

Expand Down Expand Up @@ -1708,22 +1709,28 @@ def get_default_notification_command(self):

return None # Unknown system

def _send_notification(self):
if self.notifications_command:
try:
result = subprocess.run(self.notifications_command, shell=True, capture_output=True)
if result.returncode != 0 and result.stderr:
error_msg = result.stderr.decode("utf-8", errors="replace")
self.tool_warning(f"Failed to run notifications command: {error_msg}")
except Exception as e:
self.tool_warning(f"Failed to run notifications command: {e}")
else:
print("\a", end="", flush=True) # Ring the bell

def notify_user_input_required(self):
"""Send a notification that user input is required."""
if self.notifications:
self._send_notification()

def ring_bell(self):
"""Ring the terminal bell if needed and clear the flag"""
if self.bell_on_next_input and self.notifications:
if self.notifications_command:
try:
result = subprocess.run(
self.notifications_command, shell=True, capture_output=True
)
if result.returncode != 0 and result.stderr:
error_msg = result.stderr.decode("utf-8", errors="replace")
self.tool_warning(f"Failed to run notifications command: {error_msg}")
except Exception as e:
self.tool_warning(f"Failed to run notifications command: {e}")
else:
print("\a", end="", flush=True) # Ring the bell
self.bell_on_next_input = False # Clear the flag
self._send_notification()
self.bell_on_next_input = False

def toggle_multiline_mode(self):
"""Toggle between normal and multiline input modes"""
Expand Down
Loading