feat(core): add tool sandboxing setting and initialization

- Add `tools.sandboxing` boolean flag to `settingsSchema.ts` to control whether tools are executed within a sandbox.
- Introduce `createSandboxManager` factory function that returns either `LocalSandboxManager` or `NoopSandboxManager` based on the new setting.
- Update `Config` initialization to read the setting and construct the appropriate sandbox manager.
- Update unit tests to reflect the new initialization and instantiation behavior.
This commit is contained in:
galz10
2026-03-12 11:43:53 -07:00
parent 002a57efeb
commit 52fb019698
5 changed files with 36 additions and 4 deletions

View File

@@ -699,6 +699,7 @@ export async function loadCliConfig(
clientVersion: await getVersion(),
embeddingModel: DEFAULT_GEMINI_EMBEDDING_MODEL,
sandbox: sandboxConfig,
toolSandboxing: settings.tools?.sandboxing ?? false,
targetDir: cwd,
includeDirectoryTree,
includeDirectories,

View File

@@ -1247,6 +1247,15 @@ const SETTINGS_SCHEMA = {
description: 'Settings for built-in and custom tools.',
showInDialog: false,
properties: {
sandboxing: {
type: 'boolean',
label: 'Tool Sandboxing',
category: 'Tools',
requiresRestart: false,
default: false,
description: 'Enable sandboxing for tool execution.',
showInDialog: true,
},
sandbox: {
type: 'string',
label: 'Sandbox',