





























@@ -1,8 +1,14 @@
1-import { describe, expect, it } from "vitest";
1+import { describe, expect, it, vi } from "vitest";
22import type { OpenClawConfig } from "../config/config.js";
33import { registerSandboxBackend } from "./sandbox/backend.js";
44import { ensureSandboxWorkspaceForSession, resolveSandboxContext } from "./sandbox/context.js";
556+const updateRegistryMock = vi.hoisted(() => vi.fn());
7+8+vi.mock("./sandbox/registry.js", () => ({
9+updateRegistry: updateRegistryMock,
10+}));
11+612describe("resolveSandboxContext", () => {
713it("does not sandbox the agent main session in non-main mode", async () => {
814const cfg: OpenClawConfig = {
@@ -111,6 +117,7 @@ describe("resolveSandboxContext", () => {
111117mode: "all",
112118backend: "test-backend",
113119scope: "session",
120+workspaceAccess: "rw",
114121prune: { idleHours: 0, maxAgeDays: 0 },
115122},
116123},
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。