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

推荐订阅源

大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
美团技术团队
量子位
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
小众软件
小众软件
博客园 - 司徒正美
罗磊的独立博客
云风的 BLOG
云风的 BLOG
B
Blog RSS Feed
博客园 - 聂微东

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): pin text dm main route owner · openclaw/ope...
vincentkoc · 2026-05-01 · via Recent Commits to openclaw:main

@@ -198,6 +198,27 @@ vi.mock("openclaw/plugin-sdk/reply-runtime", () => ({

198198199199

vi.mock("openclaw/plugin-sdk/conversation-runtime", () => ({

200200

recordInboundSession: (...args: unknown[]) => recordInboundSession(...args),

201+

resolvePinnedMainDmOwnerFromAllowlist: (params: {

202+

dmScope?: string | null;

203+

allowFrom?: Array<string | number> | null;

204+

normalizeEntry: (entry: string) => string | undefined;

205+

}) => {

206+

if ((params.dmScope ?? "main") !== "main") {

207+

return null;

208+

}

209+

const allowFrom = Array.isArray(params.allowFrom) ? params.allowFrom : [];

210+

if (allowFrom.some((entry) => String(entry).trim() === "*")) {

211+

return null;

212+

}

213+

const owners = Array.from(

214+

new Set(

215+

allowFrom

216+

.map((entry) => params.normalizeEntry(String(entry)))

217+

.filter((entry): entry is string => Boolean(entry)),

218+

),

219+

);

220+

return owners.length === 1 ? owners[0] : null;

221+

},

201222

registerSessionBindingAdapter: vi.fn(),

202223

unregisterSessionBindingAdapter: vi.fn(),

203224

resolveThreadBindingConversationIdFromBindingId: (bindingId: string) =>

@@ -306,7 +327,13 @@ beforeEach(() => {

306327

});

307328308329

function getLastRouteUpdate():

309-

| { sessionKey?: string; channel?: string; to?: string; accountId?: string }

330+

| {

331+

sessionKey?: string;

332+

channel?: string;

333+

to?: string;

334+

accountId?: string;

335+

mainDmOwnerPin?: { ownerRecipient?: string; senderRecipient?: string };

336+

}

310337

| undefined {

311338

const callArgs = recordInboundSession.mock.calls.at(-1) as unknown[] | undefined;

312339

const params = callArgs?.[0] as

@@ -316,6 +343,7 @@ function getLastRouteUpdate():

316343

channel?: string;

317344

to?: string;

318345

accountId?: string;

346+

mainDmOwnerPin?: { ownerRecipient?: string; senderRecipient?: string };

319347

};

320348

}

321349

| undefined;

@@ -782,6 +810,48 @@ describe("processDiscordMessage session routing", () => {

782810

});

783811

});

784812813+

it("pins Discord text DM main-route updates to the single configured DM owner", async () => {

814+

const ctx = await createBaseContext({

815+

...createDirectMessageContextOverrides(),

816+

cfg: {

817+

messages: { ackReaction: "👀" },

818+

session: {

819+

store: "/tmp/openclaw-discord-process-test-sessions.json",

820+

dmScope: "main",

821+

},

822+

},

823+

channelConfig: { users: ["user:111"] },

824+

baseSessionKey: "agent:main:main",

825+

author: {

826+

id: "222",

827+

username: "bob",

828+

discriminator: "0",

829+

globalName: "Bob",

830+

},

831+

sender: { id: "222", label: "bob" },

832+

route: {

833+

agentId: "main",

834+

channel: "discord",

835+

accountId: "default",

836+

sessionKey: "agent:main:main",

837+

mainSessionKey: "agent:main:main",

838+

},

839+

});

840+841+

await runProcessDiscordMessage(ctx);

842+843+

expect(getLastRouteUpdate()).toMatchObject({

844+

sessionKey: "agent:main:main",

845+

channel: "discord",

846+

to: "user:222",

847+

accountId: "default",

848+

mainDmOwnerPin: {

849+

ownerRecipient: "111",

850+

senderRecipient: "222",

851+

},

852+

});

853+

});

854+785855

it("stores group lastRoute with channel target", async () => {

786856

const ctx = await createBaseContext({

787857

baseSessionKey: "agent:main:discord:channel:c1",