From 53bee4db2d33992ecaab30ad78ee7c4634f6e09d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 21 Nov 2025 01:22:34 +0300 Subject: [PATCH] bash fix --- .forgejo/workflows/agent-development.yml | 20 +++++++++++++++++--- .forgejo/workflows/agent-planning.yml | 20 +++++++++++++++++--- tools/agent/cursor_cli_wrapper.py | 16 +++++++++++++++- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/agent-development.yml b/.forgejo/workflows/agent-development.yml index f107336..eb1eb9d 100644 --- a/.forgejo/workflows/agent-development.yml +++ b/.forgejo/workflows/agent-development.yml @@ -107,10 +107,22 @@ jobs: MAX_ITERATIONS: 10 MAX_RETRIES: 3 TIMEOUT_HOURS: 6 - PATH: ${{ env.PATH }}:$HOME/.cursor/bin + PATH: /usr/bin:/bin:$HOME/.local/bin:$HOME/.cursor/bin:${{ env.PATH }} run: | - # Ensure cursor-agent is in PATH for this step - export PATH="$HOME/.local/bin:$HOME/.cursor/bin:$PATH" + # Ensure bash and cursor-agent are in PATH for this step + export PATH="/usr/bin:/bin:$HOME/.local/bin:$HOME/.cursor/bin:$PATH" + + # Verify bash is accessible + if ! command -v bash &> /dev/null; then + echo "❌ bash not found in PATH" + echo "PATH: $PATH" + echo "Looking for bash..." + find /usr /bin -name "bash" -type f 2>/dev/null | head -5 || echo "No bash found" + exit 1 + else + echo "✅ bash found at: $(command -v bash)" + bash --version || echo "bash version check failed" + fi # Verify cursor-agent is accessible if ! command -v cursor-agent &> /dev/null; then @@ -128,6 +140,8 @@ jobs: find "$HOME" -name "cursor-agent" -type f 2>/dev/null | head -5 || echo "No cursor-agent found" exit 1 fi + else + echo "✅ cursor-agent found at: $(command -v cursor-agent)" fi cd ${{ github.workspace }} diff --git a/.forgejo/workflows/agent-planning.yml b/.forgejo/workflows/agent-planning.yml index 6e7e2db..50ccea4 100644 --- a/.forgejo/workflows/agent-planning.yml +++ b/.forgejo/workflows/agent-planning.yml @@ -71,10 +71,22 @@ jobs: CURSOR_MODEL: ${{ secrets.CURSOR_MODEL }} PROJECT_ROOT: ${{ github.workspace }} MAX_ITERATIONS: 10 - PATH: ${{ env.PATH }}:$HOME/.cursor/bin + PATH: /usr/bin:/bin:$HOME/.local/bin:$HOME/.cursor/bin:${{ env.PATH }} run: | - # Ensure cursor-agent is in PATH for this step - export PATH="$HOME/.local/bin:$HOME/.cursor/bin:$PATH" + # Ensure bash and cursor-agent are in PATH for this step + export PATH="/usr/bin:/bin:$HOME/.local/bin:$HOME/.cursor/bin:$PATH" + + # Verify bash is accessible + if ! command -v bash &> /dev/null; then + echo "❌ bash not found in PATH" + echo "PATH: $PATH" + echo "Looking for bash..." + find /usr /bin -name "bash" -type f 2>/dev/null | head -5 || echo "No bash found" + exit 1 + else + echo "✅ bash found at: $(command -v bash)" + bash --version || echo "bash version check failed" + fi # Verify cursor-agent is accessible if ! command -v cursor-agent &> /dev/null; then @@ -92,6 +104,8 @@ jobs: find "$HOME" -name "cursor-agent" -type f 2>/dev/null | head -5 || echo "No cursor-agent found" exit 1 fi + else + echo "✅ cursor-agent found at: $(command -v cursor-agent)" fi cd ${{ github.workspace }} diff --git a/tools/agent/cursor_cli_wrapper.py b/tools/agent/cursor_cli_wrapper.py index 42e8ad7..92831ad 100644 --- a/tools/agent/cursor_cli_wrapper.py +++ b/tools/agent/cursor_cli_wrapper.py @@ -110,10 +110,24 @@ class CursorCLI: # Add task description cmd.append(task_description) - # Set environment + # Set environment with PATH including bash location + current_path = os.environ.get("PATH", "") + # Ensure common bash locations are in PATH + bash_paths = [ + "/usr/bin", + "/bin", + os.path.expanduser("~/.local/bin"), + os.path.expanduser("~/.cursor/bin"), + ] + + # Add bash paths if they exist + additional_paths = ":".join([p for p in bash_paths if os.path.exists(p)]) + new_path = ":".join([additional_paths, current_path]) if additional_paths else current_path + env = { "CURSOR_API_KEY": self.api_key, "CURSOR_MODEL": self.model, + "PATH": new_path, } if self.verbose: