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

推荐订阅源

G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
雷峰网
雷峰网
博客园_首页
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
小众软件
小众软件
D
Docker
P
Proofpoint News Feed
B
Blog
Vercel News
Vercel News
B
Blog RSS Feed
U
Unit 42
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
I
InfoQ
Recent Announcements
Recent Announcements

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
refactor: drop provider reconnect shim · openclaw/opencla...
steipete · 2026-04-22 · via Recent Commits to openclaw:main

2 files changed

+

4

-

43

lines changed

Original file line numberDiff line numberDiff line change

@@ -38,8 +38,8 @@ beforeEach(() => {

3838

describe("plugin-sdk drainPendingDeliveries", () => {

3939

it("injects the lazy outbound deliver runtime when no deliver fn is provided", async () => {

4040

await drainPendingDeliveries({

41-

drainKey: "whatsapp:test",

42-

logLabel: "WhatsApp reconnect drain",

41+

drainKey: "demo:test",

42+

logLabel: "Demo reconnect drain",

4343

cfg: {},

4444

log,

4545

selectEntry: () => ({ match: false }),

@@ -56,8 +56,8 @@ describe("plugin-sdk drainPendingDeliveries", () => {

5656

const deliver = vi.fn(async () => []);

5757
5858

await drainPendingDeliveries({

59-

drainKey: "whatsapp:test",

60-

logLabel: "WhatsApp reconnect drain",

59+

drainKey: "demo:test",

60+

logLabel: "Demo reconnect drain",

6161

cfg: {},

6262

log,

6363

deliver,

Original file line numberDiff line numberDiff line change

@@ -1,18 +1,10 @@

1-

import type { OpenClawConfig } from "../config/types.openclaw.js";

21

import {

32

drainPendingDeliveries as coreDrainPendingDeliveries,

43

type DeliverFn,

5-

type RecoveryLogger,

64

} from "../infra/outbound/delivery-queue.js";

75
86

// Public runtime/transport helpers for plugins that need shared infra behavior.

97
10-

function normalizeWhatsAppReconnectAccountId(accountId?: string): string {

11-

return (accountId ?? "").trim() || "default";

12-

}

13-
14-

const WHATSAPP_NO_LISTENER_ERROR_RE = /No active WhatsApp Web listener/i;

15-
168

type OutboundDeliverRuntimeModule = typeof import("../infra/outbound/deliver-runtime.js");

179

type DrainPendingDeliveriesOptions = Omit<

1810

Parameters<typeof coreDrainPendingDeliveries>[0],

@@ -36,37 +28,6 @@ export async function drainPendingDeliveries(opts: DrainPendingDeliveriesOptions

3628

});

3729

}

3830
39-

/**

40-

* @deprecated Prefer plugin-owned reconnect policy wired through

41-

* `drainPendingDeliveries(...)`. This compatibility shim preserves the

42-

* historical public SDK symbol for existing plugin callers.

43-

*/

44-

export async function drainReconnectQueue(opts: {

45-

accountId: string;

46-

cfg: OpenClawConfig;

47-

log: RecoveryLogger;

48-

stateDir?: string;

49-

deliver?: DeliverFn;

50-

}): Promise<void> {

51-

const normalizedAccountId = normalizeWhatsAppReconnectAccountId(opts.accountId);

52-

await drainPendingDeliveries({

53-

drainKey: `whatsapp:${normalizedAccountId}`,

54-

logLabel: "WhatsApp reconnect drain",

55-

cfg: opts.cfg,

56-

log: opts.log,

57-

stateDir: opts.stateDir,

58-

deliver: opts.deliver,

59-

selectEntry: (entry) => ({

60-

match:

61-

entry.channel === "whatsapp" &&

62-

normalizeWhatsAppReconnectAccountId(entry.accountId) === normalizedAccountId &&

63-

typeof entry.lastError === "string" &&

64-

WHATSAPP_NO_LISTENER_ERROR_RE.test(entry.lastError),

65-

bypassBackoff: true,

66-

}),

67-

});

68-

}

69-
7031

export * from "../infra/backoff.js";

7132

export * from "../infra/channel-activity.js";

7233

export * from "../infra/dedupe.js";