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

推荐订阅源

S
SegmentFault 最新的问题
Jina AI
Jina AI
罗磊的独立博客
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
InfoQ
月光博客
月光博客
博客园_首页
Vercel News
Vercel News
P
Proofpoint News Feed
GbyAI
GbyAI
Y
Y Combinator 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(gateway): defer update check startup · openclaw/openc...
samzong · 2026-05-18 · via Recent Commits to openclaw:main

@@ -745,6 +745,66 @@ const defaultGatewayPostAttachRuntimeDeps: GatewayPostAttachRuntimeDeps = {

745745

(await import("./server-tailscale.js")).startGatewayTailscaleExposure(...args),

746746

};

747747748+

function createDeferredGatewayUpdateCheck(params: {

749+

startupTrace?: GatewayStartupTrace;

750+

runtimeDeps: GatewayPostAttachRuntimeDeps;

751+

cfg: OpenClawConfig;

752+

log: {

753+

info: (msg: string) => void;

754+

warn: (msg: string) => void;

755+

};

756+

isNixMode: boolean;

757+

broadcast: (event: string, payload: unknown, opts?: { dropIfSlow?: boolean }) => void;

758+

}): { start: () => void; stop: () => void } {

759+

let started = false;

760+

let stopped = false;

761+

let stopUpdateCheck: (() => void) | null = null;

762+763+

const stop = () => {

764+

stopped = true;

765+

stopUpdateCheck?.();

766+

stopUpdateCheck = null;

767+

};

768+769+

const start = () => {

770+

if (started || stopped) {

771+

return;

772+

}

773+

started = true;

774+

setImmediate(() => {

775+

if (stopped) {

776+

return;

777+

}

778+

void measureStartup(params.startupTrace, "post-attach.update-check", () =>

779+

params.runtimeDeps.scheduleGatewayUpdateCheck({

780+

cfg: params.cfg,

781+

log: params.log,

782+

isNixMode: params.isNixMode,

783+

onUpdateAvailableChange: (updateAvailable) => {

784+

const payload: GatewayUpdateAvailableEventPayload = { updateAvailable };

785+

params.broadcast(GATEWAY_EVENT_UPDATE_AVAILABLE, payload, { dropIfSlow: true });

786+

},

787+

}),

788+

)

789+

.then((nextStop) => {

790+

if (stopped) {

791+

nextStop();

792+

return;

793+

}

794+

stopUpdateCheck = nextStop;

795+

})

796+

.catch((err) => {

797+

if (stopped) {

798+

return;

799+

}

800+

params.log.warn(`gateway update check failed to start: ${String(err)}`);

801+

});

802+

});

803+

};

804+805+

return { start, stop };

806+

}

807+748808

export async function startGatewayPostAttachRuntime(

749809

params: {

750810

minimalTestGateway: boolean;

@@ -833,19 +893,16 @@ export async function startGatewayPostAttachRuntime(

833893

}),

834894

);

835895836-

const stopGatewayUpdateCheckPromise = params.minimalTestGateway

837-

? Promise.resolve(() => {})

838-

: measureStartup(params.startupTrace, "post-attach.update-check", () =>

839-

runtimeDeps.scheduleGatewayUpdateCheck({

840-

cfg: params.cfgAtStart,

841-

log: params.log,

842-

isNixMode: params.isNixMode,

843-

onUpdateAvailableChange: (updateAvailable) => {

844-

const payload: GatewayUpdateAvailableEventPayload = { updateAvailable };

845-

params.broadcast(GATEWAY_EVENT_UPDATE_AVAILABLE, payload, { dropIfSlow: true });

846-

},

847-

}),

848-

);

896+

const updateCheck = params.minimalTestGateway

897+

? { start: () => {}, stop: () => {} }

898+

: createDeferredGatewayUpdateCheck({

899+

startupTrace: params.startupTrace,

900+

runtimeDeps,

901+

cfg: params.cfgAtStart,

902+

log: params.log,

903+

isNixMode: params.isNixMode,

904+

broadcast: params.broadcast,

905+

});

849906850907

const tailscaleCleanupPromise = params.minimalTestGateway

851908

? Promise.resolve(null)

@@ -961,26 +1018,27 @@ export async function startGatewayPostAttachRuntime(

9611018

});

96210199631020

if (params.deferSidecars !== true) {

964-

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

1021+

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

9651022

startupLogPromise,

966-

stopGatewayUpdateCheckPromise,

9671023

tailscaleCleanupPromise,

9681024

sidecarsPromise,

9691025

]);

1026+

updateCheck.start();

9701027

return {

971-

stopGatewayUpdateCheck,

1028+

stopGatewayUpdateCheck: updateCheck.stop,

9721029

tailscaleCleanup,

9731030

pluginServices: sidecarsResult.pluginServices,

9741031

};

9751032

}

9761033977-

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

978-

startupLogPromise,

979-

stopGatewayUpdateCheckPromise,

980-

tailscaleCleanupPromise,

981-

]);

1034+

const [, tailscaleCleanup] = await Promise.all([startupLogPromise, tailscaleCleanupPromise]);

1035+

updateCheck.start();

9821036983-

return { stopGatewayUpdateCheck, tailscaleCleanup, pluginServices: reportedPluginServices };

1037+

return {

1038+

stopGatewayUpdateCheck: updateCheck.stop,

1039+

tailscaleCleanup,

1040+

pluginServices: reportedPluginServices,

1041+

};

9841042

}

98510439861044

export const __testing = {