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

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
B
Blog RSS Feed
D
DataBreaches.Net
L
LangChain Blog
月光博客
月光博客
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
美团技术团队
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
小众软件
小众软件
罗磊的独立博客
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta

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
test: tighten onboard cli assertions · openclaw/openclaw@...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -63,6 +63,16 @@ describe("registerOnboardCommand", () => {

6363

await program.parseAsync(args, { from: "user" });

6464

}

656566+

function setupWizardOptions(callIndex = 0): Record<string, unknown> {

67+

const call = setupWizardCommandMock.mock.calls[callIndex];

68+

expect(call).toBeDefined();

69+

if (!call) {

70+

throw new Error(`expected setup wizard call ${callIndex}`);

71+

}

72+

expect(call[1]).toBe(runtime);

73+

return call[0] as Record<string, unknown>;

74+

}

75+6676

beforeEach(() => {

6777

vi.clearAllMocks();

6878

mocks.runCrestodian.mockResolvedValue(undefined);

@@ -72,113 +82,54 @@ describe("registerOnboardCommand", () => {

7282

it("defaults installDaemon to undefined when no daemon flags are provided", async () => {

7383

await runCli(["onboard"]);

748475-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

76-

expect.objectContaining({

77-

installDaemon: undefined,

78-

}),

79-

runtime,

80-

);

85+

expect(setupWizardOptions().installDaemon).toBeUndefined();

8186

expect(mocks.runCrestodian).not.toHaveBeenCalled();

8287

});

83888489

it("sets installDaemon from explicit install flags and prioritizes --skip-daemon", async () => {

8590

await runCli(["onboard", "--install-daemon"]);

86-

expect(setupWizardCommandMock).toHaveBeenNthCalledWith(

87-

1,

88-

expect.objectContaining({

89-

installDaemon: true,

90-

}),

91-

runtime,

92-

);

91+

expect(setupWizardOptions(0).installDaemon).toBe(true);

93929493

await runCli(["onboard", "--no-install-daemon"]);

95-

expect(setupWizardCommandMock).toHaveBeenNthCalledWith(

96-

2,

97-

expect.objectContaining({

98-

installDaemon: false,

99-

}),

100-

runtime,

101-

);

94+

expect(setupWizardOptions(1).installDaemon).toBe(false);

1029510396

await runCli(["onboard", "--install-daemon", "--skip-daemon"]);

104-

expect(setupWizardCommandMock).toHaveBeenNthCalledWith(

105-

3,

106-

expect.objectContaining({

107-

installDaemon: false,

108-

}),

109-

runtime,

110-

);

97+

expect(setupWizardOptions(2).installDaemon).toBe(false);

11198

});

11299113100

it("parses numeric gateway port and drops invalid values", async () => {

114101

await runCli(["onboard", "--gateway-port", "18789"]);

115-

expect(setupWizardCommandMock).toHaveBeenNthCalledWith(

116-

1,

117-

expect.objectContaining({

118-

gatewayPort: 18789,

119-

}),

120-

runtime,

121-

);

102+

expect(setupWizardOptions(0).gatewayPort).toBe(18789);

122103123104

await runCli(["onboard", "--gateway-port", "nope"]);

124-

expect(setupWizardCommandMock).toHaveBeenNthCalledWith(

125-

2,

126-

expect.objectContaining({

127-

gatewayPort: undefined,

128-

}),

129-

runtime,

130-

);

105+

expect(setupWizardOptions(1).gatewayPort).toBeUndefined();

131106

});

132107133108

it("forwards --reset-scope to setup wizard options", async () => {

134109

await runCli(["onboard", "--reset", "--reset-scope", "full"]);

135-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

136-

expect.objectContaining({

137-

reset: true,

138-

resetScope: "full",

139-

}),

140-

runtime,

141-

);

110+

const options = setupWizardOptions();

111+

expect(options.reset).toBe(true);

112+

expect(options.resetScope).toBe("full");

142113

});

143114144115

it("forwards --skip-bootstrap to setup wizard options", async () => {

145116

await runCli(["onboard", "--skip-bootstrap"]);

146-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

147-

expect.objectContaining({

148-

skipBootstrap: true,

149-

}),

150-

runtime,

151-

);

117+

expect(setupWizardOptions().skipBootstrap).toBe(true);

152118

});

153119154120

it("parses --mistral-api-key and forwards mistralApiKey", async () => {

155121

await runCli(["onboard", "--mistral-api-key", "sk-mistral-test"]);

156-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

157-

expect.objectContaining({

158-

mistralApiKey: "sk-mistral-test", // pragma: allowlist secret

159-

}),

160-

runtime,

161-

);

122+

expect(setupWizardOptions().mistralApiKey).toBe("sk-mistral-test"); // pragma: allowlist secret

162123

});

163124164125

it("dedupes provider auth flags before registering command options", async () => {

165126

await runCli(["onboard", "--openai-api-key", "sk-openai-test"]);

166-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

167-

expect.objectContaining({

168-

openaiApiKey: "sk-openai-test", // pragma: allowlist secret

169-

}),

170-

runtime,

171-

);

127+

expect(setupWizardOptions().openaiApiKey).toBe("sk-openai-test"); // pragma: allowlist secret

172128

});

173129174130

it("forwards --gateway-token-ref-env", async () => {

175131

await runCli(["onboard", "--gateway-token-ref-env", "OPENCLAW_GATEWAY_TOKEN"]);

176-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

177-

expect.objectContaining({

178-

gatewayTokenRefEnv: "OPENCLAW_GATEWAY_TOKEN",

179-

}),

180-

runtime,

181-

);

132+

expect(setupWizardOptions().gatewayTokenRefEnv).toBe("OPENCLAW_GATEWAY_TOKEN");

182133

});

183134184135

it("forwards onboarding migration flags", async () => {

@@ -192,15 +143,11 @@ describe("registerOnboardCommand", () => {

192143

"/tmp/hermes",

193144

"--import-secrets",

194145

]);

195-

expect(setupWizardCommandMock).toHaveBeenCalledWith(

196-

expect.objectContaining({

197-

flow: "import",

198-

importFrom: "hermes",

199-

importSource: "/tmp/hermes",

200-

importSecrets: true,

201-

}),

202-

runtime,

203-

);

146+

const options = setupWizardOptions();

147+

expect(options.flow).toBe("import");

148+

expect(options.importFrom).toBe("hermes");

149+

expect(options.importSource).toBe("/tmp/hermes");

150+

expect(options.importSecrets).toBe(true);

204151

});

205152206153

it("reports errors via runtime on setup wizard command failures", async () => {