惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
V
Visual Studio Blog
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
L
LangChain Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
P
Proofpoint News Feed
博客园_首页
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(release): retry ClawHub release planning · openclaw/o...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -89,6 +89,7 @@ type ClawHubPublishablePluginPackageFilters = {

8989

const CLAWHUB_DEFAULT_REGISTRY = "https://clawhub.ai";

9090

const CLAWHUB_REQUEST_TIMEOUT_MS = 30_000;

9191

const CLAWHUB_RESPONSE_BODY_MAX_BYTES = 64 * 1024;

92+

const CLAWHUB_RATE_LIMIT_RETRY_DELAYS_MS = [1_000, 3_000, 10_000] as const;

9293

const OPENCLAW_PLUGIN_CLAWHUB_REPOSITORY = "openclaw/openclaw";

9394

const OPENCLAW_PLUGIN_CLAWHUB_WORKFLOW_FILENAME = "plugin-clawhub-release.yml";

9495

const SAFE_EXTENSION_ID_RE = /^[a-z0-9][a-z0-9._-]*$/;

@@ -482,43 +483,70 @@ async function hasClawHubTrustedPublisher(

482483

`/api/v1/packages/${encodeURIComponent(packageName)}/trusted-publisher`,

483484

getRegistryBaseUrl(options.registryBaseUrl),

484485

);

485-

const request = await fetchClawHubRequest(url, {

486-

fetchImpl: options.fetchImpl,

487-

requestTimeoutMs: options.requestTimeoutMs,

488-

});

489-

const { response } = request;

490-491-

try {

492-

if (!response.ok) {

493-

throw new Error(

494-

`Failed to query ClawHub trusted publisher for ${packageName}: ${response.status} ${response.statusText}`,

495-

);

496-

}

486+

for (let attempt = 0; ; attempt += 1) {

487+

const request = await fetchClawHubRequest(url, {

488+

fetchImpl: options.fetchImpl,

489+

requestTimeoutMs: options.requestTimeoutMs,

490+

});

491+

const { response } = request;

497492498-

let trustedPublisherDetail: ClawHubTrustedPublisherDetail;

499-

const text = await readBoundedResponseText(

500-

response,

501-

`ClawHub trusted publisher ${packageName}`,

502-

CLAWHUB_RESPONSE_BODY_MAX_BYTES,

503-

{

504-

signal: request.signal,

505-

timeoutPromise: request.timeoutPromise,

506-

},

507-

);

508493

try {

509-

trustedPublisherDetail = JSON.parse(text) as ClawHubTrustedPublisherDetail;

510-

} catch (error) {

511-

throw new Error(`Failed to parse ClawHub trusted publisher ${packageName} response.`, {

512-

cause: error,

513-

});

494+

if (response.status !== 429 || attempt >= CLAWHUB_RATE_LIMIT_RETRY_DELAYS_MS.length) {

495+

if (!response.ok) {

496+

throw new Error(

497+

`Failed to query ClawHub trusted publisher for ${packageName}: ${response.status} ${response.statusText}`,

498+

);

499+

}

500+501+

let trustedPublisherDetail: ClawHubTrustedPublisherDetail;

502+

const text = await readBoundedResponseText(

503+

response,

504+

`ClawHub trusted publisher ${packageName}`,

505+

CLAWHUB_RESPONSE_BODY_MAX_BYTES,

506+

{

507+

signal: request.signal,

508+

timeoutPromise: request.timeoutPromise,

509+

},

510+

);

511+

try {

512+

trustedPublisherDetail = JSON.parse(text) as ClawHubTrustedPublisherDetail;

513+

} catch (error) {

514+

throw new Error(`Failed to parse ClawHub trusted publisher ${packageName} response.`, {

515+

cause: error,

516+

});

517+

}

518+519+

return isOpenClawPluginTrustedPublisher(trustedPublisherDetail.trustedPublisher);

520+

}

521+

} finally {

522+

request.clearTimeout();

514523

}

515524516-

return isOpenClawPluginTrustedPublisher(trustedPublisherDetail.trustedPublisher);

517-

} finally {

518-

request.clearTimeout();

525+

await delay(clawHubRetryDelayMs(response, attempt));

519526

}

520527

}

521528529+

function clawHubRetryDelayMs(response: Response, attempt: number): number {

530+

const retryAfter = response.headers.get("retry-after");

531+

if (retryAfter !== null) {

532+

const retryAfterSeconds = Number(retryAfter);

533+

if (Number.isFinite(retryAfterSeconds) && retryAfterSeconds >= 0) {

534+

return Math.round(retryAfterSeconds * 1_000);

535+

}

536+

const retryAfterAt = Date.parse(retryAfter);

537+

if (Number.isFinite(retryAfterAt)) {

538+

return Math.max(0, retryAfterAt - Date.now());

539+

}

540+

}

541+

return CLAWHUB_RATE_LIMIT_RETRY_DELAYS_MS[attempt] ?? 0;

542+

}

543+544+

async function delay(ms: number): Promise<void> {

545+

await new Promise<void>((resolve) => {

546+

setTimeout(resolve, ms);

547+

});

548+

}

549+522550

function isOpenClawPluginTrustedPublisher(value: unknown): boolean {

523551

if (!value || typeof value !== "object" || Array.isArray(value)) {

524552

return false;

@@ -581,42 +609,41 @@ export async function collectPluginClawHubReleasePlan(params?: {

581609

assertPluginReleaseVersionFloors(selectedPublishable, "Plugin ClawHub release plan");

582610

}

583611584-

const planned = await Promise.all(

585-

selectedPublishable.map(async (plugin): Promise<PluginReleasePlanItemWithPackageState> => {

586-

const packageExists = await doesClawHubPackageExist(plugin.packageName, {

587-

registryBaseUrl: params?.registryBaseUrl,

588-

fetchImpl: params?.fetchImpl,

589-

requestTimeoutMs: params?.requestTimeoutMs,

590-

});

591-

const hasTrustedPublisher = packageExists

592-

? await hasClawHubTrustedPublisher(plugin.packageName, {

593-

registryBaseUrl: params?.registryBaseUrl,

594-

fetchImpl: params?.fetchImpl,

595-

requestTimeoutMs: params?.requestTimeoutMs,

596-

})

597-

: false;

598-

const alreadyPublished = packageExists

599-

? await isPluginVersionPublishedOnClawHub(plugin.packageName, plugin.version, {

600-

registryBaseUrl: params?.registryBaseUrl,

601-

fetchImpl: params?.fetchImpl,

602-

requestTimeoutMs: params?.requestTimeoutMs,

603-

})

604-

: false;

605-606-

return {

607-

extensionId: plugin.extensionId,

608-

packageDir: plugin.packageDir,

609-

packageName: plugin.packageName,

610-

version: plugin.version,

611-

channel: plugin.channel,

612-

publishTag: plugin.publishTag,

613-

packageExists,

614-

hasTrustedPublisher,

615-

alreadyPublished,

616-

artifactName: formatClawHubPackageArtifactName(plugin),

617-

};

618-

}),

619-

);

612+

const planned: PluginReleasePlanItemWithPackageState[] = [];

613+

for (const plugin of selectedPublishable) {

614+

const packageExists = await doesClawHubPackageExist(plugin.packageName, {

615+

registryBaseUrl: params?.registryBaseUrl,

616+

fetchImpl: params?.fetchImpl,

617+

requestTimeoutMs: params?.requestTimeoutMs,

618+

});

619+

const hasTrustedPublisher = packageExists

620+

? await hasClawHubTrustedPublisher(plugin.packageName, {

621+

registryBaseUrl: params?.registryBaseUrl,

622+

fetchImpl: params?.fetchImpl,

623+

requestTimeoutMs: params?.requestTimeoutMs,

624+

})

625+

: false;

626+

const alreadyPublished = packageExists

627+

? await isPluginVersionPublishedOnClawHub(plugin.packageName, plugin.version, {

628+

registryBaseUrl: params?.registryBaseUrl,

629+

fetchImpl: params?.fetchImpl,

630+

requestTimeoutMs: params?.requestTimeoutMs,

631+

})

632+

: false;

633+634+

planned.push({

635+

extensionId: plugin.extensionId,

636+

packageDir: plugin.packageDir,

637+

packageName: plugin.packageName,

638+

version: plugin.version,

639+

channel: plugin.channel,

640+

publishTag: plugin.publishTag,

641+

packageExists,

642+

hasTrustedPublisher,

643+

alreadyPublished,

644+

artifactName: formatClawHubPackageArtifactName(plugin),

645+

});

646+

}

620647

const all = planned.map(stripPackageReleaseState);

621648622649

return {