fix(sandbox): filter remote skill mounts by existing roots · openclaw/openclaw@dd5fb1e
jason-allen-
·
2026-05-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import fs from "node:fs"; |
1 | 2 | import path from "node:path"; |
2 | 3 | import { isPathInside } from "../../infra/path-guards.js"; |
3 | 4 | import type { |
@@ -563,7 +564,15 @@ function buildRemoteProtectedSkillMounts(params: {
|
563 | 564 | }, |
564 | 565 | ); |
565 | 566 | } |
566 | | -return mounts; |
| 567 | +return mounts.filter((mount) => isExistingDirectory(mount.localRoot)); |
| 568 | +} |
| 569 | + |
| 570 | +function isExistingDirectory(dir: string): boolean { |
| 571 | +try { |
| 572 | +return fs.statSync(dir).isDirectory(); |
| 573 | +} catch { |
| 574 | +return false; |
| 575 | +} |
567 | 576 | } |
568 | 577 | |
569 | 578 | function compareRemoteMountsByContainerPath(a: MountInfo, b: MountInfo): number { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。