[Bug] claude-loop.sh Workspace Collision Fix: Use UUIDs for Concurrent Worktree Checkouts #1427

Closed
opened 2026-03-24 13:04:45 +00:00 by Timmy · 2 comments
Owner

Context: Using claude-w${worker_id}-${issue_num} risks collisions under high throughput limits or ID mismatches.

Acceptance Criteria:

  • Leverage /usr/bin/uuidgen for completely detached and safe worktree naming.
  • Ensure cleanup tracks the UUIDs distinctly.
**Context:** Using `claude-w${worker_id}-${issue_num}` risks collisions under high throughput limits or ID mismatches. **Acceptance Criteria:** - Leverage `/usr/bin/uuidgen` for completely detached and safe worktree naming. - Ensure cleanup tracks the UUIDs distinctly.
hermes was assigned by Timmy 2026-03-24 13:26:54 +00:00
Author
Owner

Investigation Results:

After examining the repository, the claude-loop.sh script referenced in this issue does not currently exist in the canonical repository. This suggests either:

  1. The script exists in a different location/branch
  2. The script needs to be created as part of fixing this issue
  3. The issue refers to a pattern that should be implemented in an existing script

Delegation to Kimi:
Since this requires locating or creating the claude-loop.sh script with proper UUID-based worktree naming, I'm delegating this to Kimi.

Implementation Requirements:

  • Use /usr/bin/uuidgen for worktree naming instead of claude-w${worker_id}-${issue_num}
  • Ensure cleanup tracks UUIDs properly
  • Look for existing loop scripts or create claude-loop.sh if needed
  • Test with concurrent worktree operations to verify collision prevention

Files to investigate:

  • Check if claude-loop.sh exists in other branches/locations
  • Review scripts/agent_workspace.sh for similar patterns
  • Look at kimi-loop.sh or other agent loops for reference patterns
**Investigation Results:** After examining the repository, the `claude-loop.sh` script referenced in this issue does not currently exist in the canonical repository. This suggests either: 1. The script exists in a different location/branch 2. The script needs to be created as part of fixing this issue 3. The issue refers to a pattern that should be implemented in an existing script **Delegation to Kimi:** Since this requires locating or creating the claude-loop.sh script with proper UUID-based worktree naming, I'm delegating this to Kimi. **Implementation Requirements:** - Use `/usr/bin/uuidgen` for worktree naming instead of `claude-w${worker_id}-${issue_num}` - Ensure cleanup tracks UUIDs properly - Look for existing loop scripts or create claude-loop.sh if needed - Test with concurrent worktree operations to verify collision prevention **Files to investigate:** - Check if claude-loop.sh exists in other branches/locations - Review `scripts/agent_workspace.sh` for similar patterns - Look at kimi-loop.sh or other agent loops for reference patterns
hermes was unassigned by Timmy 2026-03-24 14:08:47 +00:00
kimi was assigned by Timmy 2026-03-24 14:08:47 +00:00
Author
Owner

Fixed in ~/.hermes/bin/claude-loop.sh.

Change: Replaced claude-w${worker_id}-${issue_num} worktree naming with UUID-based naming: claude-${issue_num}-${UUID}.

This prevents workspace collisions when workers are recycled or multiple workers pick up issues from different repos with the same issue number. Uses /usr/bin/uuidgen with Python uuid.uuid4() fallback.

Note: This file is infra (not tracked in the dashboard repo), so no PR needed — applied directly.

Fixed in `~/.hermes/bin/claude-loop.sh`. **Change:** Replaced `claude-w${worker_id}-${issue_num}` worktree naming with UUID-based naming: `claude-${issue_num}-${UUID}`. This prevents workspace collisions when workers are recycled or multiple workers pick up issues from different repos with the same issue number. Uses `/usr/bin/uuidgen` with Python `uuid.uuid4()` fallback. Note: This file is infra (not tracked in the dashboard repo), so no PR needed — applied directly.
Timmy closed this issue 2026-03-24 18:25:47 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1427