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

推荐订阅源

V
Visual Studio Blog
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
L
LangChain Blog
美团技术团队
N
Netflix TechBlog - Medium
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
博客园 - 司徒正美
爱范儿
爱范儿
D
DataBreaches.Net
月光博客
月光博客
U
Unit 42
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
MongoDB | Blog
MongoDB | Blog
腾讯CDC

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
test(codex): avoid full sandbox run in thread-start test ...
steipete · 2026-05-24 · via Recent Commits to openclaw:main

@@ -1170,72 +1170,69 @@ describe("runCodexAppServerAttempt", () => {

11701170

);

11711171

});

117211721173-

it("starts active OpenClaw sandbox turns with Codex native execution disabled", async () => {

1174-

const runtimeId = `codex-test-runtime-${path.basename(tempDir)}`;

1175-

const restoreSandboxBackend = registerSandboxBackend("codex-test-sandbox", async () => ({

1176-

id: "codex-test-sandbox",

1177-

runtimeId,

1178-

runtimeLabel: "Codex Test Sandbox",

1179-

workdir: "/workspace",

1180-

buildExecSpec: async () => ({

1181-

argv: ["true"],

1182-

env: {},

1183-

stdinMode: "pipe-closed" as const,

1184-

}),

1185-

runShellCommand: async () => ({

1186-

stdout: Buffer.alloc(0),

1187-

stderr: Buffer.alloc(0),

1188-

code: 0,

1189-

}),

1190-

}));

1191-

try {

1192-

testing.setOpenClawCodingToolsFactoryForTests(() => [

1193-

createRuntimeDynamicTool("exec"),

1194-

createRuntimeDynamicTool("process"),

1195-

createRuntimeDynamicTool("message"),

1196-

]);

1197-

const sessionFile = path.join(tempDir, "session.jsonl");

1198-

const workspaceDir = path.join(tempDir, "workspace");

1199-

const params = createParams(sessionFile, workspaceDir);

1200-

params.disableTools = false;

1201-

params.runtimePlan = createCodexRuntimePlanFixture();

1202-

params.config = {

1203-

agents: {

1204-

defaults: {

1205-

sandbox: {

1206-

mode: "all",

1207-

backend: "codex-test-sandbox",

1208-

scope: "session",

1209-

workspaceAccess: "rw",

1210-

prune: { idleHours: 0, maxAgeDays: 0 },

1211-

},

1212-

},

1213-

},

1214-

} as never;

1215-

const { requests } = createStartedThreadHarness(async (method) =>

1216-

method === "turn/start" ? turnStartResult("turn-1", "completed") : undefined,

1217-

);

1173+

it("starts active OpenClaw sandbox threads with Codex native execution disabled", async () => {

1174+

testing.setOpenClawCodingToolsFactoryForTests(() => [

1175+

createRuntimeDynamicTool("exec"),

1176+

createRuntimeDynamicTool("process"),

1177+

createRuntimeDynamicTool("message"),

1178+

]);

1179+

const sessionFile = path.join(tempDir, "session.jsonl");

1180+

const workspaceDir = path.join(tempDir, "workspace");

1181+

const params = createParams(sessionFile, workspaceDir);

1182+

params.disableTools = false;

1183+

params.runtimePlan = createCodexRuntimePlanFixture();

1184+

const sandbox = {

1185+

enabled: true,

1186+

backendId: "codex-test-sandbox",

1187+

workspaceAccess: "rw",

1188+

} as never;

1189+

const nativeToolSurfaceEnabled = testing.shouldEnableCodexAppServerNativeToolSurface(

1190+

params,

1191+

sandbox,

1192+

);

1193+

const dynamicTools = await testing.buildDynamicTools({

1194+

params,

1195+

resolvedWorkspace: workspaceDir,

1196+

effectiveWorkspace: workspaceDir,

1197+

sandboxSessionKey: params.sessionKey!,

1198+

sandbox,

1199+

nativeToolSurfaceEnabled,

1200+

runAbortController: new AbortController(),

1201+

sessionAgentId: "main",

1202+

pluginConfig: {},

1203+

onYieldDetected: () => undefined,

1204+

});

1205+

const request = vi.fn(async (method: string) => {

1206+

if (method === "thread/start") {

1207+

return threadStartResult();

1208+

}

1209+

throw new Error(`unexpected method: ${method}`);

1210+

});

121812111219-

const run = runCodexAppServerAttempt(params, {

1220-

pluginConfig: { appServer: { mode: "yolo" } },

1221-

});

1222-

await run;

1212+

await startOrResumeThread({

1213+

client: { request } as never,

1214+

params,

1215+

cwd: workspaceDir,

1216+

dynamicTools: dynamicTools as never,

1217+

appServer: createThreadLifecycleAppServerOptions(),

1218+

nativeCodeModeEnabled: nativeToolSurfaceEnabled,

1219+

nativeCodeModeOnlyEnabled: false,

1220+

userMcpServersEnabled: nativeToolSurfaceEnabled,

1221+

environmentSelection: [],

1222+

});

122312231224-

const startRequest = requests.find((request) => request.method === "thread/start");

1225-

const startParams = startRequest?.params as Record<string, unknown> | undefined;

1226-

const startConfig = startParams?.config as Record<string, unknown> | undefined;

1227-

const dynamicTools = startParams?.dynamicTools as Array<{ name: string }> | undefined;

1228-

expect(startConfig?.["features.code_mode"]).toBe(false);

1229-

expect(startConfig?.["features.code_mode_only"]).toBe(false);

1230-

expect(startParams?.environments).toEqual([]);

1231-

expect(dynamicTools?.map((tool) => tool.name)).toEqual([

1232-

"message",

1233-

"sandbox_exec",

1234-

"sandbox_process",

1235-

]);

1236-

} finally {

1237-

restoreSandboxBackend();

1238-

}

1224+

const startRequest = request.mock.calls.find(([method]) => method === "thread/start");

1225+

const startParams = startRequest?.[1] as Record<string, unknown> | undefined;

1226+

const startConfig = startParams?.config as Record<string, unknown> | undefined;

1227+

const startDynamicTools = startParams?.dynamicTools as Array<{ name: string }> | undefined;

1228+

expect(startConfig?.["features.code_mode"]).toBe(false);

1229+

expect(startConfig?.["features.code_mode_only"]).toBe(false);

1230+

expect(startParams?.environments).toEqual([]);

1231+

expect(startDynamicTools?.map((tool) => tool.name)).toEqual([

1232+

"message",

1233+

"sandbox_exec",

1234+

"sandbox_process",

1235+

]);

12391236

});

1240123712411238

it("routes native Codex execution through an OpenClaw sandbox exec-server when opted in", async () => {