Phase 1: webhook handler + systemd unit + flock in dev-task
This commit is contained in:
@@ -18,6 +18,15 @@ REPO="${1:-}"
|
||||
ISSUE="${2:-}"
|
||||
[[ -z "$REPO" || -z "$ISSUE" ]] && { echo "usage: $0 <owner>/<repo> <issue-id>" >&2; exit 64; }
|
||||
|
||||
# Serialize: only one dev-task active at a time (Max-plan rate-limit pool).
|
||||
# Wait up to 60s for the lock; if still held, exit 75 so the webhook retries.
|
||||
LOCK_FILE="${LOCK_FILE:-/var/agent/dev-task.lock}"
|
||||
exec 200>"$LOCK_FILE"
|
||||
if ! flock -w 60 200; then
|
||||
echo "[dev-task] another dev-task is running; backing off" >&2
|
||||
exit 75
|
||||
fi
|
||||
|
||||
MAX_WALLCLOCK="${MAX_WALLCLOCK:-30m}"
|
||||
MODEL_DEFAULT="${MODEL:-sonnet}"
|
||||
BASE_BRANCH="${BASE_BRANCH:-main}"
|
||||
|
||||
Reference in New Issue
Block a user