Fixes for codeql_query_compile MCP tool and dump-dil argument handling#243
Fixes for codeql_query_compile MCP tool and dump-dil argument handling#243data-douser merged 3 commits intonextfrom
codeql_query_compile MCP tool and dump-dil argument handling#243Conversation
Applies fixes and improves tests for codeql_query_compile MCP tool related to --dump-dil versus --no-dump-dil arg handling.
There was a problem hiding this comment.
Pull request overview
This pull request fixes codeql_query_compile handling of --dump-dil / --no-dump-dil so that flag precedence between the named dump-dil parameter and additionalArgs is deterministic (last flag in additionalArgs wins) and so the final CLI invocation avoids duplicate/conflicting flags.
Changes:
- Normalize
--dump-dil/--no-dump-dilfromadditionalArgsintooptions['dump-dil'], filter those flags from raw CLI args, and deriveeffectiveDumpDilEnabledfrom the normalized value. - Update/add unit tests to cover precedence, “last flag wins”, deduplication (filtering), and preservation of unrelated
additionalArgs. - Update the built
server/distJS artifact to reflect the source change.
Show a summary per file
| File | Description |
|---|---|
| server/src/lib/cli-tool-registry.ts | Implements dump-dil flag normalization/deduplication and fixes precedence ordering for codeql_query_compile. |
| server/test/src/lib/cli-tool-registry.test.ts | Expands assertions and adds new cases for dump-dil/no-dump-dil precedence and filtering behavior. |
| server/dist/codeql-development-mcp-server.js | Updates compiled distribution output for the registry change. |
Copilot's findings
- Files reviewed: 2/4 changed files
- Comments generated: 2
There was a problem hiding this comment.
Pull request overview
This PR fixes codeql_query_compile argument handling in the MCP server so that --dump-dil / --no-dump-dil are normalized consistently between the named dump-dil option and additionalArgs, with clear precedence and without forwarding duplicate/conflicting flags to the CodeQL CLI.
Changes:
- Normalize
--dump-dil/--no-dump-dilfromadditionalArgs(last flag wins) intooptions['dump-dil'], and filter both flags out of raw CLI args to prevent duplication. - Adjust existing unit tests to assert normalization into
options['dump-dil']and confirm flags are removed from positional/additional CLI args. - Add new unit tests covering precedence overrides, last-flag-wins behavior, filtering, and preservation of unrelated
additionalArgs.
Show a summary per file
| File | Description |
|---|---|
| server/src/lib/cli-tool-registry.ts | Implements last-flag-wins normalization for dump-dil flags and deduplicates them from raw CLI args for codeql_query_compile. |
| server/test/src/lib/cli-tool-registry.test.ts | Updates existing expectations and adds multiple tests to cover precedence, deduplication, and argument preservation. |
| server/dist/codeql-development-mcp-server.js | Updates the built artifact to reflect the registerCLITool dump-dil normalization changes. |
Copilot's findings
- Files reviewed: 2/4 changed files
- Comments generated: 1
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request fixes codeql_query_compile flag handling in the MCP server by normalizing and deduplicating --dump-dil / --no-dump-dil across the named dump-dil option and additionalArgs, with expanded unit tests to lock in precedence and filtering behavior.
Changes:
- Normalize
--dump-dil/--no-dump-dilfromadditionalArgsintooptions['dump-dil'](last flag wins) and remove both flags from raw CLI args to avoid duplication. - Compute the effective “dump-dil enabled” behavior from the normalized option value.
- Add/adjust unit tests to verify precedence, “last flag wins”, filtering behavior, and preservation of unrelated
additionalArgs.
Show a summary per file
| File | Description |
|---|---|
| server/src/lib/cli-tool-registry.ts | Normalizes dump-dil based on additionalArgs precedence and filters conflicting raw flags before execution. |
| server/test/src/lib/cli-tool-registry.test.ts | Updates existing expectations and adds focused tests for precedence, deduplication, and “last flag wins”. |
| server/dist/codeql-development-mcp-server.js | Regenerated build artifact reflecting the updated registry logic. |
Copilot's findings
- Files reviewed: 2/4 changed files
- Comments generated: 0 new
There was a problem hiding this comment.
Pull request overview
This pull request fixes codeql_query_compile argument handling in the MCP server so --dump-dil / --no-dump-dil supplied via additionalArgs are normalized, deduplicated, and correctly override the named dump-dil parameter, with expanded unit test coverage to prevent regressions.
Changes:
- Normalize
--dump-dil/--no-dump-dilfromadditionalArgsintooptions['dump-dil'](last flag wins) and filter both flags from raw CLI args to avoid duplicates. - Compute the effective DIL-enabled behavior from the normalized
options['dump-dil']after extracting/deletingadditionalArgs. - Update and add unit tests covering precedence, last-flag-wins behavior, filtering, and preservation of unrelated
additionalArgs.
Show a summary per file
| File | Description |
|---|---|
| server/src/lib/cli-tool-registry.ts | Implements normalized/precedence-aware dump-dil handling and removes duplicate CLI flags from additionalArgs. |
| server/test/src/lib/cli-tool-registry.test.ts | Updates existing assertions and adds comprehensive tests for precedence/deduplication behavior. |
| server/dist/codeql-development-mcp-server.js | Updates the committed built artifact to match the source behavior change. |
Copilot's findings
- Files reviewed: 2/4 changed files
- Comments generated: 0 new
…ing (#243) * Fixes for codeql_query_compile dump-dil Applies fixes and improves tests for codeql_query_compile MCP tool related to --dump-dil versus --no-dump-dil arg handling. * Address PR #243 review feedback * Update server/test/src/lib/cli-tool-registry.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> --------- Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replaces PR #241.
Summary of Changes
This pull request improves the handling of the
--dump-diland--no-dump-dilflags for thecodeql_query_compileCLI tool, ensuring that these flags are normalized and deduplicated between named parameters andadditionalArgs. It also adds comprehensive tests to verify this behavior, making the flag handling more predictable and robust.Outline of Changes
CLI flag normalization and precedence:
registerCLITool(cli-tool-registry.ts) so that forcodeql_query_compile, the last occurrence of--dump-dilor--no-dump-dilinadditionalArgsoverrides the nameddump-dilparameter, and the effective value is set inoptions['dump-dil']. Both flags are then filtered from the raw CLI arguments to prevent duplication.Test coverage improvements:
options['dump-dil']is set correctly and that neither--dump-dilnor--no-dump-dilare present in the final CLI arguments when handled. [1] [2]--dump-dilinadditionalArgsoverridesdump-dil: falseand vice versa.additionalArgsis respected.dump-dilarguments are preserved.