From bef3cbb4a24cfb7ff835db86b9e9f732ed490d91 Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:32:00 +0700 Subject: [PATCH] =?UTF-8?q?ci:=20address=20review=20feedback=20=E2=80=94?= =?UTF-8?q?=20per-model=20timeout=20+=20simpler=20cost=20math?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Per-model timeout of 60s so one hung model does not block siblings - Simplify cost_cents math (cost_usd * 100 directly, no double-rounding) Defer: fine-grained PAT for CTO_ADMIN_TOKEN (requires manual OAuth device flow). Agent-Session: cowork-reviewer-ab-20260414 --- .github/workflows/cto-review.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cto-review.yml b/.github/workflows/cto-review.yml index 6826b2d..a313fcb 100644 --- a/.github/workflows/cto-review.yml +++ b/.github/workflows/cto-review.yml @@ -252,6 +252,8 @@ jobs: } }] + PER_MODEL_TIMEOUT = 60 # seconds; one hung model should not block siblings + def call_model(slug, display, in_rate, out_rate, is_primary): body = { "model": slug, @@ -275,7 +277,7 @@ jobs: method="POST" ) try: - with urllib.request.urlopen(req, timeout=120) as resp: + with urllib.request.urlopen(req, timeout=PER_MODEL_TIMEOUT) as resp: data = json.loads(resp.read()) except Exception as e: return { @@ -307,7 +309,7 @@ jobs: ptok = usage.get("prompt_tokens", 0) ctok = usage.get("completion_tokens", 0) cost_usd = (ptok * in_rate / 1_000_000) + (ctok * out_rate / 1_000_000) - cost_cents = int(round(cost_usd * 100 * 100)) / 100 # two-decimal cents + cost_cents = cost_usd * 100 return { "slug": slug, "display": display, "is_primary": is_primary, "review": review, "prompt_tokens": ptok, "completion_tokens": ctok,