Skip to content

Internal variable resolution service for skills#4623

Open
pwang347 wants to merge 12 commits intomainfrom
pawang/variable
Open

Internal variable resolution service for skills#4623
pwang347 wants to merge 12 commits intomainfrom
pawang/variable

Conversation

@pwang347
Copy link
Member

@pwang347 pwang347 commented Mar 23, 2026

Remove hardcoded references to /troubleshoot. Also, we should not use getCurrentCapturingToken as it can have timing issues. Fixes microsoft/vscode#302219

CC @aeschli

@pwang347 pwang347 marked this pull request as ready for review March 23, 2026 23:01
Copilot AI review requested due to automatic review settings March 23, 2026 23:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / SkillVariableResolverService to resolve well-known {{VARIABLE}} placeholders in skill content.
  • Updated ReadFileTool and PromptFile to 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
alexdima previously approved these changes Mar 23, 2026
alexdima
alexdima previously approved these changes Mar 23, 2026
@pwang347 pwang347 enabled auto-merge March 23, 2026 23:46
@pwang347 pwang347 disabled auto-merge March 24, 2026 19:41
@pwang347 pwang347 enabled auto-merge March 24, 2026 19:57
@pwang347 pwang347 added this pull request to the merge queue Mar 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 24, 2026
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.

Running 'troubleshoot' in an empty chat leads to confused agent

4 participants