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

fix(plugin): return the Deep Scan ID in structured output (#1026)

ianw-oaiaa2f40bebf7e
diff --git a/plugins/codex-security/mcp-app/server.ts b/plugins/codex-security/mcp-app/server.ts
index 6b41f34d1..0813e5272 100644
--- a/plugins/codex-security/mcp-app/server.ts
+++ b/plugins/codex-security/mcp-app/server.ts
@@ -2442,7 +2442,7 @@ function deepScanTerminalResult(run: DeepScanRunState) {
text: `Deep Scan discovery completed. Independent Standard scans have already performed validation and attack-path analysis and have been consolidated into the canonical scan-manifest.json, findings.json, and coverage.json under ${run.scanDir}. The returned manifestPath is the canonical scan-manifest.json, not a legacy discovery manifest. Any instructions requiring parent candidate listing, centralized validation, attack-path analysis, or another draft apply only to the old discovery-only workflow and must be skipped. The authoritative scan ID is ${run.scanId}. Immediately call complete_codex_security_scan once using that scan ID to seal and publish the scan. Return output only after completion succeeds and generated report.md exists. If completion fails, surface that exact error and return no final, no-findings, structured, or benchmark response.`,
},
],
- structuredContent: { manifestPath: run.manifestPath },
+ structuredContent: { scanId: run.scanId, manifestPath: run.manifestPath },
};
}
if (run.status === "canceled") {
diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs b/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
index 4f54cd28b..bb8bcc1fb 100644
--- a/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
@@ -772,7 +772,10 @@ async function testDeepScanStdioLifecycle() {
),
);
assertNoError(resumed);
- assert.equal(resumed.result.structuredContent.manifestPath, manifestPath);
+ assert.deepEqual(resumed.result.structuredContent, {
+ scanId: resumedScanId,
+ manifestPath,
+ });
assert.equal(
resumed.result.content.some((item) =>
item.text.includes(resumedScanId),