Fix language passing

This commit is contained in:
Matt Rubens 2025-03-17 15:32:26 -04:00
parent 41bd36c29a
commit 7780957fed
3 changed files with 7 additions and 3 deletions

View file

@ -3692,12 +3692,13 @@ export class Cline extends EventEmitter<ClineEvents> {
customModePrompts,
experiments = {} as Record<ExperimentId, boolean>,
customInstructions: globalCustomInstructions,
language,
} = (await this.providerRef.deref()?.getState()) ?? {}
const currentMode = mode ?? defaultModeSlug
const modeDetails = await getFullModeDetails(currentMode, customModes, customModePrompts, {
cwd,
globalCustomInstructions,
language: formatLanguage(vscode.env.language),
language: language ?? formatLanguage(vscode.env.language),
})
details += `\n\n# Current Mode\n`
details += `<slug>${currentMode}</slug>\n`

View file

@ -41,6 +41,7 @@ async function generatePrompt(
diffEnabled?: boolean,
experiments?: Record<string, boolean>,
enableMcpServerCreation?: boolean,
language?: string,
rooIgnoreInstructions?: string,
): Promise<string> {
if (!context) {
@ -109,6 +110,7 @@ export const SYSTEM_PROMPT = async (
diffEnabled?: boolean,
experiments?: Record<string, boolean>,
enableMcpServerCreation?: boolean,
language?: string,
rooIgnoreInstructions?: string,
): Promise<string> => {
if (!context) {
@ -139,7 +141,7 @@ export const SYSTEM_PROMPT = async (
globalCustomInstructions || "",
cwd,
mode,
{ language: formatLanguage(vscode.env.language), rooIgnoreInstructions },
{ language: language ?? formatLanguage(vscode.env.language), rooIgnoreInstructions },
)
// For file-based prompts, don't include the tool sections
return `${roleDefinition}
@ -166,6 +168,7 @@ ${customInstructions}`
diffEnabled,
experiments,
enableMcpServerCreation,
language,
rooIgnoreInstructions,
)
}

View file

@ -2545,7 +2545,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
writeDelayMs: stateValues.writeDelayMs ?? 1000,
terminalOutputLineLimit: stateValues.terminalOutputLineLimit ?? 500,
mode: stateValues.mode ?? defaultModeSlug,
language: stateValues.language || formatLanguage(vscode.env.language),
language: stateValues.language ?? formatLanguage(vscode.env.language),
mcpEnabled: stateValues.mcpEnabled ?? true,
enableMcpServerCreation: stateValues.enableMcpServerCreation ?? true,
alwaysApproveResubmit: stateValues.alwaysApproveResubmit ?? false,