Skip to content

Commit 8a927e0

Browse files
Copilotdata-douser
andauthored
fix: filter managed CLI flags from additionalArgs to prevent conflicts with post-processing
For tools with post-execution processing (query run, test run, database analyze), flags like --logdir, --evaluator-log, --output, --verbosity, and --tuple-counting are set internally and read back after execution. If these appear in additionalArgs, they would create conflicting duplicates and break post-processing. Now they are filtered out with a warning directing the user to use the corresponding named parameter. Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/dd017a82-a805-40c8-bb2f-4eae0678766d Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent 25c5341 commit 8a927e0

File tree

4 files changed

+103
-4
lines changed

4 files changed

+103
-4
lines changed

server/dist/codeql-development-mcp-server.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57338,8 +57338,25 @@ function registerCLITool(server, definition) {
5733857338
mkdirSync5(outputDir, { recursive: true });
5733957339
}
5734057340
}
57341-
const userAdditionalArgs = Array.isArray(options.additionalArgs) ? options.additionalArgs : [];
57341+
const rawAdditionalArgs = Array.isArray(options.additionalArgs) ? options.additionalArgs : [];
5734257342
delete options.additionalArgs;
57343+
const managedFlagNames = /* @__PURE__ */ new Set([
57344+
"evaluator-log",
57345+
"logdir",
57346+
"output",
57347+
"tuple-counting",
57348+
"verbosity"
57349+
]);
57350+
const userAdditionalArgs = queryLogDir ? rawAdditionalArgs.filter((arg) => {
57351+
const m = arg.match(/^--(?:no-)?([^=]+)/);
57352+
if (m && managedFlagNames.has(m[1])) {
57353+
logger.warn(
57354+
`Ignoring "${arg}" from additionalArgs for ${name}: this flag is managed internally. Use the corresponding named parameter instead.`
57355+
);
57356+
return false;
57357+
}
57358+
return true;
57359+
}) : rawAdditionalArgs;
5734357360
let result;
5734457361
if (command === "codeql") {
5734557362
let cwd;

0 commit comments

Comments
 (0)