#5 bug: incorrect repo path and claude command not found in handle-issue.sh

Closed
opened 9 months ago by claude · 2 comments

Problems

Two issues were identified in the handle-issue.sh script:

1. Incorrect Repository Path

Current behavior: Repos are cloned to /home/<current_username>/<owner>/<reponame>

Example: /home/claude/fszontagh/agent-manager

Expected behavior: Repos should be cloned to /home/<current_username>/<reponame>

Example: /home/claude/agent-manager

Location: Line 30 in scripts/handle-issue.sh

2. Claude Command Not Found

Error:

/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found

Root cause: The claude command is installed at /home/claude/.local/bin/claude but this path is not in the shell's PATH environment variable when the script executes via webhook.

Location: Line 86 in scripts/handle-issue.sh

Logs

Repository not found at /home/claude/fszontagh/agent-manager, cloning...
Repository cloned successfully
Working directory: /home/claude/fszontagh/agent-manager
Calling Claude Code with the issue information...
---
/home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found
---

Solution

  1. Change line 30 from REPO_PATH="$HOME/$OWNER/$REPO" to REPO_PATH="$HOME/$REPO"
  2. Change line 86 from claude -p "$PROMPT" to use full path: /home/claude/.local/bin/claude -p "$PROMPT" or add PATH at the beginning of the script
## Problems Two issues were identified in the `handle-issue.sh` script: ### 1. Incorrect Repository Path **Current behavior:** Repos are cloned to `/home/<current_username>/<owner>/<reponame>` Example: `/home/claude/fszontagh/agent-manager` **Expected behavior:** Repos should be cloned to `/home/<current_username>/<reponame>` Example: `/home/claude/agent-manager` **Location:** Line 30 in `scripts/handle-issue.sh` ### 2. Claude Command Not Found **Error:** ``` /home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found ``` **Root cause:** The `claude` command is installed at `/home/claude/.local/bin/claude` but this path is not in the shell's PATH environment variable when the script executes via webhook. **Location:** Line 86 in `scripts/handle-issue.sh` ## Logs ``` Repository not found at /home/claude/fszontagh/agent-manager, cloning... Repository cloned successfully Working directory: /home/claude/fszontagh/agent-manager Calling Claude Code with the issue information... --- /home/claude/agent-manager/scripts/handle-issue.sh: line 86: claude: command not found --- ``` ## Solution 1. Change line 30 from `REPO_PATH="$HOME/$OWNER/$REPO"` to `REPO_PATH="$HOME/$REPO"` 2. Change line 86 from `claude -p "$PROMPT"` to use full path: `/home/claude/.local/bin/claude -p "$PROMPT"` or add PATH at the beginning of the script
Claude Coding Agent commented 9 months ago
Collaborator

Implementing Fix

Working on both issues now:

  1. Fixing repository path to use $HOME/$REPO instead of $HOME/$OWNER/$REPO
  2. Adding PATH environment variable or using full path to claude binary
## Implementing Fix Working on both issues now: 1. Fixing repository path to use `$HOME/$REPO` instead of `$HOME/$OWNER/$REPO` 2. Adding PATH environment variable or using full path to claude binary
Claude Coding Agent commented 9 months ago
Collaborator

✅ Fixed and Deployed

Both issues have been successfully resolved and pushed:

  • Commit: 13d7b41 - fix: correct repo path and add claude to PATH (#5)

Changes Made

1. Repository Path Fix (Line 33)

Before:

REPO_PATH="$HOME/$OWNER/$REPO"
# Result: /home/claude/fszontagh/agent-manager

After:

REPO_PATH="$HOME/$REPO"
# Result: /home/claude/agent-manager

Also updated mkdir -p "$HOME/$OWNER" to mkdir -p "$HOME" (line 38)

2. Claude Command PATH Fix (Line 6-7)

Added:

# Add claude binary to PATH
export PATH="$HOME/.local/bin:$PATH"

This ensures the claude command at /home/claude/.local/bin/claude is accessible when the script executes via webhook.

Testing

The fixes ensure:

  • ✅ Repositories are cloned to the correct location: /home/<username>/<reponame>
  • ✅ Claude Code CLI is found and executable from webhook context
  • ✅ No more "claude: command not found" errors

The webhook handler will now correctly clone repositories to the proper path and successfully execute Claude Code for issue automation.

## ✅ Fixed and Deployed Both issues have been successfully resolved and pushed: - Commit: `13d7b41` - fix: correct repo path and add claude to PATH (#5) ### Changes Made #### 1. Repository Path Fix (Line 33) **Before:** ```bash REPO_PATH="$HOME/$OWNER/$REPO" # Result: /home/claude/fszontagh/agent-manager ``` **After:** ```bash REPO_PATH="$HOME/$REPO" # Result: /home/claude/agent-manager ``` Also updated `mkdir -p "$HOME/$OWNER"` to `mkdir -p "$HOME"` (line 38) #### 2. Claude Command PATH Fix (Line 6-7) **Added:** ```bash # Add claude binary to PATH export PATH="$HOME/.local/bin:$PATH" ``` This ensures the `claude` command at `/home/claude/.local/bin/claude` is accessible when the script executes via webhook. ### Testing The fixes ensure: - ✅ Repositories are cloned to the correct location: `/home/<username>/<reponame>` - ✅ Claude Code CLI is found and executable from webhook context - ✅ No more "claude: command not found" errors The webhook handler will now correctly clone repositories to the proper path and successfully execute Claude Code for issue automation.
Sign in to join this conversation.
No Milestone
No assignee
1 Participants
Loading...
Cancel
Save
There is no content yet.