mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-24 00:51:34 +00:00
- Added new tool parameters for subagent including "description" and "subagent_type". - Implemented filtering logic to include/exclude the subagent tool based on experiment settings. - Enhanced localization for subagent tool in multiple languages. - Updated UI components to display subagent status and progress. - Introduced subagent-specific tool restrictions in the backend logic. This commit lays the groundwork for running subagents in the background for research or sub-tasks, enhancing the overall functionality of the toolset.
51 lines
1.6 KiB
TypeScript
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("PREVENT_FOCUS_DISRUPTION", () => {
|
|
it("is configured correctly", () => {
|
|
expect(EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION).toBe("preventFocusDisruption")
|
|
expect(experimentConfigsMap.PREVENT_FOCUS_DISRUPTION).toMatchObject({
|
|
enabled: false,
|
|
})
|
|
})
|
|
})
|
|
|
|
describe("isEnabled", () => {
|
|
it("returns false when experiment is not enabled", () => {
|
|
const experiments: Record<ExperimentId, boolean> = {
|
|
preventFocusDisruption: false,
|
|
imageGeneration: false,
|
|
runSlashCommand: false,
|
|
customTools: false,
|
|
subagent: false,
|
|
}
|
|
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(false)
|
|
})
|
|
|
|
it("returns true when experiment is enabled", () => {
|
|
const experiments: Record<ExperimentId, boolean> = {
|
|
preventFocusDisruption: true,
|
|
imageGeneration: false,
|
|
runSlashCommand: false,
|
|
customTools: false,
|
|
subagent: false,
|
|
}
|
|
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(true)
|
|
})
|
|
|
|
it("returns false when experiment is not present", () => {
|
|
const experiments: Record<ExperimentId, boolean> = {
|
|
preventFocusDisruption: false,
|
|
imageGeneration: false,
|
|
runSlashCommand: false,
|
|
customTools: false,
|
|
subagent: false,
|
|
}
|
|
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(false)
|
|
})
|
|
})
|
|
})
|