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

推荐订阅源

D
Docker
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
爱范儿
爱范儿
博客园 - 【当耐特】
雷峰网
雷峰网
S
SegmentFault 最新的问题
美团技术团队
Blog — PlanetScale
Blog — PlanetScale
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
J
Java Code Geeks

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): defer skipped-channel sidecars · openclaw/...
steipete · 2026-05-27 · via Recent Commits to openclaw:main

@@ -29,6 +29,7 @@ const ACP_BACKEND_READY_TIMEOUT_MS = 5_000;

2929

const ACP_BACKEND_READY_POLL_MS = 50;

3030

const PROVIDER_AUTH_PREWARM_START_DELAY_MS = 1_000;

3131

const PROVIDER_AUTH_REWARM_DELAY_MS = 1_000;

32+

const DEFERRED_SIDECAR_START_DELAY_MS = 100;

3233

const QMD_STARTUP_IDLE_DELAY_MS = 120_000;

3334

const RESTART_SENTINEL_FILENAME = "restart-sentinel.json";

3435

@@ -887,6 +888,7 @@ export async function startGatewayPostAttachRuntime(

887888

isClosing?: () => boolean;

888889

startupTrace?: GatewayStartupTrace;

889890

deferSidecars?: boolean;

891+

logReadyOnSidecars?: boolean;

890892

providerAuthPrewarm?: {

891893

enabled?: boolean;

892894

delayMs?: number;

@@ -896,21 +898,38 @@ export async function startGatewayPostAttachRuntime(

896898

runtimeDeps: GatewayPostAttachRuntimeDeps = defaultGatewayPostAttachRuntimeDeps,

897899

) {

898900

let pluginRegistry = params.pluginRegistry;

899-

if (!params.minimalTestGateway && params.loadStartupPlugins) {

900-

params.onStartupPluginsLoading?.();

901-

const loaded = await measureStartup(params.startupTrace, "plugins.runtime-post-bind", () =>

902-

params.loadStartupPlugins!(),

903-

);

904-

pluginRegistry = loaded.pluginRegistry;

905-

params.startupTrace?.detail("plugins.runtime-post-bind", [

906-

[

907-

"loadedPluginCount",

908-

pluginRegistry.plugins.filter((plugin) => plugin.status === "loaded").length,

909-

],

910-

["gatewayMethodCount", loaded.gatewayMethods.length],

911-

]);

912-

await params.onStartupPluginsLoaded?.(loaded);

913-

}

901+

let startupPluginsLoaded = false;

902+

let startupPluginsLoadPromise: Promise<{

903+

pluginRegistry: PluginRegistry;

904+

gatewayMethods: string[];

905+

}> | null = null;

906+

const loadStartupPluginsIfNeeded = async () => {

907+

if (params.minimalTestGateway || !params.loadStartupPlugins) {

908+

return { pluginRegistry, gatewayMethods: [] };

909+

}

910+

if (startupPluginsLoaded) {

911+

return { pluginRegistry, gatewayMethods: [] };

912+

}

913+

startupPluginsLoadPromise ??= (async () => {

914+

params.onStartupPluginsLoading?.();

915+

const loaded = await measureStartup(params.startupTrace, "plugins.runtime-post-bind", () =>

916+

params.loadStartupPlugins!(),

917+

);

918+

pluginRegistry = loaded.pluginRegistry;

919+

startupPluginsLoaded = true;

920+

params.startupTrace?.detail("plugins.runtime-post-bind", [

921+

[

922+

"loadedPluginCount",

923+

pluginRegistry.plugins.filter((plugin) => plugin.status === "loaded").length,

924+

],

925+

["gatewayMethodCount", loaded.gatewayMethods.length],

926+

]);

927+

await params.onStartupPluginsLoaded?.(loaded);

928+

return loaded;

929+

})();

930+

return await startupPluginsLoadPromise;

931+

};

932+

await loadStartupPluginsIfNeeded();

914933915934

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

916935

runtimeDeps.logGatewayStartup({

@@ -961,10 +980,20 @@ export async function startGatewayPostAttachRuntime(

961980

reportedPluginServices = pluginServices;

962981

params.onPluginServices?.(pluginServices);

963982

};

983+

const waitForSidecarStartTurn = () =>

984+

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

985+

if (params.deferSidecars === true) {

986+

const timer = setTimeout(resolve, DEFERRED_SIDECAR_START_DELAY_MS);

987+

timer.unref?.();

988+

return;

989+

}

990+

setImmediate(resolve);

991+

});

964992965993

const sidecarsPromise = params.minimalTestGateway

966994

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

967-

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

995+

: waitForSidecarStartTurn().then(async () => {

996+

await loadStartupPluginsIfNeeded();

968997

params.log.info("starting channels and sidecars...");

969998

const loaderStatsBefore = getPluginModuleLoaderStats();

970999

const result = await measureStartup(params.startupTrace, "sidecars.total", () =>

@@ -1034,7 +1063,9 @@ export async function startGatewayPostAttachRuntime(

10341063

["postReadySidecarCount", postReadySidecars.length + gatewayLifetimeSidecars.length],

10351064

]);

10361065

params.startupTrace?.mark("sidecars.ready");

1037-

params.log.info("gateway ready");

1066+

if (params.logReadyOnSidecars !== false) {

1067+

params.log.info("gateway ready");

1068+

}

10381069

return { ...result, postReadySidecars, gatewayLifetimeSidecars, pluginRegistry };

10391070

});

10401071