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

推荐订阅源

J
Java Code Geeks
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
A
About on SuperTechFans
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
美团技术团队

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(discord): keep degraded DMs on direct routes · opencl...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -117,6 +117,12 @@ function createDmClient(channelId: string): DiscordClient {

117117

} as unknown as DiscordClient;

118118

}

119119120+

function createMissingChannelClient(): DiscordClient {

121+

return {

122+

fetchChannel: async () => null,

123+

} as unknown as DiscordClient;

124+

}

125+120126

async function runThreadBoundPreflight(params: {

121127

threadId: string;

122128

parentId: string;

@@ -203,6 +209,26 @@ async function runDmPreflight(params: {

203209

});

204210

}

205211212+

async function runUnresolvedDmPreflight(params: {

213+

cfg?: import("openclaw/plugin-sdk/config-types").OpenClawConfig;

214+

channelId: string;

215+

message: import("../internal/discord.js").Message;

216+

discordConfig: DiscordConfig;

217+

}) {

218+

return preflightDiscordMessage({

219+

...createPreflightArgs({

220+

cfg: params.cfg ?? DEFAULT_PREFLIGHT_CFG,

221+

discordConfig: params.discordConfig,

222+

data: {

223+

channel_id: params.channelId,

224+

author: params.message.author,

225+

message: params.message,

226+

} as DiscordMessageEvent,

227+

client: createMissingChannelClient(),

228+

}),

229+

});

230+

}

231+206232

async function runMentionOnlyBotPreflight(params: {

207233

channelId: string;

208234

guildId: string;

@@ -483,6 +509,38 @@ describe("preflightDiscordMessage", () => {

483509

expect(result?.preflightAudioTranscript).toBe("hello openclaw from dm audio");

484510

});

485511512+

it("keeps no-guild messages direct when channel lookup is unavailable", async () => {

513+

const result = await runUnresolvedDmPreflight({

514+

cfg: {

515+

...DEFAULT_PREFLIGHT_CFG,

516+

session: {

517+

...DEFAULT_PREFLIGHT_CFG.session,

518+

dmScope: "per-channel-peer",

519+

},

520+

},

521+

channelId: "dm-channel-unresolved-1",

522+

message: createDiscordMessage({

523+

id: "m-dm-unresolved-1",

524+

channelId: "dm-channel-unresolved-1",

525+

content: "hello from a degraded dm",

526+

author: {

527+

id: "user-1",

528+

bot: false,

529+

username: "alice",

530+

},

531+

}),

532+

discordConfig: {

533+

dmPolicy: "open",

534+

} as DiscordConfig,

535+

});

536+537+

expect(result).not.toBeNull();

538+

expect(result?.channelInfo).toBeNull();

539+

expect(result?.isDirectMessage).toBe(true);

540+

expect(result?.isGroupDm).toBe(false);

541+

expect(result?.route.sessionKey).toBe("agent:main:discord:direct:user-1");

542+

});

543+486544

it("falls back to the default discord account for omitted-account dm authorization", async () => {

487545

const message = createDiscordMessage({

488546

id: "m-dm-default-account",