diff --git a/scripts/bench-cli-startup.ts b/scripts/bench-cli-startup.ts index 9e3d004a9d4..05d1848bfcb 100644 --- a/scripts/bench-cli-startup.ts +++ b/scripts/bench-cli-startup.ts @@ -532,12 +532,19 @@ function collectExitSummary(samples: Sample[]): string { } function buildConfigFixture(commandCase: CommandCase): Record | null { - if (commandCase.id !== "configGetGatewayPort") { + if (commandCase.id !== "configGetGatewayPort" && commandCase.id !== "gatewayHealthJson") { return null; } const envPort = Number.parseInt(process.env.OPENCLAW_GATEWAY_PORT ?? "", 10); const port = Number.isFinite(envPort) && envPort > 0 ? envPort : 32123; - return { gateway: { port } }; + return { + gateway: { + auth: { mode: "none" }, + bind: "loopback", + mode: "local", + port, + }, + }; } function buildRssHook(tmpDir: string): string { diff --git a/test/scripts/bench-cli-startup.test.ts b/test/scripts/bench-cli-startup.test.ts index c62180e1b52..b6d467eebbb 100644 --- a/test/scripts/bench-cli-startup.test.ts +++ b/test/scripts/bench-cli-startup.test.ts @@ -171,7 +171,14 @@ describe("bench-cli-startup", () => { args: ["config", "get", "gateway.port"], presets: ["real"], }), - ).toEqual({ gateway: { port: 32123 } }); + ).toEqual({ + gateway: { + auth: { mode: "none" }, + bind: "loopback", + mode: "local", + port: 32123, + }, + }); expect( testing.buildConfigFixture({ id: "gatewayHealthJson", @@ -179,6 +186,13 @@ describe("bench-cli-startup", () => { args: ["gateway", "health", "--json"], presets: ["real"], }), - ).toBeNull(); + ).toEqual({ + gateway: { + auth: { mode: "none" }, + bind: "loopback", + mode: "local", + port: 32123, + }, + }); }); });