@devries-cameron20 / t3code-1 / commits / ea6af468a7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): @ file search matches paths containing square brackets (#34479)

Julius Marminge committed Nov 11, 2026 at 15:50 UTC ea6af468a7fabf5fd2bf88e6ff5e91abcb8fd0f7
2 files changed +18 -1
apps/server/src/workspace/WorkspaceEntries.test.ts
+14
@@ -457,6 +457,20 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
457 }),
458 );
459
460 + it.effect("matches square brackets in the query literally", () =>
461 + Effect.gen(function* () {
462 + const cwd = yield* makeTempDir({ prefix: "t3code-workspace-brackets-" });
463 + yield* writeTextFile(cwd, "src/app/game/[id]/index.tsx");
464 +
465 + for (const query of ["game/[i", "game/[id]"]) {
466 + const result = yield* searchWorkspaceEntries({ cwd, query, limit: 10 });
467 + expect(result.entries.map((entry) => entry.path)).toContain(
468 + "src/app/game/[id]/index.tsx",
469 + );
470 + }
471 + }),
472 + );
473 +
474 it.effect("excludes gitignored paths for git repositories", () =>
475 Effect.gen(function* () {
476 const cwd = yield* makeTempDir({ prefix: "t3code-workspace-gitignore-", git: true });
apps/server/src/workspace/WorkspaceSearchIndex.ts
+4 -1
@@ -449,7 +449,10 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
449
450 const search: WorkspaceSearchIndex["Service"]["search"] = Effect.fn(
451 "WorkspaceSearchIndex.search",
452 - )(function* (query, limit, kind, imageOnly) {
452 + )(function* (rawQuery, limit, kind, imageOnly) {
453 + // fff parses any word containing "[" as a glob and has no escape for it; fuzzy
454 + // matching is subsequence-based, so dropping "[" still matches "[id]" folders.
455 + const query = rawQuery.replaceAll("[", "");
456 const pageSize = imageOnly ? WORKSPACE_INDEX_PAGE_SIZE : Math.max(1, limit + 1);
457 const incompleteBeforeQuery = hasIncompleteInitialScan();
458 if (kind === "file" || imageOnly) {