-
Notifications
You must be signed in to change notification settings - Fork 2
Improve prompt error handling and relative path support #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
data-douser
merged 27 commits into
main
from
dd/improve-error-handling-relative-path-support
Mar 24, 2026
Merged
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a85c51d
Initial plan
Copilot 7a9b15a
Add path resolution and error handling for prompt file path parameters
Copilot 20b083b
Address code review: add advisory comment on existsSync, improve test…
Copilot 53d6722
plan: add extension integration test for prompt error handling
Copilot 988bbd9
Add extension integration test for MCP prompt error handling with inv…
Copilot bb3f3ed
Initial plan
Copilot 905e4de
fix: return inline errors for invalid prompt inputs
data-douser 40c12a4
fix: promote key prompt parameters from optional to required
data-douser 178c4e5
Addres PR review feedback
data-douser cfc2586
Sync server/dist/codeql-development-mcp-server.js.map
data-douser 4ae4021
[UPDATE PRIMITIVE] Fix path traversal check, add prompt fixture runne…
Copilot 6c8a229
Apply suggestions from code review
data-douser e07ae1b
Enforce tidy and rebuild server dist
data-douser 24f76cc
address PR review comments for prompt path handling
data-douser 4df0b32
Merge branch 'main' into dd/improve-error-handling-relative-path-support
data-douser 8228a64
[WIP] Improve prompt error handling and relative path support (#157)
Copilot 197e9f8
More fixes for PR review feedback
data-douser dc90a69
Merge branch 'main' into dd/improve-error-handling-relative-path-support
data-douser 0db4c6d
Merge branch 'main' into dd/improve-error-handling-relative-path-support
data-douser 0c0a715
[UPDATE PRIMITIVE] Fix markdown injection and platform-dependent path…
Copilot 520a3cc
Add 'actions/cache@v5' for VS Code integration test download
data-douser 080790c
Address latest feedback for PR #153
data-douser 0b346ce
Add retries to download-vscode.js script
data-douser cb7387b
fix: resilient VS Code download for integration tests
data-douser 7f7356c
Address PR #153 review comments
data-douser ef7517c
Apply suggestions from code review
data-douser af3cca6
fix: address PR #153 review comments for path resolution
data-douser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...tion-tests/primitives/prompts/explain_codeql_query/invalid_query_path/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Integration Test: explain_codeql_query / invalid_query_path | ||
|
|
||
| ## Purpose | ||
|
|
||
| Verify that the `explain_codeql_query` prompt returns a helpful error message | ||
| when the user provides a `queryPath` that does not exist on disk. | ||
|
|
||
| ## Expected Behavior | ||
|
|
||
| - The prompt handler resolves the relative path against the workspace root. | ||
| - When the resolved path does not exist, the prompt returns a warning in the | ||
| response messages rather than throwing a raw MCP protocol error. | ||
| - The warning message should mention the file was not found so the user can | ||
| correct the path. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Value | Notes | | ||
| | -------------- | ------------------------------ | ------------------ | | ||
| | `databasePath` | `nonexistent/path/to/database` | Does **not** exist | | ||
| | `queryPath` | `nonexistent/path/to/query.ql` | Does **not** exist | | ||
| | `language` | `javascript` | Valid language | | ||
9 changes: 9 additions & 0 deletions
9
...ts/primitives/prompts/explain_codeql_query/invalid_query_path/after/monitoring-state.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "sessions": [ | ||
| { | ||
| "expectedContentPatterns": [ | ||
| "does not exist" | ||
| ] | ||
| } | ||
| ] | ||
| } |
8 changes: 8 additions & 0 deletions
8
...s/primitives/prompts/explain_codeql_query/invalid_query_path/before/monitoring-state.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "sessions": [], | ||
| "parameters": { | ||
| "databasePath": "nonexistent/path/to/database", | ||
| "queryPath": "nonexistent/path/to/query.ql", | ||
| "language": "javascript" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.