autopilot-code 0.2.1 → 0.2.2

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.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "Repo-issue–driven autopilot runner",
6
6
  "license": "MIT",
@@ -28,6 +28,8 @@ import shutil
28
28
 
29
29
  STATE_DIR = ".autopilot"
30
30
  STATE_FILE = "state.json"
31
+ GLOBAL_CONFIG_DIR = Path.home() / ".config" / "autopilot"
32
+ GLOBAL_STATE_FILE = GLOBAL_CONFIG_DIR / "state.json"
31
33
  DEFAULT_HEARTBEAT_MAX_AGE_SECS = 60 * 60 # 1h
32
34
  DEFAULT_MAX_DEPTH = 3
33
35
  IGNORED_DIRS = {
@@ -621,9 +623,13 @@ def try_merge_pr(cfg: RepoConfig, issue_number: int, pr: dict[str, Any]) -> bool
621
623
  has_failure = any(c.get("conclusion") == "FAILURE" for c in checks)
622
624
  has_pending = any(c.get("conclusion") in ("PENDING", "QUEUED", None) for c in checks)
623
625
 
624
- if has_failure:
626
+ # If all checks are pending/queued and there are more than 0, it's pending
627
+ # But we should also check the rollup state if available
628
+ rollup_state = pr_details.get("statusCheckRollup", {}).get("state") if isinstance(pr_details.get("statusCheckRollup"), dict) else None
629
+
630
+ if has_failure or rollup_state == "FAILURE":
625
631
  check_status = "FAILED"
626
- elif has_pending:
632
+ elif has_pending or rollup_state == "PENDING":
627
633
  check_status = "PENDING"
628
634
  else:
629
635
  check_status = "PASSED"