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

推荐订阅源

WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
月光博客
月光博客
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
IT之家
IT之家
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare 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(acpx): await startup probe before gateway ready · ope...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -174,7 +174,8 @@ describe("createAcpxRuntimeService", () => {

174174

expect(getAcpRuntimeBackend("acpx")).toBeUndefined();

175175

});

176176177-

it("creates the embedded runtime state directory without probing at startup by default", async () => {

177+

it("skips the startup probe and defers acpx backend health reporting when explicitly opted out", async () => {

178+

process.env.OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE = "0";

178179

const workspaceDir = await makeTempDir();

179180

const stateDir = path.join(workspaceDir, "custom-state");

180181

const ctx = createServiceContext(workspaceDir);

@@ -200,6 +201,47 @@ describe("createAcpxRuntimeService", () => {

200201

await service.stop?.(ctx);

201202

});

202203204+

it("waits for the embedded runtime startup probe before resolving", async () => {

205+

const workspaceDir = await makeTempDir();

206+

const ctx = createServiceContext(workspaceDir);

207+

let releaseProbe!: () => void;

208+

const probeStarted = vi.fn();

209+

const probeAvailability = vi.fn(

210+

() =>

211+

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

212+

probeStarted();

213+

releaseProbe = resolve;

214+

}),

215+

);

216+

const runtime = createMockRuntime({

217+

probeAvailability,

218+

isHealthy: () => true,

219+

});

220+

const service = createAcpxRuntimeService({

221+

runtimeFactory: () => runtime as never,

222+

});

223+224+

const startPromise = service.start(ctx) as Promise<void>;

225+

await vi.waitFor(() => {

226+

expect(probeStarted).toHaveBeenCalledOnce();

227+

});

228+229+

let resolved = false;

230+

void startPromise.then(() => {

231+

resolved = true;

232+

});

233+

await Promise.resolve();

234+235+

expect(resolved).toBe(false);

236+

releaseProbe();

237+

await startPromise;

238+239+

expect(resolved).toBe(true);

240+

expect(ctx.logger.info).toHaveBeenCalledWith("embedded acpx runtime backend ready");

241+242+

await service.stop?.(ctx);

243+

});

244+203245

it("reaps stale ACPX process leases from the generated wrapper root at startup", async () => {

204246

const workspaceDir = await makeTempDir();

205247

const ctx = createServiceContext(workspaceDir);

@@ -317,7 +359,8 @@ describe("createAcpxRuntimeService", () => {

317359

await service.stop?.(ctx);

318360

});

319361320-

it("registers the default backend without importing ACPX runtime until first use", async () => {

362+

it("registers the default backend lazily without importing ACPX runtime when startup probing is opted out", async () => {

363+

process.env.OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE = "0";

321364

const workspaceDir = await makeTempDir();

322365

const ctx = createServiceContext(workspaceDir);

323366

const service = createAcpxRuntimeService();

@@ -344,8 +387,7 @@ describe("createAcpxRuntimeService", () => {

344387

await service.stop?.(ctx);

345388

});

346389347-

it("can run the embedded runtime probe at startup when explicitly enabled", async () => {

348-

process.env.OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE = "1";

390+

it("runs the embedded runtime probe at startup by default and reports health", async () => {

349391

const workspaceDir = await makeTempDir();

350392

const ctx = createServiceContext(workspaceDir);

351393

const probeAvailability = vi.fn(async () => {});

@@ -365,6 +407,30 @@ describe("createAcpxRuntimeService", () => {

365407

await service.stop?.(ctx);

366408

});

367409410+

it("bounds the embedded runtime startup probe wait with the configured timeout", async () => {

411+

const workspaceDir = await makeTempDir();

412+

const ctx = createServiceContext(workspaceDir);

413+

const probeAvailability = vi.fn(() => new Promise<void>(() => {}));

414+

const runtime = createMockRuntime({

415+

probeAvailability,

416+

isHealthy: () => false,

417+

});

418+

const service = createAcpxRuntimeService({

419+

pluginConfig: { timeoutSeconds: 0.001 },

420+

runtimeFactory: () => runtime as never,

421+

});

422+423+

await service.start(ctx);

424+425+

expect(probeAvailability).toHaveBeenCalledOnce();

426+

expect(getAcpRuntimeBackend("acpx")?.healthy?.()).toBe(false);

427+

expect(ctx.logger.warn).toHaveBeenCalledWith(

428+

"embedded acpx runtime setup failed: embedded acpx runtime backend startup probe timed out after 0.001s",

429+

);

430+431+

await service.stop?.(ctx);

432+

});

433+368434

it("passes the default runtime timeout to the embedded runtime factory", async () => {

369435

const workspaceDir = await makeTempDir();

370436

const ctx = createServiceContext(workspaceDir);

@@ -497,7 +563,6 @@ describe("createAcpxRuntimeService", () => {

497563

});

498564499565

it("can skip the embedded runtime probe via env", async () => {

500-

process.env.OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE = "1";

501566

process.env.OPENCLAW_SKIP_ACPX_RUNTIME_PROBE = "1";

502567

const workspaceDir = await makeTempDir();

503568

const ctx = createServiceContext(workspaceDir);

@@ -517,12 +582,12 @@ describe("createAcpxRuntimeService", () => {

517582

expect(getAcpRuntimeBackend("acpx")).toMatchObject({

518583

runtime: expect.any(Object),

519584

});

585+

expect(getAcpRuntimeBackend("acpx")?.healthy).toBeUndefined();

520586521587

await service.stop?.(ctx);

522588

});

523589524590

it("formats non-string doctor details without losing object payloads", async () => {

525-

process.env.OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE = "1";

526591

const workspaceDir = await makeTempDir();

527592

const ctx = createServiceContext(workspaceDir);

528593

const runtime = createMockRuntime({

@@ -539,11 +604,9 @@ describe("createAcpxRuntimeService", () => {

539604540605

await service.start(ctx);

541606542-

await vi.waitFor(() => {

543-

expect(ctx.logger.warn).toHaveBeenCalledWith(

544-

'embedded acpx runtime backend probe failed: probe failed ({"code":"ACP_CLOSED","agent":"codex"}; stdin closed)',

545-

);

546-

});

607+

expect(ctx.logger.warn).toHaveBeenCalledWith(

608+

'embedded acpx runtime backend probe failed: probe failed ({"code":"ACP_CLOSED","agent":"codex"}; stdin closed)',

609+

);

547610548611

await service.stop?.(ctx);

549612

});