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

推荐订阅源

WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
月光博客
月光博客
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog RSS Feed
博客园 - Franky
爱范儿
爱范儿

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: show banner on gateway fast path · openclaw/openclaw...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -23,6 +23,9 @@ const restoreTerminalStateMock = vi.hoisted(() => vi.fn());

2323

const hasEnvHttpProxyAgentConfiguredMock = vi.hoisted(() => vi.fn(() => false));

2424

const ensureGlobalUndiciEnvProxyDispatcherMock = vi.hoisted(() => vi.fn());

2525

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

26+

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

27+

const addGatewayRunCommandMock = vi.hoisted(() => vi.fn((command: unknown) => command));

28+

const emitCliBannerMock = vi.hoisted(() => vi.fn());

2629

const progressDoneMock = vi.hoisted(() => vi.fn());

2730

const createCliProgressMock = vi.hoisted(() =>

2831

vi.fn(() => ({

@@ -35,10 +38,49 @@ const maybeRunCliInContainerMock = vi.hoisted(() =>

3538

>((argv: string[]) => ({ handled: false, argv })),

3639

);

374041+

vi.mock("commander", () => {

42+

class MockCommanderError extends Error {

43+

exitCode: number;

44+

code: string;

45+46+

constructor(exitCode: number, code: string, message: string) {

47+

super(message);

48+

this.exitCode = exitCode;

49+

this.code = code;

50+

}

51+

}

52+53+

class MockCommand {

54+

name = vi.fn(() => this);

55+

enablePositionalOptions = vi.fn(() => this);

56+

exitOverride = vi.fn(() => this);

57+

description = vi.fn(() => this);

58+

command = vi.fn(() => new MockCommand());

59+

parseAsync = commanderParseAsyncMock;

60+

}

61+62+

return {

63+

Command: MockCommand,

64+

CommanderError: MockCommanderError,

65+

};

66+

});

67+3868

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

3969

tryRouteCli: tryRouteCliMock,

4070

}));

417172+

vi.mock("./gateway-cli/run.js", () => ({

73+

addGatewayRunCommand: addGatewayRunCommandMock,

74+

}));

75+76+

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

77+

VERSION: "9.9.9-test",

78+

}));

79+80+

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

81+

emitCliBanner: emitCliBannerMock,

82+

}));

83+4284

vi.mock("./container-target.js", () => ({

4385

maybeRunCliInContainer: maybeRunCliInContainerMock,

4486

parseCliContainerArgs: (argv: string[]) => ({ ok: true, container: null, argv }),

@@ -132,6 +174,7 @@ describe("runCli exit behavior", () => {

132174

hasEnvHttpProxyAgentConfiguredMock.mockReturnValue(false);

133175

getProgramContextMock.mockReturnValue(null);

134176

delete process.env.OPENCLAW_DISABLE_CLI_STARTUP_HELP_FAST_PATH;

177+

delete process.env.OPENCLAW_HIDE_BANNER;

135178

});

136179137180

it("does not force process.exit after successful routed command", async () => {

@@ -151,6 +194,32 @@ describe("runCli exit behavior", () => {

151194

exitSpy.mockRestore();

152195

});

153196197+

it("emits the startup banner before gateway foreground fast-path startup", async () => {

198+

await runCli(["node", "openclaw", "gateway", "--force"]);

199+200+

expect(tryRouteCliMock).not.toHaveBeenCalled();

201+

expect(emitCliBannerMock).toHaveBeenCalledWith("9.9.9-test", {

202+

argv: ["node", "openclaw", "gateway", "--force"],

203+

});

204+

expect(addGatewayRunCommandMock).toHaveBeenCalledTimes(2);

205+

expect(commanderParseAsyncMock).toHaveBeenCalledWith([

206+

"node",

207+

"openclaw",

208+

"gateway",

209+

"--force",

210+

]);

211+

});

212+213+

it("honors banner suppression on the gateway foreground fast path", async () => {

214+

process.env.OPENCLAW_HIDE_BANNER = "1";

215+216+

await runCli(["node", "openclaw", "gateway"]);

217+218+

expect(tryRouteCliMock).not.toHaveBeenCalled();

219+

expect(emitCliBannerMock).not.toHaveBeenCalled();

220+

expect(commanderParseAsyncMock).toHaveBeenCalledWith(["node", "openclaw", "gateway"]);

221+

});

222+154223

it("renders browser help from startup metadata without building the full program", async () => {

155224

outputPrecomputedBrowserHelpTextMock.mockReturnValueOnce(true);

156225

const exitSpy = vi.spyOn(process, "exit").mockImplementation(((code?: number) => {