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

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

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(test): avoid scanning status runtime bundles · opencl...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1,21 +1,14 @@

11

import assert from "node:assert/strict";

2+

import { spawnSync } from "node:child_process";

23

import fs from "node:fs";

34

import path from "node:path";

45

import { pathToFileURL } from "node:url";

56

import { parsePackageRootArg } from "./lib/package-root-args.mjs";

6778

const STATUS_MESSAGE_RUNTIME_RE = /^status-message\.runtime(?:-[A-Za-z0-9_-]+)?\.js$/u;

899-

const { packageRoot } = parsePackageRootArg(

10-

process.argv.slice(2),

11-

"OPENCLAW_STATUS_MESSAGE_RUNTIME_ROOT",

12-

);

13-14-

function findBuiltStatusMessageRuntimePath(distDir) {

15-

const candidates = fs

16-

.readdirSync(distDir, { withFileTypes: true })

17-

.filter((entry) => entry.isFile() && STATUS_MESSAGE_RUNTIME_RE.test(entry.name))

18-

.map((entry) => entry.name)

10+

export function findBuiltStatusMessageRuntimePath(distDir) {

11+

const candidates = listBuiltStatusMessageRuntimeFiles(distDir)

1912

.toSorted((left, right) => {

2013

const leftHasHash = left !== "status-message.runtime.js";

2114

const rightHasHash = right !== "status-message.runtime.js";

@@ -30,18 +23,60 @@ function findBuiltStatusMessageRuntimePath(distDir) {

3023

return path.join(distDir, candidates[0]);

3124

}

322533-

const runtimePath = findBuiltStatusMessageRuntimePath(path.join(packageRoot, "dist"));

34-

const runtimeModule = await import(pathToFileURL(runtimePath).href);

35-36-

assert.equal(

37-

typeof runtimeModule.loadStatusMessageRuntimeModule,

38-

"function",

39-

`built status-message runtime did not export loadStatusMessageRuntimeModule: ${runtimePath}`,

40-

);

41-42-

const statusModule = await runtimeModule.loadStatusMessageRuntimeModule();

43-

assert.equal(

44-

typeof statusModule.buildStatusMessage,

45-

"function",

46-

"status-message runtime did not load buildStatusMessage",

47-

);

26+

function listBuiltStatusMessageRuntimeFiles(distDir) {

27+

const externalFiles = listFindBuiltStatusMessageRuntimeFiles(distDir);

28+

if (externalFiles) {

29+

return externalFiles;

30+

}

31+

return fs

32+

.readdirSync(distDir, { withFileTypes: true })

33+

.filter((entry) => entry.isFile() && STATUS_MESSAGE_RUNTIME_RE.test(entry.name))

34+

.map((entry) => entry.name);

35+

}

36+37+

function listFindBuiltStatusMessageRuntimeFiles(distDir) {

38+

const result = spawnSync(

39+

"find",

40+

[distDir, "-maxdepth", "1", "-type", "f", "-name", "status-message.runtime*.js"],

41+

{

42+

encoding: "utf8",

43+

maxBuffer: 1024 * 1024,

44+

stdio: ["ignore", "pipe", "ignore"],

45+

},

46+

);

47+

if (result.status !== 0) {

48+

return null;

49+

}

50+

return result.stdout

51+

.split("\n")

52+

.map((line) => line.trim())

53+

.filter((line) => line.length > 0)

54+

.map((file) => path.basename(file))

55+

.filter((file) => STATUS_MESSAGE_RUNTIME_RE.test(file));

56+

}

57+58+

async function main() {

59+

const { packageRoot } = parsePackageRootArg(

60+

process.argv.slice(2),

61+

"OPENCLAW_STATUS_MESSAGE_RUNTIME_ROOT",

62+

);

63+

const runtimePath = findBuiltStatusMessageRuntimePath(path.join(packageRoot, "dist"));

64+

const runtimeModule = await import(pathToFileURL(runtimePath).href);

65+66+

assert.equal(

67+

typeof runtimeModule.loadStatusMessageRuntimeModule,

68+

"function",

69+

`built status-message runtime did not export loadStatusMessageRuntimeModule: ${runtimePath}`,

70+

);

71+72+

const statusModule = await runtimeModule.loadStatusMessageRuntimeModule();

73+

assert.equal(

74+

typeof statusModule.buildStatusMessage,

75+

"function",

76+

"status-message runtime did not load buildStatusMessage",

77+

);

78+

}

79+80+

if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {

81+

await main();

82+

}