Roo-Code/src/shared/__tests__/experiments.spec.ts
roomote 6ed217c716
Fixes #4882: Remove experimental setting for command execution in attempt_completion (#4884)
* Fixes #4882: Remove experimental setting for command execution in attempt_completion

- Remove DISABLE_COMPLETION_COMMAND from experiments system
- Permanently disable command execution in attempt_completion tool
- Update tool prompts to remove command parameter and examples
- Remove experimental UI toggle and localization entries (18+ languages)
- Update tests to reflect permanent behavior
- Remove experiment-specific test file

Command execution is now permanently disabled in attempt_completion.
Users must use execute_command tool separately before attempt_completion.

* refactor: simplify getAttemptCompletionDescription by removing unnecessary variables

* test: fix tests by regenerating snaps

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
2025-06-20 17:48:01 -04:00

51 lines
1.6 KiB
TypeScript

// npx vitest run src/shared/__tests__/experiments.spec.ts
import type { ExperimentId } from "@roo-code/types"
import { EXPERIMENT_IDS, experimentConfigsMap, experiments as Experiments } from "../experiments"
describe("experiments", () => {
describe("POWER_STEERING", () => {
it("is configured correctly", () => {
expect(EXPERIMENT_IDS.POWER_STEERING).toBe("powerSteering")
expect(experimentConfigsMap.POWER_STEERING).toMatchObject({
enabled: false,
})
})
})
describe("MULTI_FILE_APPLY_DIFF", () => {
it("is configured correctly", () => {
expect(EXPERIMENT_IDS.MULTI_FILE_APPLY_DIFF).toBe("multiFileApplyDiff")
expect(experimentConfigsMap.MULTI_FILE_APPLY_DIFF).toMatchObject({
enabled: false,
})
})
})
describe("isEnabled", () => {
it("returns false when POWER_STEERING experiment is not enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})
it("returns true when experiment POWER_STEERING is enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: true,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(true)
})
it("returns false when experiment is not present", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})
})
})