@openclaw/acpx 2026.5.16-beta.6 → 2026.5.16-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { getAcpRuntimeBackend, unregisterAcpRuntimeBackend } from "openclaw/plug
3
3
  const ACPX_BACKEND_ID = "acpx";
4
4
  let serviceModulePromise = null;
5
5
  function loadServiceModule() {
6
- serviceModulePromise ??= import("./service-DsH8by3_.js");
6
+ serviceModulePromise ??= import("./service-CeDUeFlN.js");
7
7
  return serviceModulePromise;
8
8
  }
9
9
  async function startRealService(state) {
@@ -1307,6 +1307,12 @@ function resolveAllowedAgentsProbeAgent(ctx) {
1307
1307
  if (normalized) return normalized;
1308
1308
  }
1309
1309
  }
1310
+ async function measureAcpxStartup(ctx, name, run) {
1311
+ return ctx.startupTrace ? await ctx.startupTrace.measure(name, run) : await run();
1312
+ }
1313
+ function detailAcpxStartup(ctx, name, metrics) {
1314
+ ctx.startupTrace?.detail?.(name, metrics);
1315
+ }
1310
1316
  function shouldRunStartupProbe(env = process.env) {
1311
1317
  return env[ENABLE_STARTUP_PROBE_ENV] !== "0";
1312
1318
  }
@@ -1388,34 +1394,37 @@ function createAcpxRuntimeService(params = {}) {
1388
1394
  ctx.logger.info("skipping embedded acpx runtime backend (OPENCLAW_SKIP_ACPX_RUNTIME=1)");
1389
1395
  return;
1390
1396
  }
1391
- const basePluginConfig = resolveAcpxPluginConfig({
1397
+ const basePluginConfig = await measureAcpxStartup(ctx, "config.resolve", () => resolveAcpxPluginConfig({
1392
1398
  rawConfig: params.pluginConfig,
1393
1399
  workspaceDir: ctx.workspaceDir
1394
- });
1395
- const pluginConfig = await prepareAcpxCodexAuthConfig({
1396
- pluginConfig: {
1397
- ...basePluginConfig,
1398
- probeAgent: basePluginConfig.probeAgent ?? resolveAllowedAgentsProbeAgent(ctx)
1399
- },
1400
+ }));
1401
+ const effectiveBasePluginConfig = {
1402
+ ...basePluginConfig,
1403
+ probeAgent: basePluginConfig.probeAgent ?? resolveAllowedAgentsProbeAgent(ctx)
1404
+ };
1405
+ const pluginConfig = await measureAcpxStartup(ctx, "config.prepare-codex-auth", () => prepareAcpxCodexAuthConfig({
1406
+ pluginConfig: effectiveBasePluginConfig,
1400
1407
  stateDir: ctx.stateDir,
1401
1408
  logger: ctx.logger
1402
- });
1409
+ }));
1403
1410
  const wrapperRoot = path.join(ctx.stateDir, "acpx");
1404
- await fs.mkdir(pluginConfig.stateDir, { recursive: true });
1405
- await fs.mkdir(wrapperRoot, { recursive: true });
1406
- const gatewayInstanceId = await resolveGatewayInstanceId(ctx.stateDir);
1411
+ await measureAcpxStartup(ctx, "filesystem.prepare", async () => {
1412
+ await fs.mkdir(pluginConfig.stateDir, { recursive: true });
1413
+ await fs.mkdir(wrapperRoot, { recursive: true });
1414
+ });
1415
+ const gatewayInstanceId = await measureAcpxStartup(ctx, "gateway-instance-id", () => resolveGatewayInstanceId(ctx.stateDir));
1407
1416
  const processLeaseStore = createAcpxProcessLeaseStore({ stateDir: wrapperRoot });
1408
- const startupReap = await reapOpenAcpxProcessLeases({
1417
+ const startupReap = await measureAcpxStartup(ctx, "process-leases.reap", () => reapOpenAcpxProcessLeases({
1409
1418
  gatewayInstanceId,
1410
1419
  leaseStore: processLeaseStore,
1411
1420
  deps: params.processCleanupDeps
1412
- });
1421
+ }));
1413
1422
  if (startupReap.terminatedPids.length > 0) ctx.logger.info(`reaped ${startupReap.terminatedPids.length} stale OpenClaw-owned ACPX process${startupReap.terminatedPids.length === 1 ? "" : "es"}`);
1414
1423
  warnOnIgnoredLegacyCompatibilityConfig({
1415
1424
  pluginConfig,
1416
1425
  logger: ctx.logger
1417
1426
  });
1418
- runtime = params.runtimeFactory ? await params.runtimeFactory({
1427
+ const startedRuntime = await measureAcpxStartup(ctx, "runtime.create", () => params.runtimeFactory ? params.runtimeFactory({
1419
1428
  pluginConfig,
1420
1429
  gatewayInstanceId,
1421
1430
  processLeaseStore,
@@ -1427,32 +1436,39 @@ function createAcpxRuntimeService(params = {}) {
1427
1436
  processLeaseStore,
1428
1437
  wrapperRoot,
1429
1438
  logger: ctx.logger
1430
- });
1439
+ }));
1440
+ runtime = startedRuntime;
1431
1441
  const shouldProbeRuntime = shouldProbeRuntimeAtStartup();
1432
- registerAcpRuntimeBackend({
1433
- id: ACPX_BACKEND_ID,
1434
- runtime,
1435
- ...shouldProbeRuntime ? { healthy: () => runtime?.isHealthy() ?? false } : {}
1442
+ detailAcpxStartup(ctx, "probe-policy", [["startupProbeEnabledCount", shouldProbeRuntime ? 1 : 0], ["probeAgent", pluginConfig.probeAgent ?? "default"]]);
1443
+ await measureAcpxStartup(ctx, "backend.register", () => {
1444
+ registerAcpRuntimeBackend({
1445
+ id: ACPX_BACKEND_ID,
1446
+ runtime: startedRuntime,
1447
+ ...shouldProbeRuntime ? { healthy: () => runtime?.isHealthy() ?? false } : {}
1448
+ });
1449
+ ctx.logger.info(`embedded acpx runtime backend registered (cwd: ${pluginConfig.cwd})`);
1436
1450
  });
1437
- ctx.logger.info(`embedded acpx runtime backend registered (cwd: ${pluginConfig.cwd})`);
1438
1451
  if (!shouldProbeRuntime) return;
1439
1452
  lifecycleRevision += 1;
1440
1453
  const currentRevision = lifecycleRevision;
1441
1454
  try {
1442
- if (runtime) await withStartupProbeTimeout({
1443
- promise: runtime.probeAvailability(),
1455
+ await measureAcpxStartup(ctx, "probe.availability", () => withStartupProbeTimeout({
1456
+ promise: startedRuntime.probeAvailability(),
1444
1457
  timeoutSeconds: pluginConfig.timeoutSeconds ?? 120
1445
- });
1458
+ }));
1446
1459
  if (currentRevision !== lifecycleRevision) return;
1447
- if (runtime?.isHealthy()) {
1460
+ if (startedRuntime.isHealthy()) {
1461
+ detailAcpxStartup(ctx, "probe.result", [["healthyCount", 1]]);
1448
1462
  ctx.logger.info("embedded acpx runtime backend ready");
1449
1463
  return;
1450
1464
  }
1451
- const doctorReport = await runtime?.doctor?.();
1465
+ const doctorReport = await measureAcpxStartup(ctx, "probe.doctor", () => startedRuntime.doctor?.());
1452
1466
  if (currentRevision !== lifecycleRevision) return;
1467
+ detailAcpxStartup(ctx, "probe.result", [["healthyCount", 0]]);
1453
1468
  ctx.logger.warn(`embedded acpx runtime backend probe failed: ${doctorReport ? formatDoctorFailureMessage(doctorReport) : "backend remained unhealthy after probe"}`);
1454
1469
  } catch (err) {
1455
1470
  if (currentRevision !== lifecycleRevision) return;
1471
+ detailAcpxStartup(ctx, "probe.result", [["healthyCount", 0]]);
1456
1472
  ctx.logger.warn(`embedded acpx runtime setup failed: ${formatErrorMessage(err)}`);
1457
1473
  }
1458
1474
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/acpx",
3
- "version": "2026.5.16-beta.6",
3
+ "version": "2026.5.16-beta.7",
4
4
  "description": "OpenClaw ACP runtime backend",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,10 +26,10 @@
26
26
  "minHostVersion": ">=2026.4.25"
27
27
  },
28
28
  "compat": {
29
- "pluginApi": ">=2026.5.16-beta.6"
29
+ "pluginApi": ">=2026.5.16-beta.7"
30
30
  },
31
31
  "build": {
32
- "openclawVersion": "2026.5.16-beta.6",
32
+ "openclawVersion": "2026.5.16-beta.7",
33
33
  "staticAssets": [
34
34
  {
35
35
  "source": "./src/runtime-internals/mcp-proxy.mjs",
@@ -59,7 +59,7 @@
59
59
  "skills/**"
60
60
  ],
61
61
  "peerDependencies": {
62
- "openclaw": ">=2026.5.16-beta.6"
62
+ "openclaw": ">=2026.5.16-beta.7"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "openclaw": {