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

推荐订阅源

WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
月光博客
月光博客
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
IT之家
IT之家
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare 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: tighten exec approval request assertions · openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -36,6 +36,10 @@ let callGatewayTool: typeof import("./tools/gateway.js").callGatewayTool;

3636

let requestExecApprovalDecision: typeof import("./bash-tools.exec-approval-request.js").requestExecApprovalDecision;

3737

let registerExecApprovalRequestForHost: typeof import("./bash-tools.exec-approval-request.js").registerExecApprovalRequestForHost;

383839+

type ApprovalRequestPayload = {

40+

commandSpans?: Array<{ startIndex: number; endIndex: number }>;

41+

};

42+3943

describe("requestExecApprovalDecision", () => {

4044

beforeAll(async () => {

4145

({ callGatewayTool } = await import("./tools/gateway.js"));

@@ -219,18 +223,12 @@ describe("requestExecApprovalDecision", () => {

219223

ask: "always",

220224

});

221225222-

expect(callGatewayTool).toHaveBeenCalledWith(

223-

"exec.approval.request",

224-

expect.anything(),

225-

expect.objectContaining({

226-

commandSpans: expect.arrayContaining([

227-

{ startIndex: 0, endIndex: 2 },

228-

{ startIndex: 5, endIndex: 9 },

229-

{ startIndex: 20, endIndex: 26 },

230-

]),

231-

}),

232-

expect.anything(),

233-

);

226+

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

227+

| ApprovalRequestPayload

228+

| undefined;

229+

expect(payload?.commandSpans).toContainEqual({ startIndex: 0, endIndex: 2 });

230+

expect(payload?.commandSpans).toContainEqual({ startIndex: 5, endIndex: 9 });

231+

expect(payload?.commandSpans).toContainEqual({ startIndex: 20, endIndex: 26 });

234232

});

235233236234

it("uses system run plan command text for host approval explanations", async () => {

@@ -251,14 +249,10 @@ describe("requestExecApprovalDecision", () => {

251249

ask: "always",

252250

});

253251254-

expect(callGatewayTool).toHaveBeenCalledWith(

255-

"exec.approval.request",

256-

expect.anything(),

257-

expect.objectContaining({

258-

commandSpans: expect.arrayContaining([{ startIndex: 0, endIndex: 4 }]),

259-

}),

260-

expect.anything(),

261-

);

252+

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

253+

| ApprovalRequestPayload

254+

| undefined;

255+

expect(payload?.commandSpans).toContainEqual({ startIndex: 0, endIndex: 4 });

262256

});

263257264258

it("keeps explicit command spans", async () => {

@@ -274,11 +268,9 @@ describe("requestExecApprovalDecision", () => {

274268

ask: "always",

275269

});

276270277-

expect(callGatewayTool).toHaveBeenCalledWith(

278-

"exec.approval.request",

279-

expect.anything(),

280-

expect.objectContaining({ commandSpans: [{ startIndex: 0, endIndex: 4 }] }),

281-

expect.anything(),

282-

);

271+

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

272+

| ApprovalRequestPayload

273+

| undefined;

274+

expect(payload?.commandSpans).toEqual([{ startIndex: 0, endIndex: 4 }]);

283275

});

284276

});