fix: provide default MCP auto-approve configuration#359
Open
xinyi-gong wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures the Eclipse client always sends an explicit MCP auto-approve configuration (mcp.autoApprove: []) to the Copilot language server, preventing CLS from receiving undefined and logging the startup warning reported in #358.
Changes:
- Extend
CopilotAgentSettings.ToolsSettingswith MCP settings and defaultautoApproveto an empty list. - Ensure serialized settings include
github.copilot.agent.tools.mcp.autoApproveas an empty array. - Add a regression test that asserts the serialized configuration contains the empty
autoApprovelist.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManagerTests.java | Adds a regression test asserting mcp.autoApprove is serialized as an empty list. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotAgentSettings.java | Introduces MCP tool settings (tools.mcp.autoApprove) with a default empty list and integrates it into equality/hash/toString. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes the following CLS warning emitted during Eclipse startup:
[McpAutoApproveService] Invalid McpAutoApproveService config, resetting to empty undefinedRoot Cause
Eclipse did not include
github.copilot.agent.tools.mcp.autoApprovein the configuration sent to CLS. CLS therefore receivedundefinedand treated it as an invalid MCP auto-approve configuration.Changes
CopilotAgentSettings.ToolsSettings.mcp.autoApproveto an empty list.mcp.autoApprove: []to CLS.This does not change approval behavior because Eclipse continues to handle confirmations through
editorHandlesAllConfirmation.Fixes #358