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

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

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: prewarm gateway runtime plugins · openclaw/openclaw...
steipete · 2026-05-31 · via Recent Commits to openclaw:main

@@ -47,6 +47,7 @@ const hoisted = vi.hoisted(() => {

4747

inCatalog: true,

4848

}));

4949

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

50+

const ensureRuntimePluginsLoaded = vi.fn();

5051

const clearCurrentProviderAuthState = vi.fn();

5152

const warmCurrentProviderAuthStateOffMainThread = vi.fn(

5253

async (_cfg?: unknown, _options?: unknown) => {},

@@ -82,6 +83,7 @@ const hoisted = vi.hoisted(() => {

8283

loadModelCatalog,

8384

getModelRefStatus,

8485

ensureOpenClawModelsJson,

86+

ensureRuntimePluginsLoaded,

8587

clearCurrentProviderAuthState,

8688

warmCurrentProviderAuthStateOffMainThread,

8789

setAuthProfileFailureHook,

@@ -179,6 +181,10 @@ vi.mock("../agents/models-config.js", () => ({

179181

ensureOpenClawModelsJson: hoisted.ensureOpenClawModelsJson,

180182

}));

181183184+

vi.mock("../agents/runtime-plugins.js", () => ({

185+

ensureRuntimePluginsLoaded: hoisted.ensureRuntimePluginsLoaded,

186+

}));

187+182188

vi.mock("../agents/model-provider-auth.js", () => ({

183189

clearCurrentProviderAuthState: hoisted.clearCurrentProviderAuthState,

184190

warmCurrentProviderAuthStateOffMainThread: hoisted.warmCurrentProviderAuthStateOffMainThread,

@@ -294,6 +300,7 @@ describe("startGatewayPostAttachRuntime", () => {

294300

});

295301

hoisted.ensureOpenClawModelsJson.mockReset();

296302

hoisted.ensureOpenClawModelsJson.mockResolvedValue(undefined);

303+

hoisted.ensureRuntimePluginsLoaded.mockReset();

297304

hoisted.clearCurrentProviderAuthState.mockClear();

298305

hoisted.warmCurrentProviderAuthStateOffMainThread.mockReset();

299306

hoisted.warmCurrentProviderAuthStateOffMainThread.mockResolvedValue(undefined);

@@ -926,7 +933,7 @@ describe("startGatewayPostAttachRuntime", () => {

926933

await vi.advanceTimersToNextTimerAsync();

927934

expect(postReadyRequestTurn).toHaveBeenCalledTimes(1);

928935

expect(onPostReadySidecars.mock.calls[0]?.[0]).toHaveLength(0);

929-

expect(onGatewayLifetimeSidecars.mock.calls[0]?.[0]).toHaveLength(1);

936+

expect(onGatewayLifetimeSidecars.mock.calls[0]?.[0]).toHaveLength(2);

930937

await vi.dynamicImportSettled();

931938

await vi.waitFor(() => {

932939

expect(hoisted.setAuthProfileFailureHook).toHaveBeenCalledTimes(1);

@@ -942,6 +949,34 @@ describe("startGatewayPostAttachRuntime", () => {

942949

}

943950

});

944951952+

it("uses current config when agent runtime plugin prewarm runs", async () => {

953+

const startupConfig = { marker: "startup" } as never;

954+

const currentConfig = { marker: "current" } as never;

955+956+

await startGatewayPostAttachRuntime({

957+

...createPostAttachParams({

958+

gatewayPluginConfigAtStart: startupConfig,

959+

}),

960+

providerAuthPrewarm: { enabled: false },

961+

agentRuntimePluginPrewarm: {

962+

enabled: true,

963+

delayMs: 0,

964+

getConfig: () => currentConfig,

965+

},

966+

});

967+968+

await vi.waitFor(() => {

969+

expect(hoisted.ensureRuntimePluginsLoaded).toHaveBeenCalledWith({

970+

config: currentConfig,

971+

workspaceDir: "/tmp/openclaw-workspace",

972+

allowGatewaySubagentBinding: true,

973+

});

974+

});

975+

expect(hoisted.ensureRuntimePluginsLoaded).not.toHaveBeenCalledWith(

976+

expect.objectContaining({ config: startupConfig }),

977+

);

978+

});

979+945980

it("keeps provider auth prewarm alive when Gmail post-ready sidecars stop", async () => {

946981

vi.useFakeTimers();

947982

const onPostReadySidecars = vi.fn();

@@ -985,7 +1020,7 @@ describe("startGatewayPostAttachRuntime", () => {

9851020

| { stop: () => void }[]

9861021

| undefined;

9871022

expect(gmailSidecars).toHaveLength(1);

988-

expect(lifetimeSidecars).toHaveLength(1);

1023+

expect(lifetimeSidecars).toHaveLength(2);

98910249901025

for (const sidecar of gmailSidecars ?? []) {

9911026

sidecar.stop();

@@ -1045,7 +1080,7 @@ describe("startGatewayPostAttachRuntime", () => {

10451080

| Array<{ stop: () => Promise<void> | void }>

10461081

| undefined;

10471082

expect(gmailSidecars).toHaveLength(1);

1048-

expect(lifetimeSidecars).toHaveLength(1);

1083+

expect(lifetimeSidecars).toHaveLength(2);

1049108410501085

await vi.waitFor(() => {

10511086

expect(hoisted.transcriptsAutoStartService.start).toHaveBeenCalledTimes(1);

@@ -1056,7 +1091,9 @@ describe("startGatewayPostAttachRuntime", () => {

10561091

}

10571092

expect(hoisted.transcriptsAutoStartService.stop).not.toHaveBeenCalled();

105810931059-

await lifetimeSidecars?.[0]?.stop();

1094+

for (const sidecar of lifetimeSidecars ?? []) {

1095+

await sidecar.stop();

1096+

}

10601097

expect(hoisted.transcriptsAutoStartService.stop).toHaveBeenCalledTimes(1);

10611098

});

10621099

@@ -1440,7 +1477,7 @@ describe("startGatewayPostAttachRuntime", () => {

14401477

name: "sidecars.ready",

14411478

metrics: [

14421479

["loadedPluginCount", 2],

1443-

["postReadySidecarCount", 0],

1480+

["postReadySidecarCount", 1],

14441481

],

14451482

});

14461483

});