























@@ -28,7 +28,10 @@ import {
2828resolveCodexAppServerHomeDir,
2929} from "./auth-bridge.js";
3030import { readCodexPluginConfig, resolveCodexAppServerRuntimeOptions } from "./config.js";
31-import { CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE } from "./dynamic-tools.js";
31+import {
32+CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE,
33+createCodexDynamicToolBridge,
34+} from "./dynamic-tools.js";
3235import * as elicitationBridge from "./elicitation-bridge.js";
3336import type { CodexServerNotification } from "./protocol.js";
3437import { rememberCodexRateLimits, resetCodexRateLimitCacheForTests } from "./rate-limit-cache.js";
@@ -633,6 +636,44 @@ describe("runCodexAppServerAttempt", () => {
633636}
634637});
635638639+it("does not expose OpenClaw Tool Search controls through Codex dynamic tools", async () => {
640+const sessionFile = path.join(tempDir, "session.jsonl");
641+const workspaceDir = path.join(tempDir, "workspace");
642+const params = createParams(sessionFile, workspaceDir);
643+params.disableTools = false;
644+params.config = {
645+tools: {
646+toolSearch: true,
647+},
648+};
649+const sandboxSessionKey = params.sessionKey;
650+if (!sandboxSessionKey) {
651+throw new Error("createParams must provide a sessionKey for Codex dynamic tool tests.");
652+}
653+654+const tools = await __testing.buildDynamicTools({
655+ params,
656+resolvedWorkspace: workspaceDir,
657+effectiveWorkspace: workspaceDir,
658+ sandboxSessionKey,
659+sandbox: null as never,
660+runAbortController: new AbortController(),
661+sessionAgentId: "main",
662+pluginConfig: {},
663+onYieldDetected: () => undefined,
664+});
665+const bridge = createCodexDynamicToolBridge({
666+ tools,
667+signal: new AbortController().signal,
668+loading: "searchable",
669+});
670+const dynamicToolNames = bridge.specs.map((tool) => tool.name);
671+672+expect(dynamicToolNames).not.toEqual(
673+expect.arrayContaining(["tool_search_code", "tool_search", "tool_describe", "tool_call"]),
674+);
675+});
676+636677it("normalizes Codex dynamic toolsAllow entries before filtering", () => {
637678const tools = ["exec", "apply_patch", "read", "message"].map((name) => ({ name }));
638679此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。