Internal variable resolution service for skills#4623
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a centralized runtime variable-resolution service for skill templates (starting with {{CURRENT_SESSION_LOG}}) and wires it into skill file rendering/reading paths to avoid per-call-site placeholder handling.
Changes:
- Added
ISkillVariableResolverService/SkillVariableResolverServiceto resolve well-known{{VARIABLE}}placeholders in skill content. - Updated
ReadFileToolandPromptFileto resolve skill variables generically for skill files (not just the troubleshoot skill). - Updated prompt rendering DI to optionally provide
IBuildPromptContext, and adjusted unit tests to cover broader skill variable replacement.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/platform/prompts/common/skillVariableResolverService.ts | New platform service that resolves skill template placeholders like {{CURRENT_SESSION_LOG}}. |
| src/extension/tools/node/readFileTool.tsx | Switches skill placeholder replacement logic to use the new resolver service for skill files. |
| src/extension/tools/node/test/readFile.spec.tsx | Updates tests to validate placeholder replacement for non-troubleshoot skills as well. |
| src/extension/prompts/node/panel/promptFile.tsx | Uses the resolver service when embedding skill files into prompts; derives session id from prompt context. |
| src/extension/prompts/node/base/promptRenderer.ts | Adds conditional DI registration of IBuildPromptContext based on root props. |
| src/extension/extension/vscode/services.ts | Registers the new ISkillVariableResolverService in the common service container. |
alexdima
previously approved these changes
Mar 23, 2026
alexdima
previously approved these changes
Mar 23, 2026
…-copilot-chat into pawang/variable
rzhao271
approved these changes
Mar 24, 2026
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.
Remove hardcoded references to /troubleshoot. Also, we should not use
getCurrentCapturingTokenas it can have timing issues. Fixes microsoft/vscode#302219CC @aeschli