Skip to content

Integrate with github copilot#2859

Draft
languy wants to merge 89 commits intomainfrom
dev/languye/cdb-chat-participant-with-copilot-query
Draft

Integrate with github copilot#2859
languy wants to merge 89 commits intomainfrom
dev/languye/cdb-chat-participant-with-copilot-query

Conversation

@languy
Copy link
Contributor

@languy languy commented Dec 3, 2025

Fixes #2883

languy and others added 30 commits September 3, 2025 15:51
* Initial plan

* Remove getConnectionInfo references from OperationParser and CosmosDbOperationsService

Co-authored-by: languy <21954022+languy@users.noreply.github.com>
…ide-by-side; refactor imports for consistency
languy and others added 30 commits January 30, 2026 17:16
* Initial plan

* Disable AI features when GitHub Copilot is not available

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* Fix documentation in copilotUtils.ts

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* feat: enhance AI feature availability checks and user feedback

* refactor: remove getAIFeaturesDisabledReason function and related localization logic

* fix: update comments for clarity on AI feature checks and retry logic

* feat: add new localization strings for query cancellation and schema properties

* fix: fix format

* fix: fix unit tests

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: languy <21954022+languy@users.noreply.github.com>
Co-authored-by: Laurent Nguyen <laurent.nguyen@microsoft.com>
…ion (#2923)

* Initial plan

* Add sanitization utilities and apply to chat participant and tree items

- Create comprehensive sanitization utilities (escapeHtml, escapeMarkdown, safeCodeBlock, etc.)
- Add 32 unit tests covering XSS prevention scenarios
- Apply sanitization to chat participant markdown output
- Apply sanitization to tree item tooltips
- All tests pass, code compiles successfully

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* Add URL scheme validation and sanitize container tooltips

- Add URL scheme validation to openUrl to prevent command injection
- Sanitize partition key paths in container tooltips
- Fix TypeScript linting errors

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* Address code review feedback

- Move HTML_ESCAPE_MAP to module-level constant
- Use escaped backticks instead of spaces for inline code
- Add inline comments explaining triple backtick escaping strategy
- Wrap numbers and booleans in code blocks for consistency
- Update tests to match new escaping behavior

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* Fix incomplete sanitization - escape backslashes in inline code

- Escape backslashes before backticks to prevent incomplete sanitization
- Add tests for backslash escaping
- CodeQL security check now passes with 0 alerts

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

* Revert tree/tooltip changes and sanitize query generation input

- Revert CosmosDBItemResourceItem.ts to remove sanitization (not needed for tree tooltips)
- Revert CosmosDBContainerResourceItem.ts to remove sanitization (not needed for tree tooltips)
- Revert openUrl.ts to remove URL scheme validation (not needed)
- Add sanitizeSqlComment() function to prevent SQL comment injection
- Sanitize user prompt and currentQuery in QueryEditorTab generateQuery method
- Add 7 new tests for SQL comment sanitization
- Keep all chat participant sanitization intact

Co-authored-by: languy <21954022+languy@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: languy <21954022+languy@users.noreply.github.com>
Co-authored-by: Laurent Nguyen <laurent.nguyen@microsoft.com>
… and general question handling

- Added methods to load and cache Cosmos DB reference assets for enriched context in chat responses.
- Implemented handling for general questions about Azure Cosmos DB, allowing users to ask broader queries.
- Updated system prompt to encourage the use of reference documentation for accurate responses.
- Modified intent extraction to include a new operation for general questions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query Advisor

2 participants