MCPcopy Create free account
hub / github.com/AI45Lab/Code / set_sandbox

Method set_sandbox

core/src/tools/registry.rs:181–184  ·  view source on GitHub ↗

Set a sandbox executor so that `bash` tool calls use the sandbox even when executed without an explicit `ToolContext` (i.e., via `execute()`).

(&self, sandbox: std::sync::Arc<dyn crate::sandbox::BashSandbox>)

Source from the content-addressed store, hash-verified

179 /// Set a sandbox executor so that `bash` tool calls use the sandbox even
180 /// when executed without an explicit `ToolContext` (i.e., via `execute()`).
181 pub fn set_sandbox(&self, sandbox: std::sync::Arc<dyn crate::sandbox::BashSandbox>) {
182 let mut ctx = self.context.write().unwrap();
183 *ctx = ctx.clone().with_sandbox(sandbox);
184 }
185
186 /// Set environment overrides used by subprocess-backed tools when executed
187 /// without an explicit context.

Callers 1

build_tool_contextFunction · 0.80

Calls 3

writeMethod · 0.80
with_sandboxMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected