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

推荐订阅源

美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Y
Y Combinator Blog
博客园_首页
有赞技术团队
有赞技术团队
博客园 - Franky
腾讯CDC
G
Google Developers Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
D
Docker
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
U
Unit 42
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学

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): resolve beta smoke workflow run · openclaw/...
vincentkoc · 2026-05-04 · via Recent Commits to openclaw:main

@@ -2,6 +2,7 @@

22

import { spawnSync } from "node:child_process";

33

import { existsSync, mkdirSync, readdirSync, readFileSync } from "node:fs";

44

import path from "node:path";

5+

import { pathToFileURL } from "node:url";

5667

interface Options {

78

beta: string;

@@ -101,6 +102,8 @@ function shellQuote(value: string): string {

101102

return `'${value.replace(/'/g, "'\\''")}'`;

102103

}

103104105+

const TELEGRAM_BETA_WORKFLOW_FILE = "npm-telegram-beta-e2e.yml";

106+104107

function resolveBetaVersion(beta: string): string {

105108

const value = beta.trim().replace(/^openclaw@/, "");

106109

if (/^\d{4}\.\d+\.\d+-beta\.\d+$/u.test(value)) {

@@ -160,13 +163,92 @@ function ghJson(repo: string, pathSuffix: string): unknown {

160163

return JSON.parse(run("gh", ["api", `repos/${repo}/${pathSuffix}`], { capture: true }));

161164

}

162165163-

function dispatchTelegram(options: Options, packageSpec: string): string {

166+

export function parseWorkflowRunIdFromOutput(output: string): string | undefined {

167+

return /\/actions\/runs\/(\d+)/u.exec(output)?.[1];

168+

}

169+170+

type WorkflowRunListEntry = {

171+

createdAt?: string;

172+

databaseId?: number | string;

173+

};

174+175+

function normalizeRunId(value: unknown): string | undefined {

176+

if (typeof value === "number" && Number.isFinite(value)) {

177+

return String(value);

178+

}

179+

if (typeof value === "string" && value.trim()) {

180+

return value.trim();

181+

}

182+

return undefined;

183+

}

184+185+

export function selectNewestDispatchedRunId(params: {

186+

beforeIds: ReadonlySet<string>;

187+

runs: readonly WorkflowRunListEntry[];

188+

}): string | undefined {

189+

return params.runs

190+

.filter((entry) => {

191+

const id = normalizeRunId(entry.databaseId);

192+

return id !== undefined && !params.beforeIds.has(id);

193+

})

194+

.toSorted((a, b) => (b.createdAt ?? "").localeCompare(a.createdAt ?? ""))

195+

.map((entry) => normalizeRunId(entry.databaseId))

196+

.find((id): id is string => id !== undefined);

197+

}

198+199+

function listWorkflowDispatchRuns(repo: string, workflow: string): WorkflowRunListEntry[] {

200+

return JSON.parse(

201+

run(

202+

"gh",

203+

[

204+

"run",

205+

"list",

206+

"--repo",

207+

repo,

208+

"--workflow",

209+

workflow,

210+

"--event",

211+

"workflow_dispatch",

212+

"--limit",

213+

"50",

214+

"--json",

215+

"databaseId,createdAt",

216+

],

217+

{ capture: true },

218+

),

219+

) as WorkflowRunListEntry[];

220+

}

221+222+

async function findDispatchedWorkflowRunId(params: {

223+

beforeIds: ReadonlySet<string>;

224+

repo: string;

225+

workflow: string;

226+

}): Promise<string> {

227+

for (let attempt = 0; attempt < 60; attempt++) {

228+

const runId = selectNewestDispatchedRunId({

229+

beforeIds: params.beforeIds,

230+

runs: listWorkflowDispatchRuns(params.repo, params.workflow),

231+

});

232+

if (runId) {

233+

return runId;

234+

}

235+

await new Promise((resolve) => setTimeout(resolve, 5_000));

236+

}

237+

throw new Error(`could not find dispatched run for ${params.workflow}`);

238+

}

239+240+

async function dispatchTelegram(options: Options, packageSpec: string): Promise<string> {

241+

const beforeIds = new Set(

242+

listWorkflowDispatchRuns(options.repo, TELEGRAM_BETA_WORKFLOW_FILE)

243+

.map((entry) => normalizeRunId(entry.databaseId))

244+

.filter((id): id is string => id !== undefined),

245+

);

164246

const output = run(

165247

"gh",

166248

[

167249

"workflow",

168250

"run",

169-

"NPM Telegram Beta E2E",

251+

TELEGRAM_BETA_WORKFLOW_FILE,

170252

"--repo",

171253

options.repo,

172254

"--ref",

@@ -180,11 +262,15 @@ function dispatchTelegram(options: Options, packageSpec: string): string {

180262

],

181263

{ capture: true },

182264

);

183-

const runId = /\/actions\/runs\/(\d+)/u.exec(output)?.[1];

184-

if (!runId) {

185-

throw new Error(`could not parse workflow run id from gh output:\n${output}`);

265+

const runId = parseWorkflowRunIdFromOutput(output);

266+

if (runId) {

267+

return runId;

186268

}

187-

return runId;

269+

return await findDispatchedWorkflowRunId({

270+

beforeIds,

271+

repo: options.repo,

272+

workflow: TELEGRAM_BETA_WORKFLOW_FILE,

273+

});

188274

}

189275190276

async function pollRun(repo: string, runId: string): Promise<void> {

@@ -266,7 +352,7 @@ async function main(): Promise<void> {

266352

}

267353268354

if (!options.skipTelegram) {

269-

const runId = dispatchTelegram(options, packageSpec);

355+

const runId = await dispatchTelegram(options, packageSpec);

270356

await pollRun(options.repo, runId);

271357

const artifactDir = downloadTelegramArtifact(options.repo, runId);

272358

const report = findFile(artifactDir, "telegram-qa-report.md");

@@ -277,7 +363,9 @@ async function main(): Promise<void> {

277363

}

278364

}

279365280-

await main().catch((error: unknown) => {

281-

console.error(error instanceof Error ? error.message : String(error));

282-

process.exit(1);

283-

});

366+

if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {

367+

await main().catch((error: unknown) => {

368+

console.error(error instanceof Error ? error.message : String(error));

369+

process.exit(1);

370+

});

371+

}