diff --git a/.gitignore b/.gitignore index c1f632e..a2a10dd 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,9 @@ tests/tmp/ tests/*.local.py scripts/test_*.sh *.test.sh +# Ignore all test_*.py scripts in tests/ +tests/test_*.py +*.test.sh # Workspaces directory (user data should not be committed) /workspaces/ diff --git a/pentestagent/interface/tui.py b/pentestagent/interface/tui.py index 1e8870a..eeb0cab 100644 --- a/pentestagent/interface/tui.py +++ b/pentestagent/interface/tui.py @@ -1919,8 +1919,8 @@ Be concise. Use the actual data from notes.""" # Use assist mode by default if self.agent and not self._is_running: - # Schedule assist run and keep task handle - self._current_worker = asyncio.create_task(self._run_assist(message)) + # Schedule assist run and keep task handle (do not wrap in asyncio.create_task; @work returns a Worker) + self._current_worker = self._run_assist(message) async def _handle_command(self, cmd: str) -> None: """Handle slash commands""" @@ -2179,7 +2179,8 @@ Be concise. Use the actual data from notes.""" if self.agent and not self._is_running: # Schedule agent mode and keep task handle - self._current_worker = asyncio.create_task(self._run_agent_mode(task)) + # Schedule agent run and keep task handle (do not wrap in asyncio.create_task; @work returns a Worker) + self._current_worker = self._run_agent_mode(task) async def _parse_crew_command(self, cmd: str) -> None: """Parse and execute /crew command""" @@ -2208,7 +2209,8 @@ Be concise. Use the actual data from notes.""" self._add_user(f"/crew {target}") self._show_sidebar() # Schedule crew mode and keep handle - self._current_worker = asyncio.create_task(self._run_crew_mode(target)) + # Schedule crew run and keep task handle (do not wrap in asyncio.create_task; @work returns a Worker) + self._current_worker = self._run_crew_mode(target) def _show_sidebar(self) -> None: """Show the sidebar for crew mode."""