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

推荐订阅源

博客园 - Franky
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
人人都是产品经理
人人都是产品经理
罗磊的独立博客
博客园 - 聂微东
雷峰网
雷峰网
量子位
美团技术团队
V
V2EX
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
The Cloudflare Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Jina AI
Jina AI

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
docs: document sandbox runtime tests · openclaw/openclaw@...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies runtime plugin loading can reuse a compatible gateway startup registry.

12

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

23

import { createEmptyPluginRegistry } from "../plugins/registry-empty.js";

34

import type { PluginRegistry } from "../plugins/registry-types.js";

@@ -27,6 +28,7 @@ const [{ ensureRuntimePluginsLoaded }, { clearPluginLoaderCache, testing }] = aw

2728

]);

2829
2930

function createRegistryWithPlugin(pluginId: string): PluginRegistry {

31+

// Minimal active registry carrying just enough plugin identity for reuse checks.

3032

const registry = createEmptyPluginRegistry();

3133

registry.plugins.push({

3234

id: pluginId,

@@ -47,6 +49,7 @@ afterEach(() => {

4749
4850

describe("ensureRuntimePluginsLoaded registry reuse", () => {

4951

it("reuses the compatible gateway startup registry on the dispatch caller path", () => {

52+

// Matching cache key plus gateway-bindable mode means no second plugin load.

5053

const config = { plugins: { allow: ["telegram"] } };

5154

const activeRegistry = createRegistryWithPlugin("telegram");

5255

activeRegistry.coreGatewayMethodNames = ["sessions.get", "sessions.list"];

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies runtime plugin loading scope, disablement, and gateway-bindable mode.

12

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

23
34

const hoisted = vi.hoisted(() => ({

@@ -26,6 +27,7 @@ describe("ensureRuntimePluginsLoaded", () => {

2627

let ensureRuntimePluginsLoaded: typeof import("./runtime-plugins.js").ensureRuntimePluginsLoaded;

2728
2829

beforeEach(async () => {

30+

// Reset modules so each case sees fresh mocked runtime-plugin dependencies.

2931

hoisted.getCurrentPluginMetadataSnapshot.mockReset();

3032

hoisted.getCurrentPluginMetadataSnapshot.mockReturnValue(undefined);

3133

hoisted.ensureStandaloneRuntimePluginRegistryLoaded.mockReset();

@@ -85,6 +87,7 @@ describe("ensureRuntimePluginsLoaded", () => {

8587

});

8688
8789

it("scopes runtime plugin loading to the current gateway startup plan", () => {

90+

// Startup metadata narrows runtime loading to plugins already planned for gateway startup.

8891

const config = {} as never;

8992

hoisted.getCurrentPluginMetadataSnapshot.mockReturnValue({

9093

startup: {

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies agent-specific sandbox config, workspace roots, and Docker setup commands.

12

import { EventEmitter } from "node:events";

23

import path from "node:path";

34

import { Readable } from "node:stream";

@@ -14,6 +15,7 @@ const spawnCalls: SpawnCall[] = [];

1415
1516

vi.mock("node:child_process", () => ({

1617

execFile: (...args: unknown[]) => {

18+

// Docker availability probes should succeed without invoking real Docker.

1719

const callback = args.findLast(

1820

(arg): arg is (error: null, stdout: string, stderr: string) => void =>

1921

typeof arg === "function",

@@ -55,6 +57,7 @@ let resolveSandboxConfigForAgent: typeof import("./sandbox/config.js").resolveSa

5557

let resolveSandboxRuntimeStatus: typeof import("./sandbox/runtime-status.js").resolveSandboxRuntimeStatus;

5658
5759

async function resolveContext(config: OpenClawConfig, sessionKey: string, workspaceDir: string) {

60+

// Convenience wrapper keeps session-key specific sandbox context assertions compact.

5861

return resolveSandboxContext({

5962

config,

6063

sessionKey,

@@ -63,6 +66,7 @@ async function resolveContext(config: OpenClawConfig, sessionKey: string, worksp

6366

}

6467
6568

function expectDockerSetupCommand(command: string) {

69+

// Setup commands are executed through docker exec in the resolved container.

6670

expect(

6771

spawnCalls.some(

6872

(call) =>

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies Docker create arguments for sandbox hardening and configured passthrough.

12

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

23

import { OPENCLAW_CLI_ENV_VALUE } from "../infra/openclaw-exec-env.js";

34

import { buildSandboxCreateArgs } from "./sandbox/docker.js";

@@ -8,6 +9,7 @@ describe("buildSandboxCreateArgs", () => {

89

overrides: Partial<SandboxDockerConfig> = {},

910

binds?: string[],

1011

): SandboxDockerConfig {

12+

// Baseline config keeps each Docker argument case focused on one override.

1113

return {

1214

image: "openclaw-sandbox:bookworm-slim",

1315

containerPrefix: "openclaw-sbx-",

@@ -39,6 +41,7 @@ describe("buildSandboxCreateArgs", () => {

3941

}

4042
4143

function valuesForFlag(args: string[], flag: string): string[] {

44+

// Docker flags are positional, so collect repeated flag values for assertions.

4245

const values: string[] = [];

4346

for (let i = 0; i < args.length; i += 1) {

4447

if (args[i] === flag) {

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies sandbox tool-policy resolution and blocked-tool explanation text.

12

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

23

import type { OpenClawConfig } from "../config/config.js";

34

import { resolveSandboxConfigForAgent } from "./sandbox/config.js";

@@ -10,6 +11,7 @@ const { toolPolicyAuditInfo } = vi.hoisted(() => ({

1011
1112

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

1213

createSubsystemLogger: () => ({

14+

// Audit logging is asserted without touching the real subsystem logger.

1315

info: toolPolicyAuditInfo,

1416

}),

1517

}));

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,4 @@

1+

// Verifies sandbox media paths resolve through bridge and workspace-only guards.

12

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

23

import {

34

createSandboxBridgeReadFile,

@@ -44,6 +45,7 @@ describe("createSandboxBridgeReadFile", () => {

4445

});

4546
4647

it("keeps workspace-only container paths under the sandbox workspace mount", async () => {

48+

// Container paths must stay inside the remote workspace mount when workspaceOnly is set.

4749

const resolvePath = vi.fn(({ filePath }: { filePath: string }) => {

4850

if (filePath === "/tmp/sandbox-root") {

4951

return {