diff --git a/hermes_cli/cli_commands_mixin.py b/hermes_cli/cli_commands_mixin.py index abd1a5bca0..54e086d1b1 100644 --- a/hermes_cli/cli_commands_mixin.py +++ b/hermes_cli/cli_commands_mixin.py @@ -1990,9 +1990,6 @@ class CLICommandsMixin: self._app.invalidate() bg_agent.thinking_callback = _bg_thinking - # /bg prompts paint on this terminal: they wait until answered, like the foreground turn's. - from tools.approval_context import reset_prompts_wait_for_answer, set_prompts_wait_for_answer - prompts_token = set_prompts_wait_for_answer() try: result = bg_agent.run_conversation(user_message=prompt, task_id=task_id) response = result.get("final_response", "") if result else "" @@ -2000,7 +1997,6 @@ class CLICommandsMixin: response = _gt("model.error_prefix", error=result["error"]) return response finally: - reset_prompts_wait_for_answer(prompts_token) # One agent per /bg task in a long-lived CLI process: close() # is the owner boundary (memory shutdown, tool subprocesses, # httpx clients); an unclosed side agent leaks all of them diff --git a/tests/hermes_cli/test_cli_approval_ui.py b/tests/hermes_cli/test_cli_approval_ui.py index a7ee0071b3..b015dc96e7 100644 --- a/tests/hermes_cli/test_cli_approval_ui.py +++ b/tests/hermes_cli/test_cli_approval_ui.py @@ -7,7 +7,6 @@ from unittest.mock import MagicMock, patch import cli as cli_module from agent.i18n import t from cli import HermesCLI -from tools import approval_context class _FakeBuffer: @@ -262,7 +261,6 @@ class TestCliApprovalUi: seen["approval"] = _get_approval_callback() seen["sudo"] = _get_sudo_password_callback() - seen["approval_wait"] = approval_context.approval_wait_seconds() return { "final_response": "done", "messages": [], @@ -271,7 +269,6 @@ class TestCliApprovalUi: } with patch("run_agent.AIAgent", FakeAgent), \ - patch.object(approval_context, "_get_approval_config", lambda: {"timeout": 1}), \ patch.object(cli_module, "_cprint"), \ patch.object(cli_module, "ChatConsole") as chat_console: chat_console.return_value.print = MagicMock() @@ -287,8 +284,6 @@ class TestCliApprovalUi: assert seen["approval"].__func__ is HermesCLI._approval_callback assert seen["sudo"].__self__ is cli assert seen["sudo"].__func__ is HermesCLI._sudo_password_callback - # The panel waits until answered, so the turn's accounting must too (not approvals.timeout). - assert seen["approval_wait"] > 1 assert not cli._background_tasks