Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/config/loadLocalAssistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
41 changes: 33 additions & 8 deletions core/config/loadLocalAssistants.vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]);
});

Expand All @@ -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",
Expand Down Expand Up @@ -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 () => {
Expand All @@ -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",
]),
);
Expand Down Expand Up @@ -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",
]),
);
});

Expand Down Expand Up @@ -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");
});
Expand All @@ -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",
Expand Down
Loading