The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Revert "fix(cli): /bg turns hold their prompts open like the foreground turn"
teknium1734a94400a32
diff --git a/hermes_cli/cli_commands_mixin.py b/hermes_cli/cli_commands_mixin.pyindex abd1a5bca0d..54e086d1b11 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 responsefinally:- 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 themdiff --git a/tests/hermes_cli/test_cli_approval_ui.py b/tests/hermes_cli/test_cli_approval_ui.pyindex a7ee0071b33..b015dc96e73 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, patchimport cli as cli_modulefrom agent.i18n import tfrom cli import HermesCLI-from tools import approval_contextclass _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_callbackassert seen["sudo"].__self__ is cliassert 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"] > 1assert not cli._background_tasks