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

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
The Cloudflare Blog
IT之家
IT之家
雷峰网
雷峰网
小众软件
小众软件
博客园 - 叶小钗
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog

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: exercise command policy resolvers · openclaw/opencl...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -17,6 +17,15 @@ const DEFAULT_EXPECTED_POLICY: CliCommandPathPolicy = {

1717

networkProxy: "default",

1818

};

191920+

type NetworkProxyResolver = Extract<

21+

CliCommandPathPolicy["networkProxy"],

22+

(ctx: { argv: string[]; commandPath: string[] }) => unknown

23+

>;

24+

type LoadPluginsResolver = Extract<

25+

CliCommandPathPolicy["loadPlugins"],

26+

(ctx: { argv: string[]; commandPath: string[]; jsonOutputMode: boolean }) => unknown

27+

>;

28+2029

function expectResolvedPolicy(

2130

commandPath: string[],

2231

expected: Partial<CliCommandPathPolicy>,

@@ -27,6 +36,18 @@ function expectResolvedPolicy(

2736

});

2837

}

293839+

function expectNetworkProxyResolver(

40+

policy: CliCommandPathPolicy,

41+

): asserts policy is CliCommandPathPolicy & { networkProxy: NetworkProxyResolver } {

42+

expect(typeof policy.networkProxy).toBe("function");

43+

}

44+45+

function expectLoadPluginsResolver(

46+

policy: CliCommandPathPolicy,

47+

): asserts policy is CliCommandPathPolicy & { loadPlugins: LoadPluginsResolver } {

48+

expect(typeof policy.loadPlugins).toBe("function");

49+

}

50+3051

describe("command-path-policy", () => {

3152

afterEach(() => {

3253

vi.doUnmock("./command-catalog.js");

@@ -61,11 +82,26 @@ describe("command-path-policy", () => {

6182

pluginRegistry: { scope: "configured-channels" },

6283

networkProxy: "bypass",

6384

});

64-

expectResolvedPolicy(["channels", "status"], {

85+

const channelsStatusPolicy = resolveCliCommandPathPolicy(["channels", "status"]);

86+

expect(channelsStatusPolicy).toEqual({

87+

...DEFAULT_EXPECTED_POLICY,

6588

loadPlugins: "never",

6689

pluginRegistry: { scope: "configured-channels" },

67-

networkProxy: expect.any(Function),

90+

networkProxy: channelsStatusPolicy.networkProxy,

6891

});

92+

expectNetworkProxyResolver(channelsStatusPolicy);

93+

expect(

94+

channelsStatusPolicy.networkProxy({

95+

argv: ["node", "openclaw", "channels", "status"],

96+

commandPath: ["channels", "status"],

97+

}),

98+

).toBe("bypass");

99+

expect(

100+

channelsStatusPolicy.networkProxy({

101+

argv: ["node", "openclaw", "channels", "status", "--probe"],

102+

commandPath: ["channels", "status"],

103+

}),

104+

).toBe("default");

69105

expectResolvedPolicy(["channels", "list"], {

70106

loadPlugins: "never",

71107

pluginRegistry: { scope: "configured-channels" },

@@ -89,11 +125,48 @@ describe("command-path-policy", () => {

89125

});

9012691127

it("keeps config-only agent commands on config-only startup", () => {

92-

expectResolvedPolicy(["agent"], {

93-

loadPlugins: expect.any(Function),

128+

const agentPolicy = resolveCliCommandPathPolicy(["agent"]);

129+

expect(agentPolicy).toEqual({

130+

...DEFAULT_EXPECTED_POLICY,

131+

loadPlugins: agentPolicy.loadPlugins,

94132

pluginRegistry: { scope: "all" },

95-

networkProxy: expect.any(Function),

133+

networkProxy: agentPolicy.networkProxy,

96134

});

135+

expectLoadPluginsResolver(agentPolicy);

136+

expectNetworkProxyResolver(agentPolicy);

137+

expect(

138+

agentPolicy.loadPlugins({

139+

argv: ["node", "openclaw", "agent"],

140+

commandPath: ["agent"],

141+

jsonOutputMode: false,

142+

}),

143+

).toBe(true);

144+

expect(

145+

agentPolicy.loadPlugins({

146+

argv: ["node", "openclaw", "agent", "--json"],

147+

commandPath: ["agent"],

148+

jsonOutputMode: true,

149+

}),

150+

).toBe(false);

151+

expect(

152+

agentPolicy.loadPlugins({

153+

argv: ["node", "openclaw", "agent", "--local"],

154+

commandPath: ["agent"],

155+

jsonOutputMode: true,

156+

}),

157+

).toBe(true);

158+

expect(

159+

agentPolicy.networkProxy({

160+

argv: ["node", "openclaw", "agent"],

161+

commandPath: ["agent"],

162+

}),

163+

).toBe("bypass");

164+

expect(

165+

agentPolicy.networkProxy({

166+

argv: ["node", "openclaw", "agent", "--local"],

167+

commandPath: ["agent"],

168+

}),

169+

).toBe("default");

9717098171

for (const commandPath of [

99172

["agents"],