Move the /troubleshoot built-in skill into the agent host#326430
Draft
vijayupadya wants to merge 4 commits into
Draft
Move the /troubleshoot built-in skill into the agent host#326430vijayupadya wants to merge 4 commits into
vijayupadya wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Moves /troubleshoot and #session handling into the agent host for consistent local, remote, standalone, and Agents window behavior.
Changes:
- Adds bundled skill discovery and deterministic invocation.
- Adds host-driven session-reference completions and log targeting.
- Removes client-specific troubleshooting plumbing and adds tests.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/chatSessionsService.ts |
Adds session-reference completion attachments. |
src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts |
Represents host session references. |
src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.ts |
Returns the active trigger character. |
src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.ts |
Refreshes hash completions while typing. |
src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.ts |
Renders and accepts session references. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts |
Bridges session references to AHP attachments. |
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts |
Removes client-side troubleshooting rewriting. |
src/vs/sessions/services/sessions/browser/sessionReference.ts |
Removes obsolete reference helpers. |
src/vs/sessions/contrib/chat/browser/sessionReferenceCompletions.ts |
Removes client-owned completions. |
src/vs/sessions/contrib/chat/browser/newChatInput.ts |
Removes the legacy provider registration. |
src/vs/sessions/contrib/chat/browser/agentHostInputCompletions.ts |
Handles host-provided session references. |
src/vs/platform/agentHost/test/node/copilotSlashCommandCompletionProvider.test.ts |
Tests built-in slash completions. |
src/vs/platform/agentHost/test/node/copilotBuiltinSkills.test.ts |
Tests built-in skill registration. |
src/vs/platform/agentHost/test/node/agentHostSessionReferenceCompletionProvider.test.ts |
Tests session completion and caching. |
src/vs/platform/agentHost/test/common/agentHostTroubleshoot.test.ts |
Tests troubleshooting request rewriting. |
src/vs/platform/agentHost/test/common/agentHostSkillInvocation.test.ts |
Tests canonical skill prompts. |
src/vs/platform/agentHost/node/copilot/skills/troubleshoot/SKILL.md |
Defines the bundled troubleshooting workflow. |
src/vs/platform/agentHost/node/copilot/copilotSlashCommandCompletionProvider.ts |
Surfaces built-in skills in completions. |
src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts |
Loads bundled skill directories. |
src/vs/platform/agentHost/node/copilot/copilotBuiltinSkills.ts |
Declares the built-in skill manifest. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Dispatches skills and resolves log paths. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Registers built-ins and session completions. |
src/vs/platform/agentHost/node/agentHostSessionReferenceCompletionProvider.ts |
Provides cached session completions. |
src/vs/platform/agentHost/node/agentHostFileCompletionProvider.ts |
Suppresses conflicting file matches. |
src/vs/platform/agentHost/common/meta/agentSessionReferenceMeta.ts |
Defines session-reference metadata. |
src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.ts |
Classifies session completion metadata. |
src/vs/platform/agentHost/common/agentHostTroubleshoot.ts |
Rewrites troubleshooting requests. |
src/vs/platform/agentHost/common/agentHostSkillInvocation.ts |
Builds deterministic skill prompts. |
Review details
Comments suppressed due to low confidence (1)
src/vs/platform/agentHost/node/agentHostSessionReferenceCompletionProvider.ts:122
Untitled sessionis displayed directly in completion UI but bypasses localization. Host-provided completion descriptions already uselocalize(for examplecopilotBuiltinSkills.ts:46), and the removed client implementation localized this same fallback. Localize this label so non-English builds do not regress.
const title = (session.summary ?? '').replace(/\s+/g, ' ').trim() || 'Untitled session';
- Files reviewed: 27/28 changed files
- Comments generated: 5
- Review effort level: Medium
vijayupadya
marked this pull request as ready for review
July 19, 2026 02:18
vijayupadya
enabled auto-merge (squash)
July 19, 2026 02:18
vijayupadya
marked this pull request as draft
July 19, 2026 02:18
auto-merge was automatically disabled
July 19, 2026 02:18
Pull request was converted to draft
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
Reimplements the
/troubleshootbuilt-in skill and its#sessionreference support in the agent host, so it works identically across the VS Code chat editor, the Agents window, and standalone/remote hosts — instead of being wired per-client in the sessions layer. The plumbing is generic, so any future built-in skill gets loading, autocomplete, and invocation for free.What it does
/troubleshootloads a bundled skill that analyzes a Copilot CLI session's on-disk event log to explain unexpected behavior.#session:<title>references another session so /troubleshoot analyzes that session's log instead of the current one. Follow-ups in the same chat can use a bare/troubleshootand stay on the referenced session (sticky).How it works
Architecture
1. Where it lives (layers)
The
BUILTIN_SKILLSmanifest is the single source of truth. It drives threeindependent paths: loading, autocomplete, and dispatch.
2. Three things the manifest drives
Adding a new built-in skill = create
skills/<name>/SKILL.md+ one manifest entry.Loading, autocomplete, and deterministic invocation come for free.
3. Autocomplete flow (
/troubleshootand#session)/completions come from the manifest, so/troubleshootappears before thesession materializes.
#sessioncompletions come from the host's session list (cached to avoidper-keystroke listing) and render as attachment "pills" client-side.
#-token results are marked incomplete so the host re-queries as you type.4. Dispatch flow (what makes the skill actually run)
A skill loaded via
skillDirectoriesis only available — the runtime does not reliablyrun it from a bare
/name. The host rewrites the message into a deterministic skillinvocation.
Reference vs. bare / sticky follow-ups
/troubleshoot #session:X-> analyzes X./troubleshoot follow-upin the same chat -> stays on X (skill'ssticky rule); no need to re-attach.
buildSkillInvocationPrompt(name, userText)directly.