diff --git a/checks.nix b/checks.nix index 923faf5..d0ee54f 100644 --- a/checks.nix +++ b/checks.nix @@ -17,12 +17,17 @@ echo "=== Checking key Python modules ===" SITE=${hermes-agent}/lib/python3.12/site-packages - for mod in agent cli.py gateway cron tools run_agent.py model_tools.py minisweagent_path.py acp_adapter honcho_integration; do + for mod in agent cli.py gateway cron tools run_agent.py model_tools.py acp_adapter honcho_integration; do if [ ! -e "$SITE/$mod" ] && [ ! -e "$SITE/$mod.py" ]; then echo "FAIL: Missing module $mod" exit 1 fi done + # mini-swe: upstream renamed minisweagent_path.py → mini_swe_runner.py + if [ ! -e "$SITE/minisweagent_path.py" ] && [ ! -e "$SITE/mini_swe_runner.py" ]; then + echo "FAIL: Missing module minisweagent_path.py or mini_swe_runner.py" + exit 1 + fi echo "PASS: All key modules present" echo "=== Checking wrapped PATH includes runtime deps ===" diff --git a/package.nix b/package.nix index 048b261..f22a28e 100644 --- a/package.nix +++ b/package.nix @@ -226,14 +226,19 @@ pythonPackages.buildPythonApplication { # Don't run tests during build doCheck = false; - # Upstream pyproject.toml is missing minisweagent_path from py-modules. - # Also ensure mini-swe-agent/src is importable. + # Upstream pyproject.toml may be missing minisweagent_path / mini_swe_runner + # from py-modules. Also ensure mini-swe-agent/src is importable. postPatch = '' # Fix: add minisweagent_path.py to py-modules if missing from pyproject.toml if [ -f minisweagent_path.py ] && ! grep -q minisweagent_path pyproject.toml; then sed -i 's/py-modules = \[/py-modules = ["minisweagent_path", /' pyproject.toml fi + # Fix: add mini_swe_runner.py to py-modules if missing (upstream rename) + if [ -f mini_swe_runner.py ] && ! grep -q mini_swe_runner pyproject.toml; then + sed -i 's/py-modules = \[/py-modules = ["mini_swe_runner", /' pyproject.toml + fi + # Make mini-swe-agent importable by copying src into the package if [ -d mini-swe-agent/src/minisweagent ]; then cp -r mini-swe-agent/src/minisweagent .