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,