Skip to content

Commit f35b909

Browse files
RainRain
authored andcommitted
fix(sandbox): reuse bind parser for allowedPaths in pi-tools
1 parent 04a156d commit f35b909

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/agents/pi-tools.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { OpenClawConfig } from "../config/config.js";
99
import type { ModelAuthMode } from "./model-auth.js";
1010
import type { AnyAgentTool } from "./pi-tools.types.js";
1111
import type { SandboxContext } from "./sandbox.js";
12+
import { parseBindMountHostPaths } from "./sandbox/fs-bridge.js";
1213
import { logWarn } from "../logger.js";
1314
import { getPluginToolMeta } from "../plugins/tools.js";
1415
import { isSubagentSessionKey } from "../routing/session-key.js";
@@ -238,9 +239,7 @@ export function createOpenClawCodingTools(options?: {
238239
const execConfig = resolveExecConfig({ cfg: options?.config, agentId });
239240
const sandboxRoot = sandbox?.workspaceDir;
240241
const sandboxFsBridge = sandbox?.fsBridge;
241-
const sandboxAllowedPaths = sandbox?.docker.binds
242-
?.map((b) => b.split(":")[0])
243-
.filter(Boolean);
242+
const sandboxAllowedPaths = parseBindMountHostPaths(sandbox?.docker.binds);
244243
const allowWorkspaceWrites = sandbox?.workspaceAccess !== "ro";
245244
const workspaceRoot = options?.workspaceDir ?? process.cwd();
246245
const applyPatchConfig = options?.config?.tools?.exec?.applyPatch;

0 commit comments

Comments
 (0)