Find hidden agent plan files in workspace suggestions (#6641)
* fix(server): find hidden agent plan files in workspace suggestions Workspace autocomplete skipped the editor's plan directory while traversing other known agent directories. Include it in the existing discovery policy and cover basename and partial-path queries through the daemon client. Co-authored-by: X <X@16x.org> * test(server): give plan suggestion queries explicit expectations --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: X <X@16x.org>
This commit is contained in:
1 parent
0458988825
commit
b3693b79d1
2 files changed
+44
No files matched your search
@@ -23,6 +23,49 @@ afterEach(async () => {
|
||||
}, 60000);
|
||||
|
||||
describe("file explorer", () => {
|
||||
test.each([
|
||||
{
|
||||
query: "implementation",
|
||||
expectedPaths: [
|
||||
".cursor/plans/implementation-plan.md",
|
||||
".codex/plans/implementation-plan.md",
|
||||
".claude/plans/implementation-plan.md",
|
||||
],
|
||||
},
|
||||
{
|
||||
query: ".cursor/plans/implementation",
|
||||
expectedPaths: [".cursor/plans/implementation-plan.md"],
|
||||
},
|
||||
])(
|
||||
"workspace suggestions find hidden agent plans for '$query'",
|
||||
async ({ query, expectedPaths }) => {
|
||||
const cwd = tmpCwd();
|
||||
try {
|
||||
for (const directory of [".cursor", ".codex", ".claude", ".hidden"]) {
|
||||
mkdirSync(path.join(cwd, directory, "plans"), { recursive: true });
|
||||
writeFileSync(path.join(cwd, directory, "plans", "implementation-plan.md"), "plan\n");
|
||||
}
|
||||
|
||||
const response = await ctx.client.getDirectorySuggestions({
|
||||
cwd,
|
||||
query,
|
||||
limit: 50,
|
||||
includeFiles: true,
|
||||
includeDirectories: true,
|
||||
});
|
||||
expect(response.error).toBeNull();
|
||||
expect(response.entries).toHaveLength(expectedPaths.length);
|
||||
expect(response.entries).toEqual(
|
||||
expect.arrayContaining(
|
||||
expectedPaths.map((entryPath) => ({ path: entryPath, kind: "file" })),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
rmSync(cwd, { recursive: true, force: true });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test.each(["..", "..."])("supports file operations on names starting with %s", async (prefix) => {
|
||||
const cwd = tmpCwd();
|
||||
const fileName = `${prefix}notes.txt`;
|
||||
|
||||
@@ -146,6 +146,7 @@ export const WORKSPACE_SEARCH_HIDDEN_DIRECTORIES = [
|
||||
".agents",
|
||||
".claude",
|
||||
".codex",
|
||||
".cursor",
|
||||
".github",
|
||||
".opencode",
|
||||
".paseo",
|
||||
|
||||
Reference in new issue
Block a user