

























@@ -1,3 +1,5 @@
1+// Sandbox browser creation tests cover Docker args, bridge auth, noVNC access,
2+// config hashing, and cached bridge invalidation.
13import { mkdirSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
24import os from "node:os";
35import path from "node:path";
@@ -290,6 +292,8 @@ describe("ensureSandboxBrowser create args", () => {
290292});
291293292294it("publishes noVNC on loopback and injects noVNC password env", async () => {
295+// noVNC password stays in the container environment; external access uses a
296+// short-lived observer token so URLs do not carry the password.
293297const result = await ensureTestSandboxBrowser({
294298scopeKey: "session:test",
295299workspaceDir: "/tmp/workspace",
@@ -327,6 +331,8 @@ describe("ensureSandboxBrowser create args", () => {
327331});
328332329333it("applies read-only skill overlays after browser custom binds", async () => {
334+// Browser sandboxes share workspace mount semantics with shell sandboxes:
335+// protected skill overlays must win over custom binds.
330336const workspaceDir = makeTempDir();
331337const customRoot = makeTempDir();
332338mkdirSync(path.join(workspaceDir, "skills", "demo"), { recursive: true });
@@ -610,6 +616,8 @@ describe("ensureSandboxBrowser create args", () => {
610616});
611617612618it("force-removes the browser container when CDP never becomes reachable", async () => {
619+// A browser container that starts but never exposes CDP is unusable; remove
620+// it immediately so the next attempt recreates from a clean state.
613621vi.spyOn(globalThis, "fetch").mockRejectedValue(new Error("timeout"));
614622bridgeMocks.startBrowserBridgeServer.mockImplementationOnce(async (params) => {
615623await params.onEnsureAttachTarget?.({});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。