|
|
@@ -79,7 +79,7 @@ __setMockImplementation(
|
|
|
globalCustomInstructions: string,
|
|
|
cwd: string,
|
|
|
mode: string,
|
|
|
- options?: { language?: string },
|
|
|
+ options?: { language?: string; rooIgnoreInstructions?: string; settings?: Record<string, any> },
|
|
|
) => {
|
|
|
const sections = []
|
|
|
|
|
|
@@ -575,6 +575,94 @@ describe("SYSTEM_PROMPT", () => {
|
|
|
expect(prompt.indexOf(modes[0].roleDefinition)).toBeLessThan(prompt.indexOf("TOOL USE"))
|
|
|
})
|
|
|
|
|
|
+ it("should exclude update_todo_list tool when todoListEnabled is false", async () => {
|
|
|
+ const settings = {
|
|
|
+ todoListEnabled: false,
|
|
|
+ }
|
|
|
+
|
|
|
+ const prompt = await SYSTEM_PROMPT(
|
|
|
+ mockContext,
|
|
|
+ "/test/path",
|
|
|
+ false, // supportsComputerUse
|
|
|
+ undefined, // mcpHub
|
|
|
+ undefined, // diffStrategy
|
|
|
+ undefined, // browserViewportSize
|
|
|
+ defaultModeSlug, // mode
|
|
|
+ undefined, // customModePrompts
|
|
|
+ undefined, // customModes
|
|
|
+ undefined, // globalCustomInstructions
|
|
|
+ undefined, // diffEnabled
|
|
|
+ experiments,
|
|
|
+ true, // enableMcpServerCreation
|
|
|
+ undefined, // language
|
|
|
+ undefined, // rooIgnoreInstructions
|
|
|
+ undefined, // partialReadsEnabled
|
|
|
+ settings, // settings
|
|
|
+ )
|
|
|
+
|
|
|
+ // Should not contain the tool description
|
|
|
+ expect(prompt).not.toContain("## update_todo_list")
|
|
|
+ // Mode instructions will still reference the tool with a fallback to markdown
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should include update_todo_list tool when todoListEnabled is true", async () => {
|
|
|
+ const settings = {
|
|
|
+ todoListEnabled: true,
|
|
|
+ }
|
|
|
+
|
|
|
+ const prompt = await SYSTEM_PROMPT(
|
|
|
+ mockContext,
|
|
|
+ "/test/path",
|
|
|
+ false, // supportsComputerUse
|
|
|
+ undefined, // mcpHub
|
|
|
+ undefined, // diffStrategy
|
|
|
+ undefined, // browserViewportSize
|
|
|
+ defaultModeSlug, // mode
|
|
|
+ undefined, // customModePrompts
|
|
|
+ undefined, // customModes
|
|
|
+ undefined, // globalCustomInstructions
|
|
|
+ undefined, // diffEnabled
|
|
|
+ experiments,
|
|
|
+ true, // enableMcpServerCreation
|
|
|
+ undefined, // language
|
|
|
+ undefined, // rooIgnoreInstructions
|
|
|
+ undefined, // partialReadsEnabled
|
|
|
+ settings, // settings
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(prompt).toContain("update_todo_list")
|
|
|
+ expect(prompt).toContain("## update_todo_list")
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should include update_todo_list tool when todoListEnabled is undefined", async () => {
|
|
|
+ const settings = {
|
|
|
+ // todoListEnabled not set
|
|
|
+ }
|
|
|
+
|
|
|
+ const prompt = await SYSTEM_PROMPT(
|
|
|
+ mockContext,
|
|
|
+ "/test/path",
|
|
|
+ false, // supportsComputerUse
|
|
|
+ undefined, // mcpHub
|
|
|
+ undefined, // diffStrategy
|
|
|
+ undefined, // browserViewportSize
|
|
|
+ defaultModeSlug, // mode
|
|
|
+ undefined, // customModePrompts
|
|
|
+ undefined, // customModes
|
|
|
+ undefined, // globalCustomInstructions
|
|
|
+ undefined, // diffEnabled
|
|
|
+ experiments,
|
|
|
+ true, // enableMcpServerCreation
|
|
|
+ undefined, // language
|
|
|
+ undefined, // rooIgnoreInstructions
|
|
|
+ undefined, // partialReadsEnabled
|
|
|
+ settings, // settings
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(prompt).toContain("update_todo_list")
|
|
|
+ expect(prompt).toContain("## update_todo_list")
|
|
|
+ })
|
|
|
+
|
|
|
afterAll(() => {
|
|
|
vi.restoreAllMocks()
|
|
|
})
|