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

推荐订阅源

WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
GbyAI
GbyAI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
博客园 - 叶小钗
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
U
Unit 42
博客园 - 司徒正美
博客园 - 聂微东

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
feat(plugin-sdk): add conversation binding hooks · opencl...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -302,6 +302,7 @@ vi.mock("../../plugins/conversation-binding.js", () => ({

302302

pluginId?: string;

303303

pluginName?: string;

304304

pluginRoot?: string;

305+

data?: Record<string, unknown>;

305306

};

306307

return {

307308

bindingId: record.bindingId,

@@ -312,6 +313,7 @@ vi.mock("../../plugins/conversation-binding.js", () => ({

312313

accountId: record.conversation.accountId,

313314

conversationId: record.conversation.conversationId,

314315

parentConversationId: record.conversation.parentConversationId,

316+

data: metadata.data,

315317

};

316318

},

317319

}));

@@ -2545,6 +2547,12 @@ describe("dispatchReplyFromConfig", () => {

25452547

pluginBindingOwner: "plugin",

25462548

pluginId: "openclaw-codex-app-server",

25472549

pluginRoot: "/Users/huntharo/github/openclaw-app-server",

2550+

data: {

2551+

kind: "codex-app-server-session",

2552+

version: 1,

2553+

sessionFile: "/tmp/session.jsonl",

2554+

workspaceDir: "/workspace/openclaw",

2555+

},

25482556

},

25492557

} satisfies SessionBindingRecord);

25502558

const cfg = emptyConfig;

@@ -2584,12 +2592,74 @@ describe("dispatchReplyFromConfig", () => {

25842592

channelId: "discord",

25852593

accountId: "default",

25862594

conversationId: "channel:1481858418548412579",

2595+

pluginBinding: expect.objectContaining({

2596+

data: expect.objectContaining({

2597+

kind: "codex-app-server-session",

2598+

sessionFile: "/tmp/session.jsonl",

2599+

}),

2600+

}),

25872601

}),

25882602

);

25892603

expect(hookMocks.runner.runInboundClaim).not.toHaveBeenCalled();

25902604

expect(replyResolver).not.toHaveBeenCalled();

25912605

});

259226062607+

it("delivers plugin-owned binding replies returned by the owning inbound claim hook", async () => {

2608+

setNoAbort();

2609+

hookMocks.runner.hasHooks.mockImplementation(

2610+

((hookName?: string) =>

2611+

hookName === "inbound_claim" || hookName === "message_received") as () => boolean,

2612+

);

2613+

hookMocks.registry.plugins = [{ id: "codex", status: "loaded" }];

2614+

hookMocks.runner.runInboundClaimForPluginOutcome.mockResolvedValue({

2615+

status: "handled",

2616+

result: { handled: true, reply: { text: "Codex native reply" } },

2617+

});

2618+

sessionBindingMocks.resolveByConversation.mockReturnValue({

2619+

bindingId: "binding-reply-1",

2620+

targetSessionKey: "plugin-binding:codex:reply123",

2621+

targetKind: "session",

2622+

conversation: {

2623+

channel: "discord",

2624+

accountId: "default",

2625+

conversationId: "channel:1481858418548412579",

2626+

},

2627+

status: "active",

2628+

boundAt: 1710000000000,

2629+

metadata: {

2630+

pluginBindingOwner: "plugin",

2631+

pluginId: "codex",

2632+

pluginRoot: "/plugins/codex",

2633+

},

2634+

} satisfies SessionBindingRecord);

2635+

const cfg = emptyConfig;

2636+

const dispatcher = createDispatcher();

2637+

const ctx = buildTestCtx({

2638+

Provider: "discord",

2639+

Surface: "discord",

2640+

OriginatingChannel: "discord",

2641+

OriginatingTo: "discord:channel:1481858418548412579",

2642+

To: "discord:channel:1481858418548412579",

2643+

AccountId: "default",

2644+

SenderId: "user-9",

2645+

SenderUsername: "ada",

2646+

CommandAuthorized: true,

2647+

WasMentioned: false,

2648+

CommandBody: "who are you",

2649+

RawBody: "who are you",

2650+

Body: "who are you",

2651+

MessageSid: "msg-claim-plugin-reply",

2652+

SessionKey: "agent:main:discord:channel:1481858418548412579",

2653+

});

2654+

const replyResolver = vi.fn(async () => ({ text: "should not run" }) satisfies ReplyPayload);

2655+2656+

const result = await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

2657+2658+

expect(result).toEqual({ queuedFinal: false, counts: { tool: 0, block: 0, final: 0 } });

2659+

expect(dispatcher.sendFinalReply).toHaveBeenCalledWith({ text: "Codex native reply" });

2660+

expect(replyResolver).not.toHaveBeenCalled();

2661+

});

2662+25932663

it("routes plugin-owned Discord DM bindings to the owning plugin before generic inbound claim broadcast", async () => {

25942664

setNoAbort();

25952665

hookMocks.runner.hasHooks.mockImplementation(