Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(plugin): accept a detached MCP payload (#688)

soyeon-oai536895ca8f20
diff --git a/plugins/codex-security/mcp-app/tests/test_compact_artifact_server.mjs b/plugins/codex-security/mcp-app/tests/test_compact_artifact_server.mjs
index 810ea0b44..d1af7e3da 100644
--- a/plugins/codex-security/mcp-app/tests/test_compact_artifact_server.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_compact_artifact_server.mjs
@@ -14,10 +14,9 @@ const applicationRoot = path.resolve(
".."
);
const pluginRoot = path.resolve(applicationRoot, "..");
-const bundledPluginRoot = path.resolve(
- applicationRoot,
- "../../../sdk/typescript/_bundled_plugin"
-);
+const bundledPluginRoot = process.env.CODEX_SECURITY_TEST_PLUGIN_ROOT
+ ? path.resolve(process.env.CODEX_SECURITY_TEST_PLUGIN_ROOT)
+ : path.resolve(applicationRoot, "../../../sdk/typescript/_bundled_plugin");
const temporaryRoot = await mkdtemp(path.join(tmpdir(), "codex-security-artifact-mcp-"));
try {
diff --git a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
index d64d6ab51..b954b7100 100644
--- a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
@@ -18,10 +18,9 @@ const sourcePluginRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
"../..",
);
-const pluginRoot = path.resolve(
- sourcePluginRoot,
- "../../sdk/typescript/_bundled_plugin",
-);
+const pluginRoot = process.env.CODEX_SECURITY_TEST_PLUGIN_ROOT
+ ? path.resolve(process.env.CODEX_SECURITY_TEST_PLUGIN_ROOT)
+ : path.resolve(sourcePluginRoot, "../../sdk/typescript/_bundled_plugin");
const mcpAppRoot = path.join(sourcePluginRoot, "mcp-app");
const pluginManifest = JSON.parse(
await readFile(path.join(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"),