From 2b884b94a5a10553b4badfc782d7abb141bada19 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 13:33:19 -0700 Subject: [PATCH 01/17] fix: Ring bell when tool call info is printed Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/coders/base_coder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index c8462207b9a..5161ae55a7f 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -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(): From c93147c5e0926a835c17f8567212140e934693a7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 19:07:13 -0700 Subject: [PATCH 02/17] fix: Add notifications for TUI confirmation prompts Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/tui/io.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cecli/tui/io.py b/cecli/tui/io.py index 845466a2f92..56463bf5afb 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -441,6 +441,10 @@ async def confirm_ask( """ self.num_user_asks += 1 + # Ring the bell if needed + self.notify_user_input_required() + self.ring_bell() + question_id = (question, subject) try: From 7c3372a5fc70d4f5008252d84d5a2e0e521524b3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 21:00:38 -0700 Subject: [PATCH 03/17] fix: Trigger user input notification in TUI mode Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/tui/app.py | 4 ++++ cecli/tui/io.py | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cecli/tui/app.py b/cecli/tui/app.py index e92feec1653..df2520c9ddd 100644 --- a/cecli/tui/app.py +++ b/cecli/tui/app.py @@ -535,6 +535,10 @@ def start_task(self, task_id, title, task_type="general"): def show_confirmation(self, msg): """Show inline confirmation bar.""" + # Trigger notification + if self.worker and self.worker.coder and self.worker.coder.io: + self.worker.coder.io.notify_user_input_required() + # Disable input while confirm bar is active input_area = self.query_one("#input", InputArea) input_area.disabled = True diff --git a/cecli/tui/io.py b/cecli/tui/io.py index 56463bf5afb..845466a2f92 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -441,10 +441,6 @@ async def confirm_ask( """ self.num_user_asks += 1 - # Ring the bell if needed - self.notify_user_input_required() - self.ring_bell() - question_id = (question, subject) try: From 9ad7c2339f6b437730b1773fbe2be81ef9432915 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 22:39:25 -0700 Subject: [PATCH 04/17] fix: Refactor notification logic to separate user input notification --- cecli/io.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/cecli/io.py b/cecli/io.py index 8f572b7e856..5f76c6d6a77 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -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) @@ -1708,22 +1709,30 @@ 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""" From 21342c26604e6cac8e756015bea12fffe3356701 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 22:39:32 -0700 Subject: [PATCH 05/17] fix: Ensure single notification for confirmations Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/tui/app.py | 4 ---- cecli/tui/io.py | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cecli/tui/app.py b/cecli/tui/app.py index df2520c9ddd..e92feec1653 100644 --- a/cecli/tui/app.py +++ b/cecli/tui/app.py @@ -535,10 +535,6 @@ def start_task(self, task_id, title, task_type="general"): def show_confirmation(self, msg): """Show inline confirmation bar.""" - # Trigger notification - if self.worker and self.worker.coder and self.worker.coder.io: - self.worker.coder.io.notify_user_input_required() - # Disable input while confirm bar is active input_area = self.query_one("#input", InputArea) input_area.disabled = True diff --git a/cecli/tui/io.py b/cecli/tui/io.py index 845466a2f92..819fb7f746d 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -479,6 +479,7 @@ async def confirm_ask( res = group.preference self.user_input(f"{question} - {res}", log_only=False) else: + self.notify_user_input_required() # Send confirmation request to TUI with full options self.output_queue.put( { From 04a3df794b650bf3a24a2a752181f6a50a2f0d62 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 22:40:51 -0700 Subject: [PATCH 06/17] fix: Remove redundant ring_bell call in cecli/io.py Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/io.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cecli/io.py b/cecli/io.py index 5f76c6d6a77..1464ff57873 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -1302,7 +1302,6 @@ async def _confirm_ask( else: # Ring the bell if needed self.notify_user_input_required() - self.ring_bell() self.start_spinner("Awaiting Confirmation...", False) while True: From a5c9d9969328e82c533692bb1d0b58e5803c1080 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 11:13:36 -0700 Subject: [PATCH 07/17] fix: Remove unnecessary ring_bell call in base_coder --- cecli/coders/base_coder.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 5161ae55a7f..c8462207b9a 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -2768,7 +2768,6 @@ 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(): From e36519c6b9f8c7274187d522b121726918e981cc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 11:13:39 -0700 Subject: [PATCH 08/17] fix: Control notification triggering based on agent reflection Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/coders/base_coder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index c8462207b9a..226716e18cf 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -2197,9 +2197,10 @@ async def check_tokens(self, messages): def get_active_model(self): return self.main_model - async def send_message(self, inp): - # Notify IO that LLM processing is starting - self.io.llm_started() + async def send_message(self, inp, *, trigger_bell=True): + if trigger_bell: + # Notify IO that LLM processing is starting + self.io.llm_started() if inp: # Make sure current coder actually has control of conversation system From 646348f4a559e0ee39f1ab774bbd09ac04697998 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 11:19:11 -0700 Subject: [PATCH 09/17] fix: Control notification triggering in agent coder Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/coders/base_coder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 226716e18cf..0f6a1b256e5 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1607,6 +1607,7 @@ async def run_one(self, user_message, preproc): if not self.commands.is_command(user_message): self.last_user_message = user_message + is_reflection = False while True: self.reflected_message = None self.empty_response = False @@ -1624,9 +1625,11 @@ async def run_one(self, user_message, preproc): else: return - async for _ in self.send_message(message): + async for _ in self.send_message(message, trigger_bell=not is_reflection): pass + is_reflection = True + await self.hot_reload() if not self.empty_response: From 8e5ae7f6d828f9c1f24edb46b02a6dd1c1a14525 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 13:49:26 -0700 Subject: [PATCH 10/17] fix: Restore notification for user input prompts Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cecli/io.py b/cecli/io.py index 1464ff57873..914f05adfa6 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -1301,7 +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) while True: From 680f4f2ab6a8e224fac1a158f50d666736548bb3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 15:45:43 -0700 Subject: [PATCH 11/17] fix: Restore user input required notification Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro) --- cecli/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cecli/io.py b/cecli/io.py index 914f05adfa6..1464ff57873 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -1301,7 +1301,7 @@ async def _confirm_ask( self.user_input(f"{question} - {res}", log_only=False) else: # Ring the bell if needed - self.ring_bell() + self.notify_user_input_required() self.start_spinner("Awaiting Confirmation...", False) while True: From fc3cf6175a21e3a982c72b162a755560d9649eee Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Apr 2026 19:23:27 -0700 Subject: [PATCH 12/17] fix --- cecli/coders/base_coder.py | 13 +++++-------- cecli/io.py | 1 + cecli/tui/io.py | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 0f6a1b256e5..5161ae55a7f 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1607,7 +1607,6 @@ async def run_one(self, user_message, preproc): if not self.commands.is_command(user_message): self.last_user_message = user_message - is_reflection = False while True: self.reflected_message = None self.empty_response = False @@ -1625,11 +1624,9 @@ async def run_one(self, user_message, preproc): else: return - async for _ in self.send_message(message, trigger_bell=not is_reflection): + async for _ in self.send_message(message): pass - is_reflection = True - await self.hot_reload() if not self.empty_response: @@ -2200,10 +2197,9 @@ async def check_tokens(self, messages): def get_active_model(self): return self.main_model - async def send_message(self, inp, *, trigger_bell=True): - if trigger_bell: - # Notify IO that LLM processing is starting - self.io.llm_started() + async def send_message(self, inp): + # Notify IO that LLM processing is starting + self.io.llm_started() if inp: # Make sure current coder actually has control of conversation system @@ -2772,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(): diff --git a/cecli/io.py b/cecli/io.py index 1464ff57873..5f76c6d6a77 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -1302,6 +1302,7 @@ async def _confirm_ask( else: # Ring the bell if needed self.notify_user_input_required() + self.ring_bell() self.start_spinner("Awaiting Confirmation...", False) while True: diff --git a/cecli/tui/io.py b/cecli/tui/io.py index 819fb7f746d..845466a2f92 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -479,7 +479,6 @@ async def confirm_ask( res = group.preference self.user_input(f"{question} - {res}", log_only=False) else: - self.notify_user_input_required() # Send confirmation request to TUI with full options self.output_queue.put( { From 3ce87272cdabc7a4590ed39b51bebed1e6537778 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 12 Apr 2026 14:58:36 -0700 Subject: [PATCH 13/17] cli-5: fixed black format issues --- cecli/coders/agent_coder.py | 3 ++- cecli/coders/base_coder.py | 5 ++--- cecli/io.py | 4 +--- cecli/sessions.py | 3 ++- cecli/tools/command.py | 4 +++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cecli/coders/agent_coder.py b/cecli/coders/agent_coder.py index 86916dd8ac3..c40a62f8c08 100644 --- a/cecli/coders/agent_coder.py +++ b/cecli/coders/agent_coder.py @@ -1015,7 +1015,8 @@ def _generate_tool_context(self, repetitive_tools): 1 if isinstance(self.get_active_model().use_temperature, bool) else float(self.get_active_model().use_temperature) - ) + 0.1, + ) + + 0.1, "frequency_penalty": 0.2, "presence_penalty": 0.1, } diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 5161ae55a7f..c7c4898fecb 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1127,9 +1127,8 @@ def _include_in_map(abs_path): "other_files": other_files, "mentioned_fnames": mentioned_fnames, "all_abs_files": all_abs_files, - "read_only_count": len(set(self.abs_read_only_fnames)) + len( - set(self.abs_read_only_stubs_fnames) - ), + "read_only_count": len(set(self.abs_read_only_fnames)) + + len(set(self.abs_read_only_stubs_fnames)), } ) diff --git a/cecli/io.py b/cecli/io.py index 5f76c6d6a77..fe149426f4a 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -1712,9 +1712,7 @@ def get_default_notification_command(self): def _send_notification(self): if self.notifications_command: try: - result = subprocess.run( - self.notifications_command, shell=True, capture_output=True - ) + 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}") diff --git a/cecli/sessions.py b/cecli/sessions.py index b226def8ef5..f8d50ca8b86 100644 --- a/cecli/sessions.py +++ b/cecli/sessions.py @@ -73,7 +73,8 @@ def list_sessions(self) -> List[Dict]: "edit_format": session_data.get("edit_format", "unknown"), "num_messages": len( session_data.get("chat_history", {}).get("done_messages", []) - ) + len(session_data.get("chat_history", {}).get("cur_messages", [])), + ) + + len(session_data.get("chat_history", {}).get("cur_messages", [])), "num_files": ( len(session_data.get("files", {}).get("editable", [])) + len(session_data.get("files", {}).get("read_only", [])) diff --git a/cecli/tools/command.py b/cecli/tools/command.py index 8545c17230b..d69cdac2f28 100644 --- a/cecli/tools/command.py +++ b/cecli/tools/command.py @@ -122,7 +122,9 @@ async def _execute_with_timeout(cls, coder, command_string, timeout): from cecli.helpers.background_commands import CircularBuffer - coder.io.tool_output(f"⚙️ Executing shell command with {timeout}s timeout: {command_string}") + coder.io.tool_output( + f"⚙️ Executing shell command with {timeout}s timeout: {command_string}" + ) shell = os.environ.get("SHELL", "/bin/sh") From 5de9b855d98410546219d04e0eea9ff241b207a7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 12 Apr 2026 15:48:08 -0700 Subject: [PATCH 14/17] cli-5: fixed merge conflcits --- cecli/coders/base_coder.py | 6 ++++-- cecli/sessions.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 68301f1ac78..121b2d6580a 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1127,8 +1127,10 @@ def _include_in_map(abs_path): "other_files": other_files, "mentioned_fnames": mentioned_fnames, "all_abs_files": all_abs_files, - "read_only_count": len(set(self.abs_read_only_fnames)) - + len(set(self.abs_read_only_stubs_fnames)), + "read_only_count": ( + len(set(self.abs_read_only_fnames)) + + len(set(self.abs_read_only_stubs_fnames)) + ), } ) diff --git a/cecli/sessions.py b/cecli/sessions.py index f8d50ca8b86..5d8447d5213 100644 --- a/cecli/sessions.py +++ b/cecli/sessions.py @@ -71,10 +71,10 @@ def list_sessions(self) -> List[Dict]: "file": session_file, "model": session_data.get("model", "unknown"), "edit_format": session_data.get("edit_format", "unknown"), - "num_messages": len( - session_data.get("chat_history", {}).get("done_messages", []) - ) - + len(session_data.get("chat_history", {}).get("cur_messages", [])), + "num_messages": ( + len(session_data.get("chat_history", {}).get("done_messages", [])) + + len(session_data.get("chat_history", {}).get("cur_messages", [])) + ), "num_files": ( len(session_data.get("files", {}).get("editable", [])) + len(session_data.get("files", {}).get("read_only", [])) @@ -150,11 +150,11 @@ def _build_session_data(self, session_name) -> Dict: "editor_edit_format": self.coder.main_model.editor_edit_format, "edit_format": self.coder.edit_format, "chat_history": { - "done_messages": ConversationService.get_manager(self.coder).get_messages_dict( - MessageTag.DONE + "done_messages": ( + ConversationService.get_manager(self.coder).get_messages_dict(MessageTag.DONE) ), - "cur_messages": ConversationService.get_manager(self.coder).get_messages_dict( - MessageTag.CUR + "cur_messages": ( + ConversationService.get_manager(self.coder).get_messages_dict(MessageTag.CUR) ), }, "files": { From df389a9b72c7085b15113dcda61422b59405b2ff Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 12 Apr 2026 16:01:32 -0700 Subject: [PATCH 15/17] cli-5: fixed merge conflcits --- cecli/coders/agent_coder.py | 26 ++++++++++++++++++-------- cecli/io.py | 4 +++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cecli/coders/agent_coder.py b/cecli/coders/agent_coder.py index d6edbb84341..1ea6e5b0ca4 100644 --- a/cecli/coders/agent_coder.py +++ b/cecli/coders/agent_coder.py @@ -322,8 +322,10 @@ async def _execute_local_tool_calls(self, tool_calls_list): except Exception as e: self.model_kwargs = {} result_message = f"Error executing {tool_name}: {e}" - self.io.tool_error(f"""Error during {tool_name} execution: {e} -{traceback.format_exc()}""") + self.io.tool_error( + f"""Error during {tool_name} execution: {e} +{traceback.format_exc()}""" + ) tool_responses.append( {"role": "tool", "tool_call_id": tool_call.id, "content": result_message} ) @@ -390,9 +392,11 @@ async def _exec_async(): content_parts.append(item.text) return "".join(content_parts) except Exception as e: - self.io.tool_warning(f"""Executing {tool_name} on {server.name} failed: + self.io.tool_warning( + f"""Executing {tool_name} on {server.name} failed: Error: {e} -""") +""" + ) return f"Error executing tool call {tool_name}: {e}" return await _exec_async() @@ -621,7 +625,9 @@ def get_context_summary(self): size_indicator = ( "🔴 Large" if tokens > 5000 - else "🟡 Medium" if tokens > 1000 else "🟢 Small" + else "🟡 Medium" + if tokens > 1000 + else "🟢 Small" ) editable_files.append( f"- {rel_fname}: {tokens:,} tokens ({size_indicator})" @@ -645,7 +651,9 @@ def get_context_summary(self): size_indicator = ( "🔴 Large" if tokens > 5000 - else "🟡 Medium" if tokens > 1000 else "🟢 Small" + else "🟡 Medium" + if tokens > 1000 + else "🟢 Small" ) readonly_files.append( f"- {rel_fname}: {tokens:,} tokens ({size_indicator})" @@ -858,8 +866,10 @@ async def reply_completed(self): "I have processed the results of the previous tool calls. Let me analyze them" " and continue working towards your request." ) - next_prompt_parts.append(""" -I will proceed based on the tool results and updated context.""") + next_prompt_parts.append( + """ +I will proceed based on the tool results and updated context.""" + ) next_prompt_parts.append(f"\nYour original question was: {original_question}") self.reflected_message = "\n".join(next_prompt_parts) self.io.tool_output("Continuing exploration...") diff --git a/cecli/io.py b/cecli/io.py index fe149426f4a..db23ca7137b 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -470,7 +470,9 @@ def __init__( self.newline = ( None if line_endings in ("platform", "preserve") - else "\n" if line_endings == "lf" else "\r\n" + else "\n" + if line_endings == "lf" + else "\r\n" ) self.dry_run = dry_run From d00a2b22ce9ab2b5c075efadd8b976eb3c94114a Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 12 Apr 2026 16:06:08 -0700 Subject: [PATCH 16/17] cli-5: fixed merge conflcits --- cecli/coders/base_coder.py | 6 ++---- cecli/sessions.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 121b2d6580a..68301f1ac78 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1127,10 +1127,8 @@ def _include_in_map(abs_path): "other_files": other_files, "mentioned_fnames": mentioned_fnames, "all_abs_files": all_abs_files, - "read_only_count": ( - len(set(self.abs_read_only_fnames)) - + len(set(self.abs_read_only_stubs_fnames)) - ), + "read_only_count": len(set(self.abs_read_only_fnames)) + + len(set(self.abs_read_only_stubs_fnames)), } ) diff --git a/cecli/sessions.py b/cecli/sessions.py index 5d8447d5213..f8d50ca8b86 100644 --- a/cecli/sessions.py +++ b/cecli/sessions.py @@ -71,10 +71,10 @@ def list_sessions(self) -> List[Dict]: "file": session_file, "model": session_data.get("model", "unknown"), "edit_format": session_data.get("edit_format", "unknown"), - "num_messages": ( - len(session_data.get("chat_history", {}).get("done_messages", [])) - + len(session_data.get("chat_history", {}).get("cur_messages", [])) - ), + "num_messages": len( + session_data.get("chat_history", {}).get("done_messages", []) + ) + + len(session_data.get("chat_history", {}).get("cur_messages", [])), "num_files": ( len(session_data.get("files", {}).get("editable", [])) + len(session_data.get("files", {}).get("read_only", [])) @@ -150,11 +150,11 @@ def _build_session_data(self, session_name) -> Dict: "editor_edit_format": self.coder.main_model.editor_edit_format, "edit_format": self.coder.edit_format, "chat_history": { - "done_messages": ( - ConversationService.get_manager(self.coder).get_messages_dict(MessageTag.DONE) + "done_messages": ConversationService.get_manager(self.coder).get_messages_dict( + MessageTag.DONE ), - "cur_messages": ( - ConversationService.get_manager(self.coder).get_messages_dict(MessageTag.CUR) + "cur_messages": ConversationService.get_manager(self.coder).get_messages_dict( + MessageTag.CUR ), }, "files": { From 5899fce5c630c2afaa48f507450724ccec2cf7d9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 12 Apr 2026 16:40:40 -0700 Subject: [PATCH 17/17] fixed black format issues --- cecli/coders/agent_coder.py | 26 ++++++++------------------ cecli/coders/base_coder.py | 5 +++-- cecli/io.py | 4 +--- cecli/sessions.py | 3 +-- cecli/tools/command.py | 4 +--- 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/cecli/coders/agent_coder.py b/cecli/coders/agent_coder.py index 1ea6e5b0ca4..d6edbb84341 100644 --- a/cecli/coders/agent_coder.py +++ b/cecli/coders/agent_coder.py @@ -322,10 +322,8 @@ async def _execute_local_tool_calls(self, tool_calls_list): except Exception as e: self.model_kwargs = {} result_message = f"Error executing {tool_name}: {e}" - self.io.tool_error( - f"""Error during {tool_name} execution: {e} -{traceback.format_exc()}""" - ) + self.io.tool_error(f"""Error during {tool_name} execution: {e} +{traceback.format_exc()}""") tool_responses.append( {"role": "tool", "tool_call_id": tool_call.id, "content": result_message} ) @@ -392,11 +390,9 @@ async def _exec_async(): content_parts.append(item.text) return "".join(content_parts) except Exception as e: - self.io.tool_warning( - f"""Executing {tool_name} on {server.name} failed: + self.io.tool_warning(f"""Executing {tool_name} on {server.name} failed: Error: {e} -""" - ) +""") return f"Error executing tool call {tool_name}: {e}" return await _exec_async() @@ -625,9 +621,7 @@ def get_context_summary(self): size_indicator = ( "🔴 Large" if tokens > 5000 - else "🟡 Medium" - if tokens > 1000 - else "🟢 Small" + else "🟡 Medium" if tokens > 1000 else "🟢 Small" ) editable_files.append( f"- {rel_fname}: {tokens:,} tokens ({size_indicator})" @@ -651,9 +645,7 @@ def get_context_summary(self): size_indicator = ( "🔴 Large" if tokens > 5000 - else "🟡 Medium" - if tokens > 1000 - else "🟢 Small" + else "🟡 Medium" if tokens > 1000 else "🟢 Small" ) readonly_files.append( f"- {rel_fname}: {tokens:,} tokens ({size_indicator})" @@ -866,10 +858,8 @@ async def reply_completed(self): "I have processed the results of the previous tool calls. Let me analyze them" " and continue working towards your request." ) - next_prompt_parts.append( - """ -I will proceed based on the tool results and updated context.""" - ) + next_prompt_parts.append(""" +I will proceed based on the tool results and updated context.""") next_prompt_parts.append(f"\nYour original question was: {original_question}") self.reflected_message = "\n".join(next_prompt_parts) self.io.tool_output("Continuing exploration...") diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 68301f1ac78..a8a12aa471f 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1127,8 +1127,9 @@ def _include_in_map(abs_path): "other_files": other_files, "mentioned_fnames": mentioned_fnames, "all_abs_files": all_abs_files, - "read_only_count": len(set(self.abs_read_only_fnames)) - + len(set(self.abs_read_only_stubs_fnames)), + "read_only_count": len(set(self.abs_read_only_fnames)) + len( + set(self.abs_read_only_stubs_fnames) + ), } ) diff --git a/cecli/io.py b/cecli/io.py index db23ca7137b..fe149426f4a 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -470,9 +470,7 @@ def __init__( self.newline = ( None if line_endings in ("platform", "preserve") - else "\n" - if line_endings == "lf" - else "\r\n" + else "\n" if line_endings == "lf" else "\r\n" ) self.dry_run = dry_run diff --git a/cecli/sessions.py b/cecli/sessions.py index f8d50ca8b86..b226def8ef5 100644 --- a/cecli/sessions.py +++ b/cecli/sessions.py @@ -73,8 +73,7 @@ def list_sessions(self) -> List[Dict]: "edit_format": session_data.get("edit_format", "unknown"), "num_messages": len( session_data.get("chat_history", {}).get("done_messages", []) - ) - + len(session_data.get("chat_history", {}).get("cur_messages", [])), + ) + len(session_data.get("chat_history", {}).get("cur_messages", [])), "num_files": ( len(session_data.get("files", {}).get("editable", [])) + len(session_data.get("files", {}).get("read_only", [])) diff --git a/cecli/tools/command.py b/cecli/tools/command.py index 46c18a5b011..e6cd80bb8e9 100644 --- a/cecli/tools/command.py +++ b/cecli/tools/command.py @@ -183,9 +183,7 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Fal from cecli.helpers.background_commands import CircularBuffer - coder.io.tool_output( - f"⚙️ Executing shell command with {timeout}s timeout: {command_string}" - ) + coder.io.tool_output(f"⚙️ Executing shell command with {timeout}s timeout: {command_string}") shell = os.environ.get("SHELL", "/bin/sh")