diff --git a/cli.py b/cli.py index bccc691f..c15bd87b 100644 --- a/cli.py +++ b/cli.py @@ -31,7 +31,6 @@ from typing import List, Dict, Any, Optional logger = logging.getLogger(__name__) # Suppress startup messages for clean CLI experience -os.environ["MSWEA_SILENT_STARTUP"] = "1" # suppress mini-swe-agent startup noise if installed os.environ["HERMES_QUIET"] = "1" # Our own modules import yaml @@ -78,8 +77,6 @@ _hermes_home = Path(os.getenv("HERMES_HOME", Path.home() / ".hermes")) _project_env = Path(__file__).parent / '.env' load_hermes_dotenv(hermes_home=_hermes_home, project_env=_project_env) -# Point mini-swe-agent at ~/.hermes/ if installed (RL training use) -os.environ.setdefault("MSWEA_GLOBAL_CONFIG_DIR", str(_hermes_home)) # ============================================================================= # Configuration Loading @@ -4444,7 +4441,7 @@ class HermesCLI: logging.getLogger(noisy).setLevel(logging.WARNING) else: logging.getLogger().setLevel(logging.INFO) - for quiet_logger in ('tools', 'minisweagent', 'run_agent', 'trajectory_compressor', 'cron', 'hermes_cli'): + for quiet_logger in ('tools', 'run_agent', 'trajectory_compressor', 'cron', 'hermes_cli'): logging.getLogger(quiet_logger).setLevel(logging.ERROR) def _show_insights(self, command: str = "/insights"): diff --git a/environments/README.md b/environments/README.md index 7e5896f7..f2d1a795 100644 --- a/environments/README.md +++ b/environments/README.md @@ -101,7 +101,7 @@ Available methods: ### Patches (`patches.py`) -**Problem**: Some hermes-agent tools use `asyncio.run()` internally (e.g., mini-swe-agent's Modal backend via SWE-ReX). This crashes when called from inside Atropos's event loop because `asyncio.run()` cannot be nested. +**Problem**: Some hermes-agent tools use `asyncio.run()` internally (e.g., the Modal backend via SWE-ReX). This crashes when called from inside Atropos's event loop because `asyncio.run()` cannot be nested. **Solution**: `patches.py` monkey-patches `SwerexModalEnvironment` to use a dedicated background thread (`_AsyncWorker`) with its own event loop. The calling code sees the same sync interface, but internally the async work happens on a separate thread that doesn't conflict with Atropos's loop. diff --git a/environments/agent_loop.py b/environments/agent_loop.py index 53b01ed2..11a8a01f 100644 --- a/environments/agent_loop.py +++ b/environments/agent_loop.py @@ -23,7 +23,7 @@ from typing import Any, Dict, List, Optional, Set from model_tools import handle_function_call # Thread pool for running sync tool calls that internally use asyncio.run() -# (e.g., mini-swe-agent's modal/docker/daytona backends). Running them in a separate +# (e.g., the Modal/Docker/Daytona terminal backends). Running them in a separate # thread gives them a clean event loop so they don't deadlock inside Atropos's loop. # Size must be large enough for concurrent eval tasks (e.g., 89 TB2 tasks all # making tool calls). Too small = thread pool starvation, tasks queue for minutes. diff --git a/hermes_cli/doctor.py b/hermes_cli/doctor.py index a28433dd..c456ff27 100644 --- a/hermes_cli/doctor.py +++ b/hermes_cli/doctor.py @@ -26,10 +26,6 @@ if _env_path.exists(): # Also try project .env as dev fallback load_dotenv(PROJECT_ROOT / ".env", override=False, encoding="utf-8") -# Point mini-swe-agent at ~/.hermes/ so it shares our config -os.environ.setdefault("MSWEA_GLOBAL_CONFIG_DIR", str(HERMES_HOME)) -os.environ.setdefault("MSWEA_SILENT_STARTUP", "1") - from hermes_cli.colors import Colors, color from hermes_constants import OPENROUTER_MODELS_URL @@ -618,18 +614,6 @@ def run_doctor(args): print() print(color("ā—† Submodules", Colors.CYAN, Colors.BOLD)) - # mini-swe-agent (terminal tool backend) - mini_swe_dir = PROJECT_ROOT / "mini-swe-agent" - if mini_swe_dir.exists() and (mini_swe_dir / "pyproject.toml").exists(): - try: - __import__("minisweagent") - check_ok("mini-swe-agent", "(terminal backend)") - except ImportError: - check_warn("mini-swe-agent found but not installed", "(run: uv pip install -e ./mini-swe-agent)") - issues.append("Install mini-swe-agent: uv pip install -e ./mini-swe-agent") - else: - check_warn("mini-swe-agent not found", "(run: git submodule update --init --recursive)") - # tinker-atropos (RL training backend) tinker_dir = PROJECT_ROOT / "tinker-atropos" if tinker_dir.exists() and (tinker_dir / "pyproject.toml").exists(): diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 9a298948..7fe5eb29 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -60,9 +60,6 @@ from hermes_cli.config import get_hermes_home from hermes_cli.env_loader import load_hermes_dotenv load_hermes_dotenv(project_env=PROJECT_ROOT / '.env') -# Point mini-swe-agent at ~/.hermes/ so it shares our config -os.environ.setdefault("MSWEA_GLOBAL_CONFIG_DIR", str(get_hermes_home())) -os.environ.setdefault("MSWEA_SILENT_STARTUP", "1") import logging import time as _time diff --git a/pyproject.toml b/pyproject.toml index 7140eaff..0b5fa78a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ hermes-agent = "run_agent:main" hermes-acp = "acp_adapter.entry:main" [tool.setuptools] -py-modules = ["run_agent", "model_tools", "toolsets", "batch_runner", "trajectory_compressor", "toolset_distributions", "cli", "hermes_constants", "hermes_state", "hermes_time", "mini_swe_runner", "rl_cli", "utils"] +py-modules = ["run_agent", "model_tools", "toolsets", "batch_runner", "trajectory_compressor", "toolset_distributions", "cli", "hermes_constants", "hermes_state", "hermes_time", "rl_cli", "utils"] [tool.setuptools.packages.find] include = ["agent", "tools", "tools.*", "hermes_cli", "gateway", "gateway.*", "cron", "honcho_integration", "acp_adapter"] diff --git a/requirements.txt b/requirements.txt index 67b05659..6e65cc82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,12 +23,6 @@ parallel-web>=0.4.2 # Image generation fal-client -# mini-swe-agent dependencies (for terminal tool) -# Note: Install mini-swe-agent itself with: pip install -e ./mini-swe-agent -litellm>=1.75.5 -typer -platformdirs - # Text-to-speech (Edge TTS is free, no API key needed) edge-tts diff --git a/run_agent.py b/run_agent.py index 976bc318..a09d898d 100644 --- a/run_agent.py +++ b/run_agent.py @@ -58,9 +58,6 @@ if _loaded_env_paths: else: logger.info("No .env file found. Using system environment variables.") -# Point mini-swe-agent at ~/.hermes/ if installed (RL training use) -os.environ.setdefault("MSWEA_GLOBAL_CONFIG_DIR", str(_hermes_home)) -os.environ.setdefault("MSWEA_SILENT_STARTUP", "1") # Import our tool system from model_tools import get_tool_definitions, handle_function_call, check_toolset_requirements @@ -661,7 +658,7 @@ class AIAgent: # INFO/WARNING messages just clutter it. for quiet_logger in [ 'tools', # all tools.* (terminal, browser, web, file, etc.) - 'minisweagent', # mini-swe-agent execution backend + 'run_agent', # agent runner internals 'trajectory_compressor', 'cron', # scheduler (only relevant in daemon mode) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 381d3a50..e8b17a77 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -505,7 +505,7 @@ function Install-Repository { git -c windows.appendAtomically=false config windows.appendAtomically false 2>$null # Ensure submodules are initialized and updated - Write-Info "Initializing submodules (mini-swe-agent, tinker-atropos)..." + Write-Info "Initializing submodules..." git -c windows.appendAtomically=false submodule update --init --recursive 2>$null if ($LASTEXITCODE -ne 0) { Write-Warn "Submodule init failed (terminal/RL tools may need manual setup)" @@ -559,19 +559,7 @@ function Install-Dependencies { Write-Success "Main package installed" - # Install submodules - Write-Info "Installing mini-swe-agent (terminal tool backend)..." - if (Test-Path "mini-swe-agent\pyproject.toml") { - try { - & $UvCmd pip install -e ".\mini-swe-agent" 2>&1 | Out-Null - Write-Success "mini-swe-agent installed" - } catch { - Write-Warn "mini-swe-agent install failed (terminal tools may not work)" - } - } else { - Write-Warn "mini-swe-agent not found (run: git submodule update --init)" - } - + # Install optional submodules Write-Info "Installing tinker-atropos (RL training backend)..." if (Test-Path "tinker-atropos\pyproject.toml") { try { diff --git a/tests/test_minisweagent_path.py b/tests/test_minisweagent_path.py index 98c4eb37..965e4cfd 100644 --- a/tests/test_minisweagent_path.py +++ b/tests/test_minisweagent_path.py @@ -1,5 +1,2 @@ -"""Tests for minisweagent_path.py — REMOVED. - -minisweagent_path.py was removed as part of dropping the mini-swe-agent -dependency. These tests are no longer applicable. -""" +# This file intentionally left empty. +# minisweagent_path.py was removed — see PR #2804. diff --git a/tools/__init__.py b/tools/__init__.py index 6c02865d..9b254229 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -6,7 +6,7 @@ This package contains all the specific tool implementations for the Hermes Agent Each module provides specialized functionality for different capabilities: - web_tools: Web search, content extraction, and crawling -- terminal_tool: Command execution using mini-swe-agent (local/docker/modal/daytona backends) +- terminal_tool: Command execution (local/docker/modal/daytona/ssh/singularity backends) - vision_tools: Image analysis and understanding - mixture_of_agents_tool: Multi-model collaborative reasoning - image_generation_tool: Text-to-image generation with upscaling @@ -23,7 +23,7 @@ from .web_tools import ( check_firecrawl_api_key ) -# Primary terminal tool (mini-swe-agent backend: local/docker/singularity/modal/daytona) +# Primary terminal tool (local/docker/singularity/modal/daytona/ssh) from .terminal_tool import ( terminal_tool, check_terminal_requirements, @@ -166,7 +166,7 @@ __all__ = [ 'web_extract_tool', 'web_crawl_tool', 'check_firecrawl_api_key', - # Terminal tools (mini-swe-agent backend) + # Terminal tools 'terminal_tool', 'check_terminal_requirements', 'cleanup_vm', diff --git a/tools/code_execution_tool.py b/tools/code_execution_tool.py index 8ee88ae3..c4c56a77 100644 --- a/tools/code_execution_tool.py +++ b/tools/code_execution_tool.py @@ -442,7 +442,7 @@ def execute_code( child_env["HERMES_RPC_SOCKET"] = sock_path child_env["PYTHONDONTWRITEBYTECODE"] = "1" # Ensure the hermes-agent root is importable in the sandbox so - # modules like minisweagent_path are available to child scripts. + # repo-root modules are available to child scripts. _hermes_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) _existing_pp = child_env.get("PYTHONPATH", "") child_env["PYTHONPATH"] = _hermes_root + (os.pathsep + _existing_pp if _existing_pp else "") diff --git a/tools/terminal_tool.py b/tools/terminal_tool.py index f4869bc2..c7a310df 100644 --- a/tools/terminal_tool.py +++ b/tools/terminal_tool.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 """ -Terminal Tool Module (mini-swe-agent backend) +Terminal Tool Module -A terminal tool that executes commands using mini-swe-agent's execution environments. +A terminal tool that executes commands in local, Docker, Modal, SSH, Singularity, and Daytona environments. Supports local execution, Docker containers, and Modal cloud sandboxes. Environment Selection (via TERMINAL_ENV environment variable): @@ -532,7 +532,7 @@ def _create_environment(env_type: str, image: str, cwd: str, timeout: int, task_id: str = "default", host_cwd: str = None): """ - Create an execution environment from mini-swe-agent. + Create an execution environment for sandboxed command execution. Args: env_type: One of "local", "docker", "singularity", "modal", "daytona", "ssh" @@ -847,7 +847,7 @@ def terminal_tool( pty: bool = False, ) -> str: """ - Execute a command using mini-swe-agent's execution environments. + Execute a command in the configured terminal environment. Args: command: The command to execute @@ -982,7 +982,7 @@ def terminal_tool( return json.dumps({ "output": "", "exit_code": -1, - "error": f"Terminal tool disabled: mini-swe-agent not available ({e})", + "error": f"Terminal tool disabled: environment creation failed ({e})", "status": "disabled" }, ensure_ascii=False) @@ -1267,7 +1267,7 @@ if __name__ == "__main__": print("\nāœ… All requirements met!") print("\nAvailable Tool:") - print(" - terminal_tool: Execute commands using mini-swe-agent environments") + print(" - terminal_tool: Execute commands in sandboxed environments") print("\nUsage Examples:") print(" # Execute a command") diff --git a/website/docs/developer-guide/contributing.md b/website/docs/developer-guide/contributing.md index 5f653eae..1d1e24c6 100644 --- a/website/docs/developer-guide/contributing.md +++ b/website/docs/developer-guide/contributing.md @@ -49,7 +49,6 @@ export VIRTUAL_ENV="$(pwd)/venv" # Install with all extras (messaging, cron, CLI menus, dev tools) uv pip install -e ".[all,dev]" -uv pip install -e "./mini-swe-agent" uv pip install -e "./tinker-atropos" # Optional: browser tools diff --git a/website/docs/getting-started/installation.md b/website/docs/getting-started/installation.md index a43d7370..83ed9555 100644 --- a/website/docs/getting-started/installation.md +++ b/website/docs/getting-started/installation.md @@ -132,13 +132,10 @@ You can combine extras: `uv pip install -e ".[messaging,cron]"` -### Step 4: Install Submodule Packages +### Step 4: Install Optional Submodules (if needed) ```bash -# Terminal tool backend (required for terminal/command-execution) -uv pip install -e "./mini-swe-agent" - -# RL training backend +# RL training backend (optional) uv pip install -e "./tinker-atropos" ``` @@ -238,7 +235,6 @@ export VIRTUAL_ENV="$(pwd)/venv" # Install everything uv pip install -e ".[all]" -uv pip install -e "./mini-swe-agent" uv pip install -e "./tinker-atropos" npm install # optional, for browser tools and WhatsApp diff --git a/website/docs/getting-started/updating.md b/website/docs/getting-started/updating.md index 5ddb6472..a44c7706 100644 --- a/website/docs/getting-started/updating.md +++ b/website/docs/getting-started/updating.md @@ -44,7 +44,6 @@ git submodule update --init --recursive # Reinstall (picks up new dependencies) uv pip install -e ".[all]" -uv pip install -e "./mini-swe-agent" uv pip install -e "./tinker-atropos" # Check for new config options