From 9b8988475bf4a5a06d327a0e9d9810876bbb1ca7 Mon Sep 17 00:00:00 2001 From: Saifodius Date: Mon, 17 Aug 2026 19:22:13 -0400 Subject: [PATCH] chore: recompute_stuck_consensus.py reuses community._gh_delete instead of a duplicate Same sibling-duplicate-GitHub-call class already fixed for gemini_community.py (#593) and the Discussions GraphQL path (#592): this script's own _gh_delete_label() bypassed community.py's shared _gh_delete(), missing its 404-as-success handling and any future retry-on-transient-failure fix (#588) once merged. --- scripts/recompute_stuck_consensus.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/recompute_stuck_consensus.py b/scripts/recompute_stuck_consensus.py index b5aef10..856f9f6 100644 --- a/scripts/recompute_stuck_consensus.py +++ b/scripts/recompute_stuck_consensus.py @@ -22,22 +22,10 @@ import re -import requests - -from community import _gh_get, _gh_post, _gh_headers, _GH_API, GITHUB_REPO +from community import _gh_get, _gh_post, _gh_delete, GITHUB_REPO from github_sync import get_open_proposal_issues, _ensure_label from debate import compute_consensus, _IMPACT_RE - -def _gh_delete_label(issue_number: int, label: str) -> None: - try: - requests.delete( - f"{_GH_API}/repos/{GITHUB_REPO}/issues/{issue_number}/labels/{label}", - headers=_gh_headers(), timeout=15, - ) - except Exception as e: - print(f" [GH] DELETE label error: {e}") - _STANCE_RE = re.compile( r"\*\*Stance \((claude|gemini)\):\*\*\s*(agree|disagree|escalate)\s*\(confidence\s*([\d.]+)\)" ) @@ -85,7 +73,7 @@ def main(): f"repos/{GITHUB_REPO}/issues/{issue['number']}/labels", {"labels": [new_label]}, ) - _gh_delete_label(issue["number"], old_consensus_label) + _gh_delete(f"repos/{GITHUB_REPO}/issues/{issue['number']}/labels/{old_consensus_label}") note = ( f"**Consensus recomputed:** {old_value} → {new_consensus} " f"(agent_track_record backfill corrected {proposed_by}'s accuracy from the "