mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:54:58 +00:00
fix(tools): honor tools.fs.workspaceOnly=false for host write/edit (#28822)
Merged via squash.
Prepared head SHA: 83d432961d
Co-authored-by: lailoo <20536249+lailoo@users.noreply.github.com>
Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com>
Reviewed-by: @velvet-shark
This commit is contained in:
@@ -359,14 +359,14 @@ export function createOpenClawCodingTools(options?: {
|
||||
if (sandboxRoot) {
|
||||
return [];
|
||||
}
|
||||
const wrapped = createHostWorkspaceWriteTool(workspaceRoot);
|
||||
const wrapped = createHostWorkspaceWriteTool(workspaceRoot, { workspaceOnly });
|
||||
return [workspaceOnly ? wrapToolWorkspaceRootGuard(wrapped, workspaceRoot) : wrapped];
|
||||
}
|
||||
if (tool.name === "edit") {
|
||||
if (sandboxRoot) {
|
||||
return [];
|
||||
}
|
||||
const wrapped = createHostWorkspaceEditTool(workspaceRoot);
|
||||
const wrapped = createHostWorkspaceEditTool(workspaceRoot, { workspaceOnly });
|
||||
return [workspaceOnly ? wrapToolWorkspaceRootGuard(wrapped, workspaceRoot) : wrapped];
|
||||
}
|
||||
return [tool];
|
||||
|
||||
Reference in New Issue
Block a user