mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:11:26 +00:00
fix: disable tts tool for voice provider
This commit is contained in:
@@ -217,6 +217,8 @@ export function createOpenClawCodingTools(options?: {
|
||||
/** Whether the sender is an owner (required for owner-only tools). */
|
||||
senderIsOwner?: boolean;
|
||||
}): AnyAgentTool[] {
|
||||
const rawMessageProvider = options?.messageProvider?.trim().toLowerCase();
|
||||
const isVoiceMessageProvider = rawMessageProvider === "voice";
|
||||
const execToolName = "exec";
|
||||
const sandbox = options?.sandbox?.enabled ? options.sandbox : undefined;
|
||||
const {
|
||||
@@ -480,9 +482,12 @@ export function createOpenClawCodingTools(options?: {
|
||||
senderIsOwner: options?.senderIsOwner,
|
||||
}),
|
||||
];
|
||||
const toolsForMessageProvider = isVoiceMessageProvider
|
||||
? tools.filter((tool) => tool.name !== "tts")
|
||||
: tools;
|
||||
// Security: treat unknown/undefined as unauthorized (opt-in, not opt-out)
|
||||
const senderIsOwner = options?.senderIsOwner === true;
|
||||
const toolsByAuthorization = applyOwnerOnlyToolPolicy(tools, senderIsOwner);
|
||||
const toolsByAuthorization = applyOwnerOnlyToolPolicy(toolsForMessageProvider, senderIsOwner);
|
||||
const subagentFiltered = applyToolPolicyPipeline({
|
||||
tools: toolsByAuthorization,
|
||||
toolMeta: (tool) => getPluginToolMeta(tool),
|
||||
|
||||
Reference in New Issue
Block a user