Skip to content

fix(cloud): PR #130 bugs — VOLUME shadow, worktree branch conflict, no locking #135

@gHashTag

Description

@gHashTag

Context

PR #130 (feat/issue-125) has 2 critical bugs. Fix them on branch feat/issue-125.

Bugs to fix

1. VOLUME in Dockerfile shadows pre-built bare repo

VOLUME ["/bare-repo.git"] causes Docker to create an empty anonymous volume, hiding the pre-cloned repo. Fix:

# REMOVE this line:
# VOLUME ["/bare-repo.git"]

The bare repo should just be a regular directory in the image layer.

2. git worktree add ... main — fails for concurrent agents

A branch can only be checked out in one worktree. Second agent fails. Fix:

# BEFORE (broken):
git worktree add "${WORKTREE_PATH}" main

# AFTER:
git worktree add -b "agent-${ISSUE}" "${WORKTREE_PATH}" main

Each agent gets its own branch from main.

3. Add locking for concurrent access

# Wrap fetch + worktree add in flock:
(
  flock -x 200
  git fetch origin main --depth=50
  git worktree add -b "agent-${ISSUE}" "${WORKTREE_PATH}" main
) 200>/bare-repo.git/.git-lock

Instructions

  1. git checkout feat/issue-125
  2. Fix deploy/Dockerfile.agent — remove VOLUME line
  3. Fix deploy/agent-entrypoint.sh — worktree branch + flock
  4. Commit: fix(cloud): remove VOLUME, per-agent branch, add flock (#130)
  5. Push to feat/issue-125

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions