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

推荐订阅源

V
Visual Studio Blog
量子位
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell

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(browser): harden CLI wait and option handling · openc...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -4,19 +4,36 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

44

const manageMocks = vi.hoisted(() => {

55

const doctorAction = vi.fn();

66

const openAction = vi.fn();

7+

const startAction = vi.fn();

78

const statusAction = vi.fn();

9+

const tabNewAction = vi.fn();

810

const tabsAction = vi.fn();

911

const registerBrowserManageCommands = vi.fn((browser: Command) => {

12+

browser.command("start").description("Start browser").action(startAction);

1013

browser.command("status").description("Show browser status").action(statusAction);

1114

browser.command("tabs").description("List tabs").action(tabsAction);

15+

browser

16+

.command("tab")

17+

.description("Tab shortcuts")

18+

.command("new")

19+

.description("Open a new tab")

20+

.action(tabNewAction);

1221

browser.command("open").description("Open URL").argument("<url>").action(openAction);

1322

browser

1423

.command("doctor")

1524

.description("Check browser plugin readiness")

1625

.option("--deep", "Run a live snapshot probe")

1726

.action(doctorAction);

1827

});

19-

return { doctorAction, openAction, registerBrowserManageCommands, statusAction, tabsAction };

28+

return {

29+

doctorAction,

30+

openAction,

31+

registerBrowserManageCommands,

32+

startAction,

33+

statusAction,

34+

tabNewAction,

35+

tabsAction,

36+

};

2037

});

2138

const inspectMocks = vi.hoisted(() => ({

2239

registerBrowserInspectCommands: vi.fn(),

@@ -68,7 +85,9 @@ describe("registerBrowserCli lazy browser subcommands", () => {

6885

manageMocks.registerBrowserManageCommands.mockClear();

6986

manageMocks.doctorAction.mockClear();

7087

manageMocks.openAction.mockClear();

88+

manageMocks.startAction.mockClear();

7189

manageMocks.statusAction.mockClear();

90+

manageMocks.tabNewAction.mockClear();

7291

manageMocks.tabsAction.mockClear();

7392

inspectMocks.registerBrowserInspectCommands.mockClear();

7493

actionInputMocks.registerBrowserActionInputCommands.mockClear();

@@ -160,6 +179,57 @@ describe("registerBrowserCli lazy browser subcommands", () => {

160179

expect(tabsCommand.parent?.opts().json).toBe(true);

161180

});

162181182+

it("skips browser option values when selecting the lazy command group", async () => {

183+

const program = new Command();

184+

program.name("openclaw");

185+186+

registerBrowserCli(program, [

187+

"node",

188+

"openclaw",

189+

"browser",

190+

"--browser-profile",

191+

"status",

192+

"start",

193+

]);

194+195+

const browser = program.commands.find((command) => command.name() === "browser");

196+

expect(browser?.commands.map((command) => command.name())).toContain("start");

197+198+

await program.parseAsync(["browser", "--browser-profile", "status", "start"], {

199+

from: "user",

200+

});

201+202+

expect(manageMocks.registerBrowserManageCommands).toHaveBeenCalledTimes(1);

203+

expect(manageMocks.startAction).toHaveBeenCalledTimes(1);

204+

expect(manageMocks.statusAction).not.toHaveBeenCalled();

205+

});

206+207+

it("resolves browser parent options for nested commands", async () => {

208+

const program = new Command();

209+

program.name("openclaw");

210+211+

registerBrowserCli(program, [

212+

"node",

213+

"openclaw",

214+

"browser",

215+

"--browser-profile",

216+

"work",

217+

"tab",

218+

"new",

219+

]);

220+221+

await program.parseAsync(["browser", "--browser-profile", "work", "--json", "tab", "new"], {

222+

from: "user",

223+

});

224+225+

expect(manageMocks.tabNewAction).toHaveBeenCalledTimes(1);

226+

const tabCommand = requireTrailingCommand(

227+

requireFirstCall(manageMocks.tabNewAction, "tab new action call"),

228+

"tab new action",

229+

);

230+

expect(tabCommand.parent?.parent?.opts()).toMatchObject({ browserProfile: "work", json: true });

231+

});

232+163233

it("can eagerly register all browser groups for compatibility", async () => {

164234

vi.stubEnv("OPENCLAW_DISABLE_LAZY_SUBCOMMANDS", "1");

165235

const program = new Command();