autopilot-code 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autopilot-code",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "private": false,
5
5
  "description": "Repo-issue–driven autopilot runner",
6
6
  "license": "MIT",
@@ -726,8 +726,6 @@ def run_cycle(
726
726
  msg = (
727
727
  f"Autopilot claimed this issue at {time.strftime('%Y-%m-%d %H:%M:%S %Z')}.\n\n"
728
728
  "Next: implement fix and open PR.\n\n"
729
- "(Durable tracking: this repo will maintain `.autopilot/state.json` as a heartbeat; "
730
- "the runner does not inspect processes.)"
731
729
  )
732
730
  print(f"[{cfg.repo}] next issue: #{issue['number']} {issue['title']}", flush=True)
733
731
  if dry_run:
@@ -80,6 +80,9 @@ BRANCH="autopilot/issue-$ISSUE_NUMBER"
80
80
  echo "[run_opencode_issue.sh] repo=$REPO issue=$ISSUE_NUMBER worktree=$WORKTREE"
81
81
 
82
82
  # 1. Create or reuse git worktree from main
83
+ # First, prune any stale worktrees (e.g., if directory was deleted but still registered)
84
+ git worktree prune 2>/dev/null || true
85
+
83
86
  if [[ -d "$WORKTREE" ]]; then
84
87
  echo "[run_opencode_issue.sh] Reusing existing worktree: $WORKTREE"
85
88
  else
@@ -330,8 +333,8 @@ if [[ "$AUTO_MERGE" == "true" ]] && [[ -n "$PR_URL" ]]; then
330
333
  while [[ $POLL_ATTEMPT -lt $MAX_POLL_ATTEMPTS ]]; do
331
334
  POLL_ATTEMPT=$((POLL_ATTEMPT + 1))
332
335
 
333
- # Get PR check status
334
- CHECK_STATUS=$(gh pr view --repo "$REPO" --head "$BRANCH" --json mergeable,mergeStateStatus,statusCheckRollup --jq '.statusCheckRollup | map(.conclusion) | if any(. == "FAILURE") then "FAILED" elif any(. == "PENDING") or any(. == "QUEUED") then "PENDING" else "PASSED" end' 2>/dev/null || echo "PENDING")
336
+ # Get PR check status (handle null/empty statusCheckRollup as PASSED - no checks configured)
337
+ CHECK_STATUS=$(gh pr view --repo "$REPO" --head "$BRANCH" --json mergeable,mergeStateStatus,statusCheckRollup --jq '.statusCheckRollup | if . == null or length == 0 then "PASSED" elif map(.conclusion) | any(. == "FAILURE") then "FAILED" elif map(.conclusion) | any(. == "PENDING") or any(. == "QUEUED") then "PENDING" else "PASSED" end' 2>/dev/null || echo "PENDING")
335
338
 
336
339
  echo "[run_opencode_issue.sh] Poll attempt $POLL_ATTEMPT/$MAX_POLL_ATTEMPTS: Check status = $CHECK_STATUS"
337
340