






















@@ -393,6 +393,7 @@ function createThreadLifecycleAppServerOptions(): Parameters<
393393approvalPolicy: "never",
394394approvalsReviewer: "user",
395395sandbox: "workspace-write",
396+codeModeOnly: false,
396397};
397398}
398399@@ -1164,7 +1165,7 @@ describe("runCodexAppServerAttempt", () => {
11641165expect(dynamicToolNames).toEqual(["message"]);
11651166});
116611671167-it("starts Codex threads with searchable OpenClaw dynamic tools by default", async () => {
1168+it("keeps searchable OpenClaw dynamic tools when code-mode-only is enabled", async () => {
11681169__testing.setOpenClawCodingToolsFactoryForTests(() => [
11691170createRuntimeDynamicTool("message"),
11701171createRuntimeDynamicTool("web_search"),
@@ -1180,16 +1181,9 @@ describe("runCodexAppServerAttempt", () => {
11801181params.disableTools = false;
11811182params.runtimePlan = createCodexRuntimePlanFixture();
11821183params.sourceReplyDeliveryMode = "message_tool_only";
1183-params.toolsAllow = [
1184-"message",
1185-"web_search",
1186-"heartbeat_respond",
1187-"sessions_spawn",
1188-"sessions_yield",
1189-];
1190118411911185const run = runCodexAppServerAttempt(params, {
1192-pluginConfig: { appServer: { mode: "yolo" } },
1186+pluginConfig: { appServer: { mode: "yolo", codeModeOnly: true } },
11931187});
11941188await harness.waitForMethod("turn/start", 120_000);
11951189await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });
@@ -1199,6 +1193,8 @@ describe("runCodexAppServerAttempt", () => {
11991193const dynamicTools =
12001194(startRequest?.params as { dynamicTools?: Array<Record<string, unknown>> } | undefined)
12011195?.dynamicTools ?? [];
1196+const startConfig = (startRequest?.params as { config?: Record<string, unknown> } | undefined)
1197+?.config;
12021198const message = dynamicTools.find((tool) => tool.name === "message");
12031199const webSearch = dynamicTools.find((tool) => tool.name === "web_search");
12041200const heartbeat = dynamicTools.find((tool) => tool.name === "heartbeat_respond");
@@ -1215,6 +1211,8 @@ describe("runCodexAppServerAttempt", () => {
12151211expect(sessionsSpawn?.deferLoading).toBe(true);
12161212expect(sessionsYield).not.toHaveProperty("namespace");
12171213expect(sessionsYield).not.toHaveProperty("deferLoading");
1214+expect(startConfig?.["features.code_mode"]).toBe(true);
1215+expect(startConfig?.["features.code_mode_only"]).toBe(true);
12181216});
1219121712201218it("disables Codex native tool surfaces when runtime toolsAllow is empty", async () => {
@@ -8349,6 +8347,7 @@ describe("runCodexAppServerAttempt", () => {
83498347args: ["app-server", "--listen", "stdio://"],
83508348headers: {},
83518349},
8350+codeModeOnly: false,
83528351requestTimeoutMs: 60_000,
83538352turnCompletionIdleTimeoutMs: 60_000,
83548353approvalPolicy: "on-request" as const,
@@ -8465,6 +8464,7 @@ describe("runCodexAppServerAttempt", () => {
84658464args: ["app-server"],
84668465headers: {},
84678466},
8467+codeModeOnly: false,
84688468requestTimeoutMs: 60_000,
84698469turnCompletionIdleTimeoutMs: 60_000,
84708470approvalPolicy: "never",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。