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

推荐订阅源

博客园_首页
B
Blog
V
V2EX
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 聂微东
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
J
Java Code Geeks
H
Help Net Security
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
D
Docker
L
LangChain Blog
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
WordPress大学
WordPress大学
V
Visual Studio 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
fix(plugin-sdk): restore channel compatibility facades · ...
vincentkoc · 2026-04-29 · via Recent Commits to openclaw:main

@@ -3,6 +3,10 @@ import { describe, expect, it, vi } from "vitest";

33

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

44

const runtimeConfig = { channels: { discord: { token: "token" } } };

55

const apiModule = {

6+

buildDiscordComponentMessage: vi.fn((params: { spec: { text?: string } }) => ({

7+

components: [],

8+

text: params.spec.text ?? "",

9+

})),

610

collectDiscordStatusIssues: vi.fn(() => []),

711

discordOnboardingAdapter: { kind: "legacy-onboarding" },

812

inspectDiscordAccount: vi.fn(() => ({ accountId: "default" })),

@@ -33,7 +37,9 @@ const mocks = vi.hoisted(() => {

3337

cfg: params.cfg,

3438

})),

3539

collectDiscordAuditChannelIds: vi.fn(() => ({ channelIds: [], unresolvedChannels: [] })),

40+

editDiscordComponentMessage: vi.fn(async () => ({ id: "message" })),

3641

listThreadBindingsBySessionKey: vi.fn(() => []),

42+

registerBuiltDiscordComponentMessage: vi.fn(),

3743

unbindThreadBindingsBySessionKey: vi.fn(() => []),

3844

};

3945

@@ -78,6 +84,7 @@ describe("discord plugin-sdk compatibility facade", () => {

7884

"PAIRING_APPROVED_MESSAGE",

7985

"applyAccountNameToChannelSection",

8086

"autoBindSpawnedDiscordSubagent",

87+

"buildDiscordComponentMessage",

8188

"buildChannelConfigSchema",

8289

"buildComputedAccountStatusSnapshot",

8390

"buildTokenChannelStatusSummary",

@@ -97,6 +104,8 @@ describe("discord plugin-sdk compatibility facade", () => {

97104

"normalizeDiscordMessagingTarget",

98105

"normalizeDiscordOutboundTarget",

99106

"projectCredentialSnapshotFields",

107+

"editDiscordComponentMessage",

108+

"registerBuiltDiscordComponentMessage",

100109

"resolveConfiguredFromCredentialStatuses",

101110

"resolveDefaultDiscordAccountId",

102111

"resolveDiscordAccount",

@@ -108,6 +117,40 @@ describe("discord plugin-sdk compatibility facade", () => {

108117

}

109118

});

110119120+

it("forwards Discord component helpers through the compatibility facade", async () => {

121+

const {

122+

buildDiscordComponentMessage,

123+

editDiscordComponentMessage,

124+

registerBuiltDiscordComponentMessage,

125+

} = await import("./discord.js");

126+127+

const built = buildDiscordComponentMessage({ spec: { text: "hello" } });

128+

await editDiscordComponentMessage(

129+

"channel",

130+

"message",

131+

{ text: "edited" },

132+

{ cfg: mocks.runtimeConfig },

133+

);

134+

registerBuiltDiscordComponentMessage({

135+

buildResult: built,

136+

messageId: "message",

137+

});

138+139+

expect(mocks.apiModule.buildDiscordComponentMessage).toHaveBeenCalledWith({

140+

spec: { text: "hello" },

141+

});

142+

expect(mocks.runtimeModule.editDiscordComponentMessage).toHaveBeenCalledWith(

143+

"channel",

144+

"message",

145+

{ text: "edited" },

146+

{ cfg: mocks.runtimeConfig },

147+

);

148+

expect(mocks.runtimeModule.registerBuiltDiscordComponentMessage).toHaveBeenCalledWith({

149+

buildResult: built,

150+

messageId: "message",

151+

});

152+

});

153+111154

it("keeps legacy Discord subagent auto-bind calls working without cfg", async () => {

112155

const { autoBindSpawnedDiscordSubagent } = await import("./discord.js");

113156