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

推荐订阅源

Recent Announcements
Recent Announcements
J
Java Code Geeks
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
腾讯CDC
博客园 - 司徒正美
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
I
InfoQ
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
美团技术团队
The Cloudflare Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
H
Help Net Security
Martin Fowler
Martin Fowler
V
Visual Studio 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
perf(gateway): overlap startup work before ready · opencl...
samzong · 2026-05-18 · via Recent Commits to openclaw:main

@@ -413,6 +413,7 @@ export async function startGatewaySidecars(params: {

413413

deps: CliDeps;

414414

startChannels: () => Promise<void>;

415415

prewarmPrimaryModel?: typeof prewarmConfiguredPrimaryModel;

416+

onPluginServices?: (pluginServices: PluginServicesHandle | null) => void;

416417

log: { warn: (msg: string) => void };

417418

logHooks: {

418419

info: (msg: string) => void;

@@ -445,6 +446,31 @@ export async function startGatewaySidecars(params: {

445446

}

446447

});

447448449+

const pluginServicesPromise = measureStartup(

450+

params.startupTrace,

451+

"sidecars.plugin-services",

452+

async () => {

453+

try {

454+

const { startPluginServices } = await import("../plugins/services.js");

455+

return await startPluginServices({

456+

registry: params.pluginRegistry,

457+

config: params.cfg,

458+

workspaceDir: params.defaultWorkspaceDir,

459+

startupTrace: params.startupTrace,

460+

});

461+

} catch (err) {

462+

params.log.warn(`plugin services failed to start: ${String(err)}`);

463+

return null;

464+

}

465+

},

466+

);

467+

const pluginServicesReportPromise = params.onPluginServices

468+

? pluginServicesPromise.then((pluginServices) => {

469+

params.onPluginServices?.(pluginServices);

470+

return pluginServices;

471+

})

472+

: pluginServicesPromise;

473+448474

const skipChannels =

449475

isTruthyEnvValue(process.env.OPENCLAW_SKIP_CHANNELS) ||

450476

isTruthyEnvValue(process.env.OPENCLAW_SKIP_PROVIDERS);

@@ -492,20 +518,7 @@ export async function startGatewaySidecars(params: {

492518

}, 250);

493519

}

494520495-

let pluginServices: PluginServicesHandle | null = null;

496-

await measureStartup(params.startupTrace, "sidecars.plugin-services", async () => {

497-

try {

498-

const { startPluginServices } = await import("../plugins/services.js");

499-

pluginServices = await startPluginServices({

500-

registry: params.pluginRegistry,

501-

config: params.cfg,

502-

workspaceDir: params.defaultWorkspaceDir,

503-

startupTrace: params.startupTrace,

504-

});

505-

} catch (err) {

506-

params.log.warn(`plugin services failed to start: ${String(err)}`);

507-

}

508-

});

521+

const pluginServices = await pluginServicesReportPromise;

509522510523

if (params.cfg.acp?.enabled) {

511524

void (async () => {

@@ -804,7 +817,7 @@ export async function startGatewayPostAttachRuntime(

804817

await params.onStartupPluginsLoaded?.(loaded);

805818

}

806819807-

await measureStartup(params.startupTrace, "post-attach.log", () =>

820+

const startupLogPromise = measureStartup(params.startupTrace, "post-attach.log", () =>

808821

runtimeDeps.logGatewayStartup({

809822

cfg: params.cfgAtStart,

810823

bindHost: params.bindHost,

@@ -849,6 +862,12 @@ export async function startGatewayPostAttachRuntime(

849862

}),

850863

);

851864865+

let pluginServicesReported = false;

866+

const reportPluginServices = (pluginServices: PluginServicesHandle | null) => {

867+

pluginServicesReported = true;

868+

params.onPluginServices?.(pluginServices);

869+

};

870+852871

const sidecarsPromise = params.minimalTestGateway

853872

? Promise.resolve({ pluginServices: null, pluginRegistry, postReadySidecars: [] })

854873

: new Promise<void>((resolve) => setImmediate(resolve)).then(async () => {

@@ -865,6 +884,7 @@ export async function startGatewayPostAttachRuntime(

865884

logHooks: params.logHooks,

866885

logChannels: params.logChannels,

867886

startupTrace: params.startupTrace,

887+

onPluginServices: reportPluginServices,

868888

}),

869889

);

870890

const loaderStatsAfter = getPluginModuleLoaderStats();

@@ -884,7 +904,9 @@ export async function startGatewayPostAttachRuntime(

884904

for (const method of STARTUP_UNAVAILABLE_GATEWAY_METHODS) {

885905

params.unavailableGatewayMethods.delete(method);

886906

}

887-

params.onPluginServices?.(result.pluginServices);

907+

if (!pluginServicesReported) {

908+

reportPluginServices(result.pluginServices);

909+

}

888910

params.onPostReadySidecars?.(result.postReadySidecars);

889911

params.onSidecarsReady?.();

890912

params.startupTrace?.detail("sidecars.ready", [

@@ -937,7 +959,8 @@ export async function startGatewayPostAttachRuntime(

937959

});

938960939961

if (params.deferSidecars !== true) {

940-

const [stopGatewayUpdateCheck, tailscaleCleanup, sidecarsResult] = await Promise.all([

962+

const [, stopGatewayUpdateCheck, tailscaleCleanup, sidecarsResult] = await Promise.all([

963+

startupLogPromise,

941964

stopGatewayUpdateCheckPromise,

942965

tailscaleCleanupPromise,

943966

sidecarsPromise,

@@ -949,7 +972,8 @@ export async function startGatewayPostAttachRuntime(

949972

};

950973

}

951974952-

const [stopGatewayUpdateCheck, tailscaleCleanup] = await Promise.all([

975+

const [, stopGatewayUpdateCheck, tailscaleCleanup] = await Promise.all([

976+

startupLogPromise,

953977

stopGatewayUpdateCheckPromise,

954978

tailscaleCleanupPromise,

955979

]);