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

推荐订阅源

N
Netflix TechBlog - Medium
J
Java Code Geeks
爱范儿
爱范儿
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
I
InfoQ
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research

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: dedupe approval forwarder mock calls · openclaw/ope...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -68,6 +68,18 @@ async function flushPendingDelivery(): Promise<void> {

6868

await Promise.resolve();

6969

}

707071+

type DeliveryArgs = {

72+

payloads?: Array<{ text?: string; interactive?: unknown }>;

73+

};

74+75+

function deliveryArgs(deliver: ReturnType<typeof vi.fn>): DeliveryArgs | undefined {

76+

return deliver.mock.calls.at(0)?.at(0) as DeliveryArgs | undefined;

77+

}

78+79+

function firstDeliveredPayload(deliver: ReturnType<typeof vi.fn>) {

80+

return deliveryArgs(deliver)?.payloads?.at(0);

81+

}

82+7183

function registerSlackAdapterPlugin(plugin: SlackAdapterPlugin): void {

7284

const registry = createTestRegistry([{ pluginId: "slack", plugin, source: "test" }]);

7385

setActivePluginRegistry(registry);

@@ -119,10 +131,7 @@ describe("plugin approval forwarding", () => {

119131

expect(result).toBe(true);

120132

await flushPendingDelivery();

121133

expect(deliver).toHaveBeenCalled();

122-

const deliveryArgs = deliver.mock.calls[0]?.[0] as

123-

| { payloads?: Array<{ text?: string; interactive?: unknown }> }

124-

| undefined;

125-

const payload = deliveryArgs?.payloads?.[0];

134+

const payload = firstDeliveredPayload(deliver);

126135

const text = payload?.text ?? "";

127136

expect(text).toContain("Plugin approval required");

128137

expect(text).toContain("Sensitive tool call");

@@ -167,10 +176,7 @@ describe("plugin approval forwarding", () => {

167176

);

168177

expect(result).toBe(true);

169178

await flushPendingDelivery();

170-

const deliveryArgs = deliver.mock.calls[0]?.[0] as

171-

| { payloads?: Array<{ text?: string; interactive?: unknown }> }

172-

| undefined;

173-

const payload = deliveryArgs?.payloads?.[0];

179+

const payload = firstDeliveredPayload(deliver);

174180

expect(payload?.text).toContain("Reply with: /approve <id> allow-once|deny");

175181

expect(payload?.text).not.toContain("allow-always");

176182

expect(payload?.interactive).toEqual({

@@ -202,9 +208,7 @@ describe("plugin approval forwarding", () => {

202208

await forwarder.handlePluginApprovalRequested!(request);

203209

await flushPendingDelivery();

204210

expect(deliver).toHaveBeenCalled();

205-

const text =

206-

(deliver.mock.calls[0]?.[0] as { payloads?: Array<{ text?: string }> })?.payloads?.[0]

207-

?.text ?? "";

211+

const text = firstDeliveredPayload(deliver)?.text ?? "";

208212

expect(text).toMatch(/🚨/);

209213

});

210214

@@ -267,10 +271,7 @@ describe("plugin approval forwarding", () => {

267271

await forwarder.handlePluginApprovalRequested!(makePluginRequest());

268272

await flushPendingDelivery();

269273

expect(deliver).toHaveBeenCalled();

270-

const deliveryArgs = deliver.mock.calls[0]?.[0] as

271-

| { payloads?: Array<{ text?: string }> }

272-

| undefined;

273-

expect(deliveryArgs?.payloads?.[0]?.text).toBe("custom adapter payload");

274+

expect(firstDeliveredPayload(deliver)?.text).toBe("custom adapter payload");

274275

});

275276276277

it("calls outbound beforeDeliverPayload before plugin approval delivery", async () => {

@@ -314,10 +315,7 @@ describe("plugin approval forwarding", () => {

314315

await forwarder.handlePluginApprovalResolved!(makePluginResolved());

315316

await flushPendingDelivery();

316317

expect(deliver).toHaveBeenCalled();

317-

const deliveryArgs = deliver.mock.calls[0]?.[0] as

318-

| { payloads?: Array<{ text?: string }> }

319-

| undefined;

320-

expect(deliveryArgs?.payloads?.[0]?.text).toBe("custom resolved payload");

318+

expect(firstDeliveredPayload(deliver)?.text).toBe("custom resolved payload");

321319

});

322320

});

323321

@@ -330,9 +328,7 @@ describe("plugin approval forwarding", () => {

330328331329

await forwarder.handlePluginApprovalResolved!(makePluginResolved());

332330

expect(deliver).toHaveBeenCalled();

333-

const text =

334-

(deliver.mock.calls[0]?.[0] as { payloads?: Array<{ text?: string }> })?.payloads?.[0]

335-

?.text ?? "";

331+

const text = firstDeliveredPayload(deliver)?.text ?? "";

336332

expect(text).toContain("Plugin approval");

337333

expect(text).toContain("allowed once");

338334

});

@@ -358,9 +354,7 @@ describe("plugin approval forwarding", () => {

358354

});

359355360356

expect(deliver).toHaveBeenCalled();

361-

const text =

362-

(deliver.mock.calls[0]?.[0] as { payloads?: Array<{ text?: string }> })?.payloads?.[0]

363-

?.text ?? "";

357+

const text = firstDeliveredPayload(deliver)?.text ?? "";

364358

expect(text).toContain("Plugin approval");

365359

expect(text).toContain("denied");

366360

});