mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:58:38 +00:00
refactor: share openclaw tool sandbox config
This commit is contained in:
@@ -87,15 +87,16 @@ export function createOpenClawTools(
|
|||||||
options?.spawnWorkspaceDir ?? options?.workspaceDir,
|
options?.spawnWorkspaceDir ?? options?.workspaceDir,
|
||||||
);
|
);
|
||||||
const runtimeWebTools = getActiveRuntimeWebToolsMetadata();
|
const runtimeWebTools = getActiveRuntimeWebToolsMetadata();
|
||||||
|
const sandbox =
|
||||||
|
options?.sandboxRoot && options?.sandboxFsBridge
|
||||||
|
? { root: options.sandboxRoot, bridge: options.sandboxFsBridge }
|
||||||
|
: undefined;
|
||||||
const imageTool = options?.agentDir?.trim()
|
const imageTool = options?.agentDir?.trim()
|
||||||
? createImageTool({
|
? createImageTool({
|
||||||
config: options?.config,
|
config: options?.config,
|
||||||
agentDir: options.agentDir,
|
agentDir: options.agentDir,
|
||||||
workspaceDir,
|
workspaceDir,
|
||||||
sandbox:
|
sandbox,
|
||||||
options?.sandboxRoot && options?.sandboxFsBridge
|
|
||||||
? { root: options.sandboxRoot, bridge: options.sandboxFsBridge }
|
|
||||||
: undefined,
|
|
||||||
fsPolicy: options?.fsPolicy,
|
fsPolicy: options?.fsPolicy,
|
||||||
modelHasVision: options?.modelHasVision,
|
modelHasVision: options?.modelHasVision,
|
||||||
})
|
})
|
||||||
@@ -105,10 +106,7 @@ export function createOpenClawTools(
|
|||||||
config: options?.config,
|
config: options?.config,
|
||||||
agentDir: options.agentDir,
|
agentDir: options.agentDir,
|
||||||
workspaceDir,
|
workspaceDir,
|
||||||
sandbox:
|
sandbox,
|
||||||
options?.sandboxRoot && options?.sandboxFsBridge
|
|
||||||
? { root: options.sandboxRoot, bridge: options.sandboxFsBridge }
|
|
||||||
: undefined,
|
|
||||||
fsPolicy: options?.fsPolicy,
|
fsPolicy: options?.fsPolicy,
|
||||||
})
|
})
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
Reference in New Issue
Block a user