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

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

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(plugins): allow Discord install repair · openclaw/ope...
steipete · 2026-05-03 · via Recent Commits to openclaw:main

@@ -26,7 +26,7 @@ vi.mock("../commands/doctor/shared/channel-doctor.js", () => ({

2626

collectChannelDoctorStaleConfigMutationsMock(cfg),

2727

}));

282829-

const MATRIX_REPO_INSTALL_SPEC = repoInstallSpec("matrix");

29+

const DISCORD_REPO_INSTALL_SPEC = repoInstallSpec("discord");

30303131

function makeSnapshot(overrides: Partial<ConfigFileSnapshot> = {}): ConfigFileSnapshot {

3232

return {

@@ -40,18 +40,18 @@ function makeSnapshot(overrides: Partial<ConfigFileSnapshot> = {}): ConfigFileSn

4040

runtimeConfig: { plugins: {} } as ConfigFileSnapshot["runtimeConfig"],

4141

config: { plugins: {} } as OpenClawConfig,

4242

hash: "abc",

43-

issues: [{ path: "plugins.installs.matrix", message: "stale path" }],

43+

issues: [{ path: "plugins.installs.discord", message: "stale path" }],

4444

warnings: [],

4545

legacyIssues: [],

4646

...overrides,

4747

};

4848

}

49495050

describe("loadConfigForInstall", () => {

51-

const matrixNpmRequest = {

52-

rawSpec: "@openclaw/matrix",

53-

normalizedSpec: "@openclaw/matrix",

54-

bundledPluginId: "matrix",

51+

const discordNpmRequest = {

52+

rawSpec: "@openclaw/discord",

53+

normalizedSpec: "@openclaw/discord",

54+

bundledPluginId: "discord",

5555

allowInvalidConfigRecovery: true,

5656

} satisfies PluginInstallRequestContext;

5757

@@ -68,22 +68,22 @@ describe("loadConfigForInstall", () => {

6868

});

69697070

it("returns the source config and base hash when the snapshot is valid", async () => {

71-

const cfg = { plugins: { entries: { matrix: { enabled: true } } } } as OpenClawConfig;

71+

const cfg = { plugins: { entries: { discord: { enabled: true } } } } as OpenClawConfig;

7272

readConfigFileSnapshotMock.mockResolvedValue(

7373

makeSnapshot({

7474

valid: true,

7575

sourceConfig: cfg,

76-

config: { plugins: { entries: { matrix: { enabled: true } }, enabled: true } },

76+

config: { plugins: { entries: { discord: { enabled: true } }, enabled: true } },

7777

hash: "config-1",

7878

issues: [],

7979

}),

8080

);

818182-

const result = await loadConfigForInstall(matrixNpmRequest);

82+

const result = await loadConfigForInstall(discordNpmRequest);

8383

expect(result).toEqual({ config: cfg, baseHash: "config-1" });

8484

});

858586-

it("does not run stale Matrix cleanup on the happy path", async () => {

86+

it("does not run stale Discord cleanup on the happy path", async () => {

8787

const cfg = { plugins: {} } as OpenClawConfig;

8888

readConfigFileSnapshotMock.mockResolvedValue(

8989

makeSnapshot({

@@ -94,56 +94,56 @@ describe("loadConfigForInstall", () => {

9494

}),

9595

);

969697-

const result = await loadConfigForInstall(matrixNpmRequest);

97+

const result = await loadConfigForInstall(discordNpmRequest);

9898

expect(collectChannelDoctorStaleConfigMutationsMock).not.toHaveBeenCalled();

9999

expect(result.config).toBe(cfg);

100100

});

101101102102

it("falls back to snapshot config for explicit bundled-plugin reinstall when issues match the known upgrade failure", async () => {

103103

const snapshotCfg = {

104-

plugins: { installs: { matrix: { source: "path", installPath: "/gone" } } },

104+

plugins: { installs: { discord: { source: "path", installPath: "/gone" } } },

105105

} as unknown as OpenClawConfig;

106106

readConfigFileSnapshotMock.mockResolvedValue(

107107

makeSnapshot({

108-

parsed: { plugins: { installs: { matrix: {} } } },

108+

parsed: { plugins: { installs: { discord: {} } } },

109109

config: snapshotCfg,

110110

issues: [

111-

{ path: "channels.matrix", message: "unknown channel id: matrix" },

111+

{ path: "channels.discord", message: "unknown channel id: discord" },

112112

{ path: "plugins.load.paths", message: "plugin: plugin path not found: /gone" },

113113

],

114114

}),

115115

);

116116117-

const result = await loadConfigForInstall(matrixNpmRequest);

117+

const result = await loadConfigForInstall(discordNpmRequest);

118118

expect(readConfigFileSnapshotMock).toHaveBeenCalled();

119119

expect(collectChannelDoctorStaleConfigMutationsMock).toHaveBeenCalledWith(snapshotCfg);

120120

expect(result).toEqual({ config: snapshotCfg, baseHash: "abc" });

121121

});

122122123123

it("allows npm:-prefixed bundled-plugin reinstall recovery", async () => {

124124

const snapshotCfg = {

125-

plugins: { installs: { matrix: { source: "path", installPath: "/gone" } } },

125+

plugins: { installs: { discord: { source: "path", installPath: "/gone" } } },

126126

} as unknown as OpenClawConfig;

127127

readConfigFileSnapshotMock.mockResolvedValue(

128128

makeSnapshot({

129-

parsed: { plugins: { installs: { matrix: {} } } },

129+

parsed: { plugins: { installs: { discord: {} } } },

130130

config: snapshotCfg,

131131

issues: [

132-

{ path: "channels.matrix", message: "unknown channel id: matrix" },

132+

{ path: "channels.discord", message: "unknown channel id: discord" },

133133

{ path: "plugins.load.paths", message: "plugin: plugin path not found: /gone" },

134134

],

135135

}),

136136

);

137137138138

const request = resolvePluginInstallRequestContext({

139-

rawSpec: "npm:@openclaw/matrix",

139+

rawSpec: "npm:@openclaw/discord",

140140

});

141141

if (!request.ok) {

142142

throw new Error(request.error);

143143

}

144144145145

expect(request.request).toMatchObject({

146-

bundledPluginId: "matrix",

146+

bundledPluginId: "discord",

147147

allowInvalidConfigRecovery: true,

148148

});

149149

const result = await loadConfigForInstall(request.request);

@@ -156,20 +156,20 @@ describe("loadConfigForInstall", () => {

156156

readConfigFileSnapshotMock.mockResolvedValue(

157157

makeSnapshot({

158158

config: snapshotCfg,

159-

issues: [{ path: "channels.matrix", message: "unknown channel id: matrix" }],

159+

issues: [{ path: "channels.discord", message: "unknown channel id: discord" }],

160160

}),

161161

);

162162163163

const repoRequest = resolvePluginInstallRequestContext({

164-

rawSpec: MATRIX_REPO_INSTALL_SPEC,

164+

rawSpec: DISCORD_REPO_INSTALL_SPEC,

165165

});

166166

if (!repoRequest.ok) {

167167

throw new Error(repoRequest.error);

168168

}

169169170170

const result = await loadConfigForInstall({

171171

...repoRequest.request,

172-

resolvedPath: bundledPluginRootAt("/tmp/repo", "matrix"),

172+

resolvedPath: bundledPluginRootAt("/tmp/repo", "discord"),

173173

});

174174

expect(result.config).toBe(snapshotCfg);

175175

});

@@ -181,12 +181,12 @@ describe("loadConfigForInstall", () => {

181181

}),

182182

);

183183184-

await expect(loadConfigForInstall(matrixNpmRequest)).rejects.toThrow(

185-

"Config invalid outside the bundled recovery path for matrix",

184+

await expect(loadConfigForInstall(discordNpmRequest)).rejects.toThrow(

185+

"Config invalid outside the bundled recovery path for discord",

186186

);

187187

});

188188189-

it("rejects non-Matrix install requests when config is invalid", async () => {

189+

it("rejects non-Discord install requests when config is invalid", async () => {

190190

readConfigFileSnapshotMock.mockResolvedValue(makeSnapshot());

191191192192

await expect(

@@ -205,15 +205,15 @@ describe("loadConfigForInstall", () => {

205205

}),

206206

);

207207208-

await expect(loadConfigForInstall(matrixNpmRequest)).rejects.toThrow(

208+

await expect(loadConfigForInstall(discordNpmRequest)).rejects.toThrow(

209209

"Config file could not be parsed; run `openclaw doctor` to repair it.",

210210

);

211211

});

212212213213

it("throws when invalid snapshot config file does not exist", async () => {

214214

readConfigFileSnapshotMock.mockResolvedValue(makeSnapshot({ exists: false, parsed: {} }));

215215216-

await expect(loadConfigForInstall(matrixNpmRequest)).rejects.toThrow(

216+

await expect(loadConfigForInstall(discordNpmRequest)).rejects.toThrow(

217217

"Config file could not be parsed; run `openclaw doctor` to repair it.",

218218

);

219219

});