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

推荐订阅源

博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
腾讯CDC
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
F
Fortinet All Blogs
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园_首页
B
Blog RSS Feed
D
Docker
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ

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): scope commands to channels · openclaw/openc...
vincentkoc · 2026-05-04 · via Recent Commits to openclaw:main

@@ -319,6 +319,19 @@ describe("registerPluginCommand", () => {

319319

error: "Agent prompt guidance must be an array of strings",

320320

},

321321

},

322+

{

323+

name: "rejects invalid channel scopes",

324+

command: {

325+

name: "demo",

326+

description: "Demo",

327+

channels: ["telegram", " "],

328+

handler: async () => ({ text: "ok" }),

329+

},

330+

expected: {

331+

ok: false,

332+

error: "Command channel 2 cannot be empty",

333+

},

334+

},

322335

] as const)("$name", ({ command, expected }) => {

323336

expect(registerPluginCommand("demo-plugin", command)).toEqual(expected);

324337

});

@@ -384,6 +397,31 @@ describe("registerPluginCommand", () => {

384397

]);

385398

});

386399400+

it("scopes plugin command matches and native specs to configured channels", () => {

401+

const result = registerVoiceCommandForTest({

402+

channels: [" Telegram "],

403+

description: "Demo command",

404+

});

405+406+

expect(result).toEqual({ ok: true });

407+

expect(matchPluginCommand("/voice", { channel: "telegram" })).toMatchObject({

408+

command: expect.objectContaining({

409+

name: "voice",

410+

channels: ["telegram"],

411+

}),

412+

});

413+

expect(matchPluginCommand("/voice", { channel: "discord" })).toBeNull();

414+

expect(matchPluginCommand("/voice")).toMatchObject({

415+

command: expect.objectContaining({ name: "voice" }),

416+

});

417+

expectProviderCommandSpecCases([

418+

{ provider: undefined, expectedNames: ["voice"] },

419+

{ provider: "telegram", expectedNames: ["voice"] },

420+

{ provider: "discord", expectedNames: [] },

421+

]);

422+

expect(listProviderPluginCommandSpecs("discord")).toEqual([]);

423+

});

424+387425

it("allows Slack to resolve provider-native plugin specs without changing shared native gating", () => {

388426

const result = registerVoiceCommandForTest({

389427

nativeNames: {

@@ -570,6 +608,31 @@ describe("registerPluginCommand", () => {

570608

expect(observedOwnerStatus).toBeUndefined();

571609

});

572610611+

it("skips direct plugin command execution on unsupported channels", async () => {

612+

let handlerCalled = false;

613+

const handler = async () => {

614+

handlerCalled = true;

615+

return { text: "ok" };

616+

};

617+618+

const result = await executePluginCommand({

619+

command: {

620+

name: "voice",

621+

description: "Voice command",

622+

channels: ["qqbot"],

623+

handler,

624+

pluginId: "demo-plugin",

625+

},

626+

channel: "discord",

627+

isAuthorizedSender: true,

628+

commandBody: "/voice",

629+

config: {},

630+

});

631+632+

expect(result).toEqual({ continueAgent: true });

633+

expect(handlerCalled).toBe(false);

634+

});

635+573636

it("does not allow direct reserved command registrations to claim owner status", () => {

574637

const result = registerPluginCommand(

575638

"codex",