feat: Support agent skills in agent mode and add preferences settings#133
feat: Support agent skills in agent mode and add preferences settings#133
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…pilot-for-eclipse into ethan/support-skill
There was a problem hiding this comment.
Pull request overview
Adds Skills support to Copilot Chat’s Agent experience by wiring a new “Enable Skills” preference through to CLS settings, extending the conversation templates LSP request to include workspace folders (so CLS can discover SKILL.md / .prompt.md), and updating UI/test infrastructure to validate skills rendering via SWTBot probes.
Changes:
- Add “Enable Skills” preference (UI strings, preference page UI, defaults) and propagate it to language server settings.
- Extend
conversation/templatesrequest to include workspace folders; enrich template model withsource(BUILTIN/PROMPT/SKILL) and update completion filtering/sorting. - Add SWTBot probe actions + a new probe script to validate skills appear/disappear based on the preference.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/messages.properties | Adds UI strings for Skills toggle; adjusts sub-agent label. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/Messages.java | Adds NLS keys for Skills toggle. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManager.java | Syncs enableSkills to CLS settings, including live updates. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferenceInitializer.java | Sets default values for sub-agent + skills toggles. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/ChatPreferencesPage.java | Adds “Enable Skills” field editor; refactors layout helpers. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java | Refreshes templates using workspace folders; listens for skill/prompt file changes + pref changes. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatAssistProcessor.java | Filters templates by mode scope and improves matching/sorting; displays skills using short description. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManagerTests.java | Updates mocks for the new preference key. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/services/McpExtensionPointManagerTest.java | Fixes test setup to avoid NPE; improves null-map assertion. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionServiceTest.java | Updates tests for new templates API + job family; adds static mocking of CopilotUi. |
| com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/StepExecutor.java | Adds new probe actions (preferences, workspace file ops, job waiting, content-assist assertions, key typing). |
| com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/ProbeStep.java | Adds fields needed for the new probe actions. |
| com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/Locator.java | Documents new checkBox locator type. |
| com.microsoft.copilot.eclipse.swtbot.test/probe-scripts/skills-file-with-pref-001.json | New probe validating Skills enabled/disabled behavior. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/TemplateSource.java | New enum identifying template source type. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotAgentSettings.java | Adds enableSkills setting. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationTemplatesParams.java | New params record for conversation/templates request. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationTemplate.java | Converts template model to a record; adds source. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java | Updates listConversationTemplates to pass workspace folders. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServer.java | Updates LSP request signature for templates to accept params. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java | Adds ENABLE_SKILLS preference key. |
| .github/skills/ui-action/SKILL.md | Documents new probe actions used by the skills probe script. |
Comments suppressed due to low confidence (2)
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java:120
- InterruptedException is caught and only logged here. The thread interrupt flag should be restored (Thread.currentThread().interrupt()) so callers/framework code can react appropriately (e.g., job cancellation).
} catch (InterruptedException | ExecutionException e) {
CopilotCore.LOGGER.error(e);
}
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java:234
- syncCommands() mutates the current HashSet/ArrayList instances via clear(). Since fetchAsync() updates these fields from a background Job, readers (e.g., isCommand() from the UI thread) can race with clear(), and HashSet/ArrayList are not thread-safe for concurrent reads+writes. Prefer swapping in new immutable/empty instances (e.g., Collections.emptySet()/emptyList()) to keep the snapshot swap pattern consistent and avoid concurrent mutation.
private void syncCommands(String status) {
switch (status) {
case CopilotStatusResult.OK:
fetchAsync();
break;
default:
allCommands.clear();
templates.clear();
agents.clear();
break;
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
|
Looking forward to it, however README should probably updated as well for this feature. |
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…rity Co-authored-by: Copilot <copilot@github.com>
@kwin added. |
Co-authored-by: Copilot <copilot@github.com>
…sages Co-authored-by: Copilot <copilot@github.com>
…n newly added CLS notification.
/, the skills should be rendered / hide corresponding to the preference settings.