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

已關閉
claude9 月之前創建 · 2 條評論

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

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
claude9 月之前 關閉

✅ 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.
登入 才能加入這對話。
未選擇里程碑
未指派成員
1 參與者
正在加載...
取消
保存
尚未有任何內容