惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
腾讯CDC
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
博客园_首页
D
DataBreaches.Net
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
月光博客
月光博客
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Vercel News
Vercel News
WordPress大学
WordPress大学
J
Java Code Geeks
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: preserve sandbox skill overlay precedence (#85591) ·...
steipete · 2026-05-24 · via Recent Commits to openclaw:main

@@ -1,6 +1,9 @@

11

import { EventEmitter } from "node:events";

2+

import fs from "node:fs";

3+

import os from "node:os";

4+

import path from "node:path";

25

import { Readable } from "node:stream";

3-

import { beforeEach, describe, expect, it, vi } from "vitest";

6+

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

47

import {

58

computeSandboxConfigHash,

69

SANDBOX_DOCKER_EXPLICIT_ENV_POLICY_EPOCH,

@@ -32,6 +35,14 @@ const registryMocks = vi.hoisted(() => ({

3235

updateRegistry: vi.fn(),

3336

}));

343738+

const tmpDirs: string[] = [];

39+40+

function makeTempDir(): string {

41+

const dir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docker-mounts-"));

42+

tmpDirs.push(dir);

43+

return dir;

44+

}

45+3546

vi.mock("./registry.js", () => ({

3647

readRegistryEntry: registryMocks.readRegistryEntry,

3748

updateRegistry: registryMocks.updateRegistry,

@@ -184,6 +195,12 @@ async function ensureSandboxCreateCallForTest(params: {

184195

}

185196186197

describe("ensureSandboxContainer config-hash recreation", () => {

198+

afterEach(() => {

199+

for (const dir of tmpDirs.splice(0)) {

200+

fs.rmSync(dir, { recursive: true, force: true });

201+

}

202+

});

203+187204

beforeEach(async () => {

188205

spawnState.calls.length = 0;

189206

spawnState.inspectRunning = true;

@@ -205,13 +222,15 @@ describe("ensureSandboxContainer config-hash recreation", () => {

205222

workspaceDir,

206223

agentWorkspaceDir: workspaceDir,

207224

mountFormatVersion: SANDBOX_MOUNT_FORMAT_VERSION,

225+

readOnlyWorkspaceSkillMounts: [],

208226

});

209227

const newHash = computeSandboxConfigHash({

210228

docker: newCfg.docker,

211229

workspaceAccess: newCfg.workspaceAccess,

212230

workspaceDir,

213231

agentWorkspaceDir: workspaceDir,

214232

mountFormatVersion: SANDBOX_MOUNT_FORMAT_VERSION,

233+

readOnlyWorkspaceSkillMounts: [],

215234

});

216235

expect(newHash).not.toBe(oldHash);

217236

@@ -263,6 +282,7 @@ describe("ensureSandboxContainer config-hash recreation", () => {

263282

workspaceDir,

264283

agentWorkspaceDir: workspaceDir,

265284

mountFormatVersion: SANDBOX_MOUNT_FORMAT_VERSION,

285+

readOnlyWorkspaceSkillMounts: [],

266286

});

267287

const newHash = computeSandboxConfigHash({

268288

docker: cfg.docker,

@@ -271,6 +291,7 @@ describe("ensureSandboxContainer config-hash recreation", () => {

271291

workspaceDir,

272292

agentWorkspaceDir: workspaceDir,

273293

mountFormatVersion: SANDBOX_MOUNT_FORMAT_VERSION,

294+

readOnlyWorkspaceSkillMounts: [],

274295

});

275296

expect(newHash).not.toBe(oldHash);

276297

@@ -307,6 +328,7 @@ describe("ensureSandboxContainer config-hash recreation", () => {

307328

workspaceDir,

308329

agentWorkspaceDir: workspaceDir,

309330

mountFormatVersion: SANDBOX_MOUNT_FORMAT_VERSION,

331+

readOnlyWorkspaceSkillMounts: [],

310332

});

311333312334

spawnState.inspectRunning = false;

@@ -330,6 +352,38 @@ describe("ensureSandboxContainer config-hash recreation", () => {

330352

expect(customMountIdx).toBeGreaterThan(workspaceMountIdx);

331353

});

332354355+

it("applies read-only skill overlays after custom binds", async () => {

356+

const workspaceDir = makeTempDir();

357+

const customRoot = makeTempDir();

358+

fs.mkdirSync(path.join(workspaceDir, "skills", "demo"), { recursive: true });

359+

fs.mkdirSync(customRoot, { recursive: true });

360+

const cfg = createSandboxConfig([], [`${customRoot}:/workspace/skills:rw`]);

361+

cfg.docker.dangerouslyAllowExternalBindSources = true;

362+363+

spawnState.inspectRunning = false;

364+

spawnState.labelHash = "stale-hash";

365+

registryMocks.readRegistryEntry.mockResolvedValue({

366+

containerName: "oc-test-shared",

367+

sessionKey: "shared",

368+

createdAtMs: 1,

369+

lastUsedAtMs: 0,

370+

image: cfg.docker.image,

371+

configHash: "stale-hash",

372+

});

373+374+

const createCall = await ensureSandboxCreateCallForTest({ cfg, workspaceDir });

375+

const bindArgs = collectDockerFlagValues(createCall.args, "-v");

376+

const workspaceMountIdx = bindArgs.indexOf(`${workspaceDir}:/workspace:z`);

377+

const customMountIdx = bindArgs.indexOf(`${customRoot}:/workspace/skills:rw`);

378+

const protectedMountIdx = bindArgs.indexOf(

379+

`${path.join(workspaceDir, "skills")}:/workspace/skills:ro,z`,

380+

);

381+382+

expect(workspaceMountIdx).toBeGreaterThanOrEqual(0);

383+

expect(customMountIdx).toBeGreaterThan(workspaceMountIdx);

384+

expect(protectedMountIdx).toBeGreaterThan(customMountIdx);

385+

});

386+333387

it.each([

334388

{ workspaceAccess: "rw" as const, expectedMainMount: "/tmp/workspace:/workspace:z" },

335389

{ workspaceAccess: "ro" as const, expectedMainMount: "/tmp/workspace:/workspace:ro,z" },