diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index 2b2fbdb40be..4f6ef4736e0 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -1457,7 +1457,11 @@ 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 + ) + await self.output_task(preproc, single_run=True) return self.partial_response_content # Initialize state for task coordination @@ -1576,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. @@ -1621,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 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):