fix(tools): gate generate_image behind setting and tool whitelist

generate_image was registered as a custom tool and force-activated via the alwaysInclude list in createAgentSession, so it survived --no-tools (empty toolNames) and any explicit whitelist that omitted it. There was also no generate_image.enabled setting, so /settings had no toggle.

Add a generate_image.enabled setting and only register the tool when enabled and either no whitelist is given or it names generate_image.

Fixes #5305
This commit is contained in:
roboomp
2026-07-14 18:06:10 +00:00
parent 01d3fc9b6b
commit 5878ed8f49
4 changed files with 105 additions and 4 deletions
@@ -3528,6 +3528,16 @@ export const SETTINGS_SCHEMA = {
description: "Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis",
},
},
"generate_image.enabled": {
type: "boolean",
default: true,
ui: {
tab: "tools",
group: "Available Tools",
label: "Generate Image",
description: "Enable the generate_image tool for text-to-image generation and editing",
},
},
"inspect_image.enabled": {
type: "boolean",