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

推荐订阅源

小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
J
Java Code Geeks
A
About on SuperTechFans
F
Fortinet All Blogs
B
Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园_首页
博客园 - 叶小钗
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
云风的 BLOG
云风的 BLOG

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(voice-call): scope call control gateway methods · ope...
scoootscooob · 2026-05-04 · via Recent Commits to openclaw:main

@@ -29,6 +29,7 @@ const callGatewayFromCliMock = vi.fn();

29293030

type Registered = {

3131

methods: Map<string, unknown>;

32+

methodScopes: Map<string, string | undefined>;

3233

tools: unknown[];

3334

service?: Parameters<OpenClawPluginApi["registerService"]>[0];

3435

};

@@ -108,6 +109,7 @@ function createServiceContext(): Parameters<NonNullable<Registered["service"]>["

108109109110

function setup(config: Record<string, unknown>): Registered {

110111

const methods = new Map<string, unknown>();

112+

const methodScopes = new Map<string, string | undefined>();

111113

const tools: unknown[] = [];

112114

let service: Registered["service"];

113115

const api = createTestPluginApi({

@@ -120,7 +122,10 @@ function setup(config: Record<string, unknown>): Registered {

120122

pluginConfig: config,

121123

runtime: { tts: { textToSpeechTelephony: vi.fn() } } as unknown as OpenClawPluginApi["runtime"],

122124

logger: noopLogger,

123-

registerGatewayMethod: (method: string, handler: unknown) => methods.set(method, handler),

125+

registerGatewayMethod: (method: string, handler: unknown, opts?: { scope?: string }) => {

126+

methods.set(method, handler);

127+

methodScopes.set(method, opts?.scope);

128+

},

124129

registerTool: (tool: unknown) => tools.push(tool),

125130

registerCli: () => {},

126131

registerService: (registeredService) => {

@@ -129,7 +134,7 @@ function setup(config: Record<string, unknown>): Registered {

129134

resolvePath: (p: string) => p,

130135

});

131136

plugin.register(api);

132-

return { methods, tools, service };

137+

return { methods, methodScopes, tools, service };

133138

}

134139135140

function envRef(id: string) {

@@ -363,6 +368,24 @@ describe("voice-call plugin", () => {

363368

expect(payload.callId).toBe("call-1");

364369

});

365370371+

it("registers voice call gateway methods with least-privilege scopes", () => {

372+

const { methodScopes } = setup({ provider: "mock" });

373+374+

for (const method of [

375+

"voicecall.initiate",

376+

"voicecall.start",

377+

"voicecall.continue",

378+

"voicecall.continue.start",

379+

"voicecall.speak",

380+

"voicecall.dtmf",

381+

"voicecall.end",

382+

]) {

383+

expect(methodScopes.get(method)).toBe("operator.write");

384+

}

385+

expect(methodScopes.get("voicecall.continue.result")).toBe("operator.read");

386+

expect(methodScopes.get("voicecall.status")).toBe("operator.read");

387+

});

388+366389

it("preserves mode on legacy voicecall.start", async () => {

367390

const { methods } = setup({ provider: "mock" });

368391

const handler = methods.get("voicecall.start") as