diff --git a/src/core/prompts/sections/custom-system-prompt.ts b/src/core/prompts/sections/custom-system-prompt.ts index b8353e2fd8..f401000bb5 100644 --- a/src/core/prompts/sections/custom-system-prompt.ts +++ b/src/core/prompts/sections/custom-system-prompt.ts @@ -5,6 +5,10 @@ import { fileExistsAtPath } from "../../../utils/fs" export type PromptVariables = { workspace?: string + mode?: string + language?: string + shell?: string + operatingSystem?: string } function interpolatePromptContent(content: string, variables: PromptVariables): string { diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index 077016fd55..b7bbc06e09 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -14,6 +14,7 @@ import { DiffStrategy } from "../../shared/tools" import { McpHub } from "../../services/mcp/McpHub" import { getToolDescriptionsForMode } from "./tools" import * as vscode from "vscode" +import * as os from "os" import { getRulesSection, getSystemInfoSection, @@ -128,6 +129,10 @@ export const SYSTEM_PROMPT = async ( // Try to load custom system prompt from file const variablesForPrompt: PromptVariables = { workspace: cwd, + mode: mode, + language: language ?? formatLanguage(vscode.env.language), + shell: vscode.env.shell, + operatingSystem: os.type(), } const fileCustomSystemPrompt = await loadSystemPromptFile(cwd, mode, variablesForPrompt)