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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
U
Unit 42
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
I
InfoQ
WordPress大学
WordPress大学
H
Help Net Security
D
Docker
B
Blog
腾讯CDC
A
About on SuperTechFans
Recent Announcements
Recent Announcements
雷峰网
雷峰网
有赞技术团队
有赞技术团队
C
Check Point Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

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): start channels before model prewarm · openc...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -27,6 +27,16 @@ const hoisted = vi.hoisted(() => {

2727

resolved: 0,

2828

failed: 0,

2929

}));

30+

const resolveAgentModelPrimaryValue = vi.fn(() => "");

31+

const normalizeProviderId = vi.fn((provider: string) => provider.toLowerCase());

32+

const resolveOpenClawAgentDir = vi.fn(() => "/tmp/openclaw-state/agents/default/agent");

33+

const isCliProvider = vi.fn(() => false);

34+

const resolveConfiguredModelRef = vi.fn(() => ({

35+

provider: "openai",

36+

model: "gpt-5.4",

37+

}));

38+

const resolveEmbeddedAgentRuntime = vi.fn(() => "pi");

39+

const ensureOpenClawModelsJson = vi.fn(async () => undefined);

3040

return {

3141

startPluginServices,

3242

startGmailWatcherWithLogs,

@@ -46,6 +56,13 @@ const hoisted = vi.hoisted(() => {

4656

refreshLatestUpdateRestartSentinel,

4757

getAcpRuntimeBackend,

4858

reconcilePendingSessionIdentities,

59+

resolveAgentModelPrimaryValue,

60+

normalizeProviderId,

61+

resolveOpenClawAgentDir,

62+

isCliProvider,

63+

resolveConfiguredModelRef,

64+

resolveEmbeddedAgentRuntime,

65+

ensureOpenClawModelsJson,

4966

};

5067

});

5168

@@ -123,6 +140,36 @@ vi.mock("../infra/update-startup.js", () => ({

123140

scheduleGatewayUpdateCheck: hoisted.scheduleGatewayUpdateCheck,

124141

}));

125142143+

vi.mock("../config/model-input.js", () => ({

144+

resolveAgentModelPrimaryValue: hoisted.resolveAgentModelPrimaryValue,

145+

}));

146+147+

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

148+

normalizeProviderId: hoisted.normalizeProviderId,

149+

}));

150+151+

vi.mock("../agents/agent-paths.js", () => ({

152+

resolveOpenClawAgentDir: hoisted.resolveOpenClawAgentDir,

153+

}));

154+155+

vi.mock("../agents/defaults.js", () => ({

156+

DEFAULT_MODEL: "gpt-5.4",

157+

DEFAULT_PROVIDER: "openai",

158+

}));

159+160+

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

161+

isCliProvider: hoisted.isCliProvider,

162+

resolveConfiguredModelRef: hoisted.resolveConfiguredModelRef,

163+

}));

164+165+

vi.mock("../agents/pi-embedded-runner/runtime.js", () => ({

166+

resolveEmbeddedAgentRuntime: hoisted.resolveEmbeddedAgentRuntime,

167+

}));

168+169+

vi.mock("../agents/models-config.js", () => ({

170+

ensureOpenClawModelsJson: hoisted.ensureOpenClawModelsJson,

171+

}));

172+126173

vi.mock("./server-tailscale.js", () => ({

127174

startGatewayTailscaleExposure: hoisted.startGatewayTailscaleExposure,

128175

}));

@@ -155,6 +202,17 @@ describe("startGatewayPostAttachRuntime", () => {

155202

hoisted.getAcpRuntimeBackend.mockReset();

156203

hoisted.getAcpRuntimeBackend.mockReturnValue(null);

157204

hoisted.reconcilePendingSessionIdentities.mockClear();

205+

hoisted.resolveAgentModelPrimaryValue.mockReset();

206+

hoisted.resolveAgentModelPrimaryValue.mockReturnValue("");

207+

hoisted.normalizeProviderId.mockClear();

208+

hoisted.resolveOpenClawAgentDir.mockClear();

209+

hoisted.isCliProvider.mockReset();

210+

hoisted.isCliProvider.mockReturnValue(false);

211+

hoisted.resolveConfiguredModelRef.mockClear();

212+

hoisted.resolveEmbeddedAgentRuntime.mockReset();

213+

hoisted.resolveEmbeddedAgentRuntime.mockReturnValue("pi");

214+

hoisted.ensureOpenClawModelsJson.mockReset();

215+

hoisted.ensureOpenClawModelsJson.mockResolvedValue(undefined);

158216

});

159217160218

it("re-enables startup-gated methods after post-attach sidecars start", async () => {

@@ -247,13 +305,58 @@ describe("startGatewayPostAttachRuntime", () => {

247305248306

expect(prewarm).toHaveBeenCalledTimes(1);

249307

expect(log.warn).toHaveBeenCalledWith(

250-

"startup model warmup timed out after 25ms; continuing channel startup",

308+

"startup model warmup timed out after 25ms; continuing without waiting",

251309

);

252310

} finally {

253311

vi.useRealTimers();

254312

}

255313

});

256314315+

it("starts channels without waiting for primary model prewarm completion", async () => {

316+

hoisted.resolveAgentModelPrimaryValue.mockReturnValue("openai/gpt-5.4");

317+

let resolvePrewarm!: () => void;

318+

hoisted.ensureOpenClawModelsJson.mockImplementation(

319+

async () =>

320+

await new Promise<undefined>((resolve) => {

321+

resolvePrewarm = () => resolve(undefined);

322+

}),

323+

);

324+

const startChannels = vi.fn(async () => undefined);

325+326+

const sidecarsPromise = startGatewaySidecars({

327+

cfg: {

328+

hooks: { internal: { enabled: false } },

329+

agents: { defaults: { model: "openai/gpt-5.4" } },

330+

} as never,

331+

pluginRegistry: createPostAttachParams().pluginRegistry,

332+

defaultWorkspaceDir: "/tmp/openclaw-workspace",

333+

deps: {} as never,

334+

startChannels,

335+

log: { warn: vi.fn() },

336+

logHooks: {

337+

info: vi.fn(),

338+

warn: vi.fn(),

339+

error: vi.fn(),

340+

},

341+

logChannels: {

342+

info: vi.fn(),

343+

error: vi.fn(),

344+

},

345+

});

346+347+

await vi.waitFor(

348+

() => {

349+

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

350+

expect(startChannels).toHaveBeenCalledTimes(1);

351+

},

352+

{ timeout: 250 },

353+

);

354+

await sidecarsPromise;

355+356+

resolvePrewarm();

357+

await Promise.resolve();

358+

});

359+257360

it("keeps startup-gated methods unavailable while sidecars are still resuming", async () => {

258361

let resumeSidecars!: () => void;

259362

const sidecarsReady = new Promise<{ pluginServices: null }>((resolve) => {