refactor(hermes_cli): group D — defensive-layer collapse (lockfile validation, pending loader, gh candidates, env pid parsing)

This commit is contained in:
Teknium
2026-09-02 23:07:30 -07:00
parent b7c5e3a205
commit f1d0eaaa85
3 changed files with 23 additions and 39 deletions
+4 -5
View File
@@ -96,11 +96,10 @@ def resolve_copilot_token() -> tuple[str, str]:
def _gh_cli_candidates() -> list[str]:
"""Candidate ``gh`` binary paths, including common Homebrew installs."""
candidates: list[str] = [c for c in (shutil.which("gh"),) if c]
for candidate in ("/opt/homebrew/bin/gh", "/usr/local/bin/gh",
str(Path.home() / ".local" / "bin" / "gh")):
if (candidate not in candidates and os.path.isfile(candidate)
and os.access(candidate, os.X_OK)):
candidates.append(candidate)
candidates += [
c for c in ("/opt/homebrew/bin/gh", "/usr/local/bin/gh", str(Path.home() / ".local/bin/gh"))
if c not in candidates and os.path.isfile(c) and os.access(c, os.X_OK)
]
return candidates