diff --git a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts index 780feed2f6..89c93a4d0c 100644 --- a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts +++ b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts @@ -313,11 +313,21 @@ describe("getEnvironmentDetails", () => { expect(mockInactiveTerminal.getCurrentWorkingDirectory).toHaveBeenCalled() }) - it("should include experiment-specific details when Power Steering is enabled", async () => { + it("should always include mode role and custom instructions regardless of Power Steering", async () => { + // Test with Power Steering disabled + mockState.experiments = { [EXPERIMENT_IDS.POWER_STEERING]: false } + ;(experiments.isEnabled as Mock).mockReturnValue(false) + + let result = await getEnvironmentDetails(mockCline as Task) + + expect(result).toContain("You are a code assistant") + expect(result).toContain("Custom instructions") + + // Test with Power Steering enabled mockState.experiments = { [EXPERIMENT_IDS.POWER_STEERING]: true } ;(experiments.isEnabled as Mock).mockReturnValue(true) - const result = await getEnvironmentDetails(mockCline as Task) + result = await getEnvironmentDetails(mockCline as Task) expect(result).toContain("You are a code assistant") expect(result).toContain("Custom instructions") diff --git a/src/core/environment/getEnvironmentDetails.ts b/src/core/environment/getEnvironmentDetails.ts index fbc1f2dc57..2de28841c8 100644 --- a/src/core/environment/getEnvironmentDetails.ts +++ b/src/core/environment/getEnvironmentDetails.ts @@ -228,13 +228,10 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo details += `${currentMode}\n` details += `${modeDetails.name}\n` details += `${modelId}\n` + details += `${modeDetails.roleDefinition}\n` - if (Experiments.isEnabled(experiments ?? {}, EXPERIMENT_IDS.POWER_STEERING)) { - details += `${modeDetails.roleDefinition}\n` - - if (modeDetails.customInstructions) { - details += `${modeDetails.customInstructions}\n` - } + if (modeDetails.customInstructions) { + details += `${modeDetails.customInstructions}\n` } if (includeFileDetails) {