From 10902e9035cdb7fb5d32a35f10fb1b85d1e9dbdd Mon Sep 17 00:00:00 2001 From: Alix-007 Date: Sat, 18 Jul 2026 16:31:47 +0800 Subject: [PATCH] fix(scripts): bound clawtributor GitHub lookups (#109968) --- scripts/update-clawtributors.ts | 40 +++++-- test/scripts/update-clawtributors.test.ts | 131 +++++++++++++++++++--- 2 files changed, 148 insertions(+), 23 deletions(-) diff --git a/scripts/update-clawtributors.ts b/scripts/update-clawtributors.ts index 56707a421535..b29376965148 100644 --- a/scripts/update-clawtributors.ts +++ b/scripts/update-clawtributors.ts @@ -1,9 +1,10 @@ // Update Clawtributors script supports OpenClaw repository automation. -import { execFileSync, execSync } from "node:child_process"; +import { execSync } from "node:child_process"; import { readFileSync, writeFileSync } from "node:fs"; import { resolve } from "node:path"; import pMap, { pMapSkip } from "p-map"; import { expectDefined } from "../packages/normalization-core/src/expect.js"; +import { execPlainGh } from "./lib/plain-gh.mjs"; import type { ApiContributor, Entry, MapConfig, User } from "./update-clawtributors.types.js"; const REPO = "openclaw/openclaw"; @@ -12,6 +13,9 @@ const AVATAR_PROBE_SIZE = 40; const AVATAR_PROBE_MAX_BYTES = 256 * 1024; const AVATAR_PROBE_TIMEOUT_MS = 8000; const AVATAR_SIZE = 48; +// The 5,000-PR history query can take about a minute; preserve healthy pagination +// headroom while bounding a stalled GitHub CLI process. +const GH_COMMAND_TIMEOUT_MS = 120_000; const CLAWTRIBUTORS_START = ""; const CLAWTRIBUTORS_END = ""; const CLAWTRIBUTORS_HIDDEN_START = "