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

推荐订阅源

D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
B
Blog RSS Feed
H
Help Net Security
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
L
LangChain Blog
Vercel News
Vercel News

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): stream cross-os served artifacts · openclaw...
vincentkoc · 2026-05-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -6,6 +6,7 @@ import { spawn } from "node:child_process";

66

import {

77

appendFileSync,

88

chmodSync,

9+

createReadStream,

910

createWriteStream,

1011

existsSync,

1112

mkdirSync,

@@ -3680,11 +3681,11 @@ async function runCommandInvocation(invocation, options) {

36803681

});

36813682

}

36823683
3683-

async function startStaticFileServer(params) {

3684+

export async function startStaticFileServer(params) {

36843685

mkdirSync(dirname(params.logPath), { recursive: true });

36853686

const logStream = createWriteStream(params.logPath, { flags: "a" });

36863687

const fileName = String(params.filePath.split(/[/\\]/u).at(-1) ?? "artifact");

3687-

const fileBytes = readFileSync(params.filePath);

3688+

const fileStat = statSync(params.filePath);

36883689

const server = createServer((request, response) => {

36893690

logStream.write(`${new Date().toISOString()} ${request.method} ${request.url}\n`);

36903691

if (request.url !== `/${fileName}`) {

@@ -3694,8 +3695,20 @@ async function startStaticFileServer(params) {

36943695

}

36953696

response.statusCode = 200;

36963697

response.setHeader("content-type", resolveStaticFileContentType(params.filePath));

3697-

response.setHeader("content-length", String(fileBytes.length));

3698-

response.end(fileBytes);

3698+

response.setHeader("content-length", String(fileStat.size));

3699+

response.setHeader("connection", "close");

3700+

const fileStream = createReadStream(params.filePath);

3701+

fileStream.once("error", (error) => {

3702+

logStream.write(`${new Date().toISOString()} static-file-read-error ${formatError(error)}\n`);

3703+

if (response.headersSent) {

3704+

response.destroy(error);

3705+

return;

3706+

}

3707+

response.removeHeader("content-length");

3708+

response.statusCode = 500;

3709+

response.end("failed to read file");

3710+

});

3711+

fileStream.pipe(response);

36993712

});

37003713

await new Promise((resolvePromise, rejectPromise) => {

37013714

server.once("error", rejectPromise);

Original file line numberDiff line numberDiff line change

@@ -65,6 +65,7 @@ import {

6565

resolveRequestedSuites,

6666

resolveRunnerMatrix,

6767

resolveStaticFileContentType,

68+

startStaticFileServer,

6869

shouldExerciseManagedGatewayLifecycleAfterInstall,

6970

shouldRunPackagedUpgradeStatusProbe,

7071

shouldRunWindowsInstalledBrowserOverrideImportSmoke,

@@ -659,6 +660,42 @@ describe("scripts/openclaw-cross-os-release-checks", () => {

659660

expect(resolveStaticFileContentType("openclaw-2026.4.14.tgz")).toBe("application/octet-stream");

660661

});

661662
663+

it("streams release artifacts from the static file server", async () => {

664+

const dir = mkdtempSync(join(tmpdir(), "openclaw-cross-os-static-server-"));

665+

const filePath = join(dir, "openclaw-2026.4.14.tgz");

666+

const logPath = join(dir, "server.log");

667+

let server: Awaited<ReturnType<typeof startStaticFileServer>> | undefined;

668+
669+

try {

670+

const payload = Buffer.from(`artifact-head\n${"x".repeat(1024 * 1024)}\nartifact-tail`);

671+

writeFileSync(filePath, payload);

672+
673+

server = await startStaticFileServer({ filePath, logPath });

674+

const response = await fetch(server.url);

675+

const body = Buffer.from(await response.arrayBuffer());

676+
677+

expect(response.status).toBe(200);

678+

expect(response.headers.get("content-length")).toBe(String(payload.length));

679+

expect(response.headers.get("content-type")).toBe("application/octet-stream");

680+

expect(body.equals(payload)).toBe(true);

681+

expect(readFileSync(logPath, "utf8")).toContain(`GET /${filePath.split(/[/\\]/u).at(-1)}`);

682+

} finally {

683+

await server?.close();

684+

rmSync(dir, { recursive: true, force: true });

685+

}

686+

});

687+
688+

it("does not preload static release artifacts before serving them", () => {

689+

const source = readFileSync("scripts/openclaw-cross-os-release-checks.ts", "utf8");

690+

const serverSource = source.slice(

691+

source.indexOf("export async function startStaticFileServer"),

692+

source.indexOf("export function resolveStaticFileContentType"),

693+

);

694+
695+

expect(serverSource).toContain("createReadStream(params.filePath)");

696+

expect(serverSource).not.toContain("readFileSync(params.filePath)");

697+

});

698+
662699

it("uses the published installer URLs for native installer lanes", () => {

663700

expect(resolvePublishedInstallerUrl("darwin")).toBe("https://openclaw.ai/install.sh");

664701

expect(resolvePublishedInstallerUrl("linux")).toBe("https://openclaw.ai/install.sh");