From 79278535a0d04db16fc558f6e99e88b59b72badb Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 30 May 2026 18:00:22 -0700 Subject: [PATCH 1/3] refactor: Use non-blocking loop for sub-agent execution Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro) --- cecli/coders/base_coder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 2b2fbdb40be..fe4cf27dd75 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1457,7 +1457,12 @@ async def _run_parallel(self, with_message=None, preproc=True): try: if with_message: self.io.user_input(with_message) - await self.run_one(with_message, preproc) + self.output_running = True + self.user_message = ( + await self.preproc_user_input(with_message) if preproc else with_message + ) + output_task = asyncio.create_task(self.output_task(preproc)) + await output_task return self.partial_response_content # Initialize state for task coordination From 7ecf9a7ad1cd47e6ba4586d3b84797fb84346e61 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 30 May 2026 18:55:31 -0700 Subject: [PATCH 2/3] refactor: Use non-blocking loop for sub-agent execution Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro) --- cecli/coders/base_coder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index fe4cf27dd75..4f6ef4736e0 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1461,8 +1461,7 @@ async def _run_parallel(self, with_message=None, preproc=True): self.user_message = ( await self.preproc_user_input(with_message) if preproc else with_message ) - output_task = asyncio.create_task(self.output_task(preproc)) - await output_task + await self.output_task(preproc, single_run=True) return self.partial_response_content # Initialize state for task coordination @@ -1581,7 +1580,7 @@ async def input_task(self, preproc): if self.verbose or self.args.debug: print(e) - async def output_task(self, preproc): + async def output_task(self, preproc, single_run=False): """ Handles output task generation and monitoring. This task manages the output loop and coordinates with input_task. @@ -1626,6 +1625,9 @@ async def output_task(self, preproc): # And stop monitoring the output task await self.io.stop_output_task() + if single_run: + break + await self.auto_save_session() await asyncio.sleep(0.1) # Small yield to prevent tight loop From 5587df0c48b89b7b8b5f189e86722161e668eb3c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 30 May 2026 19:21:54 -0700 Subject: [PATCH 3/3] cli-42: switch and spawn agents dont show completion notification --- cecli/commands/spawn_agent.py | 1 + cecli/commands/switch_agent.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cecli/commands/spawn_agent.py b/cecli/commands/spawn_agent.py index afde0c2e799..ff1809b89f9 100644 --- a/cecli/commands/spawn_agent.py +++ b/cecli/commands/spawn_agent.py @@ -6,6 +6,7 @@ class SpawnAgentCommand(BaseCommand): NORM_NAME = "spawn-agent" DESCRIPTION = "Spawn a sub-agent without a prompt (waits for user input)" + show_completion_notification = False @classmethod async def execute(cls, io, coder, args, **kwargs): diff --git a/cecli/commands/switch_agent.py b/cecli/commands/switch_agent.py index 7f4697e0da2..4249aed88e4 100644 --- a/cecli/commands/switch_agent.py +++ b/cecli/commands/switch_agent.py @@ -8,6 +8,7 @@ class SwitchAgentCommand(BaseCommand): NORM_NAME = "switch-agent" DESCRIPTION = "Switch to a specific agent by name" + show_completion_notification = False @classmethod async def execute(cls, io, coder, args, **kwargs):