From e636301eb81282dabf4c1ad2fb0c7579a5692726 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Mon, 23 Nov 2026 00:14:26 +0000 Subject: [PATCH] fix: surface gh stderr on GraphQL failure in pr-triage CLI --- .agents/skills/pr-triage/scripts/triage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.agents/skills/pr-triage/scripts/triage.py b/.agents/skills/pr-triage/scripts/triage.py index cbb3f4be6..6912ebd69 100755 --- a/.agents/skills/pr-triage/scripts/triage.py +++ b/.agents/skills/pr-triage/scripts/triage.py @@ -497,7 +497,10 @@ def fetch_github_data( "-f", f"query={GRAPHQL_QUERY}", ] - proc = subprocess.run(cmd, check=True, capture_output=True, text=True) + proc = subprocess.run(cmd, check=False, capture_output=True, text=True) + if proc.returncode != 0: + detail = proc.stderr.strip() or proc.stdout.strip() or f"exit code {proc.returncode}" + raise RuntimeError(f"gh api graphql failed: {detail}") payload: dict[str, Any] = json.loads(proc.stdout) if payload.get("errors"): raise RuntimeError(f"GraphQL errors: {payload['errors']}")