From fba873e50eabb91d9f7b561b94fa0cd927a5a686 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Aug 2025 11:52:07 -0700 Subject: [PATCH] fix: HOTFIX local assistant loading (#7354) * fix: local assistant loading * fix: no need for excluding .continue/.continue * test: cases for config.yml and config.yaml names --- core/config/loadLocalAssistants.ts | 6 +++- core/config/loadLocalAssistants.vitest.ts | 41 ++++++++++++++++++----- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/core/config/loadLocalAssistants.ts b/core/config/loadLocalAssistants.ts index b6a29212d..2a8135dc1 100644 --- a/core/config/loadLocalAssistants.ts +++ b/core/config/loadLocalAssistants.ts @@ -35,7 +35,11 @@ async function getDefinitionFilesInDir( } const overrideDefaultIgnores = ignore() - .add(DEFAULT_IGNORE_FILETYPES.filter((t) => t !== "config.yaml")) + .add( + DEFAULT_IGNORE_FILETYPES.filter( + (t) => t !== "config.yaml" && t !== "config.yml", + ), + ) .add(DEFAULT_IGNORE_DIRS); const uris = await walkDir(dir, ide, { diff --git a/core/config/loadLocalAssistants.vitest.ts b/core/config/loadLocalAssistants.vitest.ts index 8527eada5..316687db1 100644 --- a/core/config/loadLocalAssistants.vitest.ts +++ b/core/config/loadLocalAssistants.vitest.ts @@ -18,6 +18,8 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", [".continue/assistants/assistant2.yml", "yaml content 2"], [".continue/assistants/assistant3.md", "markdown content 1"], [".continue/assistants/assistant4.txt", "txt content"], + [".continue/assistants/config.yaml", "txt content"], + [".continue/assistants/config.yml", "txt content"], ]); }); @@ -38,9 +40,14 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", options, "assistants", ); - expect(result).toHaveLength(2); + expect(result).toHaveLength(4); expect(result.map((f) => f.path.split("/").pop())).toEqual( - expect.arrayContaining(["assistant1.yaml", "assistant2.yml"]), + expect.arrayContaining([ + "assistant1.yaml", + "assistant2.yml", + "config.yaml", + "config.yml", + ]), ); expect(result.map((f) => f.path.split("/").pop())).not.toContain( "assistant3.md", @@ -69,6 +76,12 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", expect(result.map((f) => f.path.split("/").pop())).not.toContain( "assistant2.yml", ); + expect(result.map((f) => f.path.split("/").pop())).not.toContain( + "config.yml", + ); + expect(result.map((f) => f.path.split("/").pop())).not.toContain( + "config.yaml", + ); }); it("should return all supported files when fileExtType is not specified", async () => { @@ -83,11 +96,13 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", options, "assistants", ); - expect(result).toHaveLength(3); + expect(result).toHaveLength(5); expect(result.map((f) => f.path.split("/").pop())).toEqual( expect.arrayContaining([ "assistant1.yaml", "assistant2.yml", + "config.yml", + "config.yaml", "assistant3.md", ]), ); @@ -124,9 +139,14 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", workspaceOnOptions, "assistants", ); - expect(workspaceResult).toHaveLength(2); + expect(workspaceResult).toHaveLength(4); expect(workspaceResult.map((f) => f.path.split("/").pop())).toEqual( - expect.arrayContaining(["assistant1.yaml", "assistant2.yml"]), + expect.arrayContaining([ + "assistant1.yaml", + "assistant2.yml", + "config.yaml", + "config.yml", + ]), ); }); @@ -187,7 +207,7 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", options, "assistants", ); - expect(result).toHaveLength(2); + expect(result).toHaveLength(4); const yamlFile = result.find((f) => f.path.includes("assistant1.yaml")); expect(yamlFile?.content).toBe("yaml content 1"); }); @@ -212,9 +232,14 @@ describe("ASSISTANTS getAllDotContinueDefinitionFiles with fileExtType option", "assistants", ); // Should only get lowercase extensions (current implementation) - expect(yamlResult).toHaveLength(2); + expect(yamlResult).toHaveLength(4); expect(yamlResult.map((f) => f.path.split("/").pop())).toEqual( - expect.arrayContaining(["assistant1.yaml", "assistant2.yml"]), + expect.arrayContaining([ + "assistant1.yaml", + "assistant2.yml", + "config.yaml", + "config.yml", + ]), ); expect(yamlResult.map((f) => f.path.split("/").pop())).not.toContain( "assistant5.YAML",