@devries-cameron20 / t3code-1 / commits / 6807c3fb86
Fork 0

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

fix(server): file search no longer crashes the server, and a failed Edit from here keeps your files (#35291)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>

Theo Browne committed Nov 12, 2026 at 06:18 UTC 6807c3fb865d3f9fcc0679b2e283cfd6064a4ea7
6 files changed +127 -212
apps/server/src/orchestration-v2/CheckpointRollbackService.test.ts
+14 -1
@@ -177,8 +177,10 @@ it.effect.each([
177 { order: "cleanup-first", restoreFiles: true, leavesFolder: true },
178 { order: "cleanup-first", restoreFiles: false, leavesFolder: true },
179 { order: "cleanup-first", restoreFiles: true, leavesFolder: true, shared: true },
180 -])("locks rollback with %s", ({ order, restoreFiles, unmanaged, leavesFolder, shared }) =>
180 + { order: "cleanup-first", restoreFiles: true, leavesFolder: true, createFails: true },
181 +])("locks rollback with %s", (row) =>
182 Effect.gen(function* () {
183 + const { order, restoreFiles, unmanaged, leavesFolder, shared, createFails } = row;
184 const fileSystem = yield* FileSystem.FileSystem;
185 const path = yield* Path.Path;
186 const workspaceRoot = yield* fileSystem.realPath(
@@ -249,6 +251,7 @@ it.effect.each([
251 path: worktreePath,
252 });
253 calls.push("create");
254 + if (createFails) return yield* Effect.die("the branch is gone");
255 yield* fileSystem
256 .makeDirectory(path.join(worktreePath, ".git"), { recursive: true })
257 .pipe(Effect.orDie);
@@ -362,6 +365,16 @@ it.effect.each([
365 }
366 return;
367 }
368 + if (createFails) {
369 + yield* Fiber.join(rollback).pipe(Effect.exit);
370 + assert.deepEqual(calls, ["cleanup", "prune", "create"]);
371 + assert.equal(
372 + yield* fileSystem.readFileString(path.join(worktreePath, "unsaved.txt")),
373 + "keep",
374 + );
375 + assert.deepEqual(yield* fileSystem.readDirectory(path.dirname(worktreePath)), ["feature"]);
376 + return;
377 + }
378 yield* Fiber.join(rollback);
379 if (laterCleanup !== undefined) yield* Fiber.join(laterCleanup);
380 const rollbackCalls = restoreFiles
apps/server/src/orchestration-v2/CheckpointRollbackService.ts
+44 -7
@@ -10,6 +10,7 @@ import {
10 import * as Context from "effect/Context";
11 import * as DateTime from "effect/DateTime";
12 import * as Effect from "effect/Effect";
13 +import * as Exit from "effect/Exit";
14 import * as FileSystem from "effect/FileSystem";
15 import * as Layer from "effect/Layer";
16 import * as Option from "effect/Option";
@@ -246,16 +247,52 @@ export const layer: Layer.Layer<
247 ) {
248 const project = yield* projects.get(context.thread.projectId);
249 if (Option.isSome(project)) {
250 + const recreate = gitWorkflow.pruneWorktrees({ cwd: project.value.workspaceRoot }).pipe(
251 + Effect.andThen(
252 + gitWorkflow.createWorktree({
253 + cwd: project.value.workspaceRoot,
254 + refName: branch,
255 + path: worktreePath,
256 + }),
257 + ),
258 + );
259 if (leftover) {
260 if (!(yield* isolated)) return yield* sharedWorkspace();
251 - yield* fileSystem.remove(worktreePath, { recursive: true, force: true });
261 + // Set aside, not removed: a checkout that fails puts the folder and its files back.
262 + yield* Effect.acquireUseRelease(
263 + Effect.gen(function* () {
264 + const aside = yield* fileSystem.makeTempDirectory({
265 + directory: path.dirname(worktreePath),
266 + prefix: ".t3-replaced-",
267 + });
268 + yield* fileSystem.rename(worktreePath, path.join(aside, "folder"));
269 + return aside;
270 + }),
271 + () => recreate,
272 + (aside, exit) =>
273 + (Exit.isSuccess(exit)
274 + ? Effect.void
275 + : fileSystem
276 + .remove(worktreePath, { recursive: true, force: true })
277 + .pipe(
278 + Effect.andThen(
279 + fileSystem.rename(path.join(aside, "folder"), worktreePath),
280 + ),
281 + )
282 + ).pipe(
283 + Effect.andThen(fileSystem.remove(aside, { recursive: true, force: true })),
284 + Effect.catchCause((cause) =>
285 + Effect.logWarning("Edit from here left a worktree folder set aside", {
286 + worktreePath,
287 + setAside: path.join(aside, "folder"),
288 + cause,
289 + }),
290 + ),
291 + ),
292 + );
293 + } else {
294 + yield* recreate;
295 }
253 - yield* gitWorkflow.pruneWorktrees({ cwd: project.value.workspaceRoot });
254 - yield* gitWorkflow.createWorktree({
255 - cwd: project.value.workspaceRoot,
256 - refName: branch,
257 - path: worktreePath,
258 - });
296 }
297 }
298 }
apps/server/src/workspace/WorkspaceEntries.test.ts
+34 -37
@@ -1,6 +1,7 @@
1 // @effect-diagnostics nodeBuiltinImport:off
2 import * as NodeFSP from "node:fs/promises";
3 import * as NodeServices from "@effect/platform-node/NodeServices";
4 +import { FileFinder } from "@ff-labs/fff-node";
5 import { it, afterEach, describe, expect } from "@effect/vitest";
6 import * as Effect from "effect/Effect";
7 import * as FileSystem from "effect/FileSystem";
@@ -12,7 +13,6 @@ import { vi } from "vite-plus/test";
13 import * as ServerConfig from "../config.ts";
14 import * as HostProcess from "@t3tools/shared/HostProcess";
15 import * as VcsProcess from "../vcs/VcsProcess.ts";
15 -import { WorkspaceFinderOpener } from "./WorkspaceFinderThread.ts";
16 import * as WorkspaceEntries from "./WorkspaceEntries.ts";
17 import * as WorkspacePaths from "./WorkspacePaths.ts";
18
@@ -793,42 +793,39 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
793 let scansOutlastWait = false;
794 let finders = 0;
795 let rescans = 0;
796 - const openFinder = yield* WorkspaceFinderOpener;
797 - const countingOpener: typeof openFinder = async (options) => {
798 - const opened = await openFinder(options);
799 - if (!opened.ok) return opened;
800 - finders += 1;
801 - const call: typeof opened.value.call = (method, ...args) => {
802 - if (method === "scanFiles") rescans += 1;
803 - if (method === "waitForIndexReady" && scansOutlastWait) {
804 - return Promise.resolve({ ok: true, value: false } as never);
805 - }
806 - return opened.value.call(method, ...args);
807 - };
808 - return { ok: true, value: { ...opened.value, call } };
809 - };
810 - const result = yield* Effect.gen(function* () {
811 - const workspaceEntries = yield* WorkspaceEntries.WorkspaceEntries;
812 - const searchNeedle = workspaceEntries.searchContents({
813 - cwd,
814 - query: "needle",
815 - limit: 100,
816 - caseSensitive: true,
817 - wholeWord: false,
818 - useRegex: false,
819 - });
820 - yield* searchNeedle;
821 -
822 - scansOutlastWait = true;
823 - yield* workspaceEntries.refresh(cwd);
824 - return yield* searchNeedle;
825 - }).pipe(
826 - Effect.provide(
827 - Layer.fresh(WorkspaceEntries.layer).pipe(
828 - Layer.provide(Layer.succeed(WorkspaceFinderOpener, countingOpener)),
829 - ),
830 - ),
831 - );
796 + const createFinder = FileFinder.create.bind(FileFinder);
797 + vi.spyOn(FileFinder, "create").mockImplementation((options) => {
798 + const created = createFinder(options);
799 + if (created.ok) {
800 + const finder = created.value;
801 + finders += 1;
802 + const scanFiles = finder.scanFiles.bind(finder);
803 + finder.scanFiles = () => {
804 + rescans += 1;
805 + return scanFiles();
806 + };
807 + const waitForIndexReady = finder.waitForIndexReady.bind(finder);
808 + finder.waitForIndexReady = (timeoutMs) =>
809 + scansOutlastWait
810 + ? Promise.resolve({ ok: true, value: false })
811 + : waitForIndexReady(timeoutMs);
812 + }
813 + return created;
814 + });
815 + const workspaceEntries = yield* WorkspaceEntries.WorkspaceEntries;
816 + const searchNeedle = workspaceEntries.searchContents({
817 + cwd,
818 + query: "needle",
819 + limit: 100,
820 + caseSensitive: true,
821 + wholeWord: false,
822 + useRegex: false,
823 + });
824 + yield* searchNeedle;
825 +
826 + scansOutlastWait = true;
827 + yield* workspaceEntries.refresh(cwd);
828 + const result = yield* searchNeedle;
829
830 expect(result.matches.map((match) => match.path)).toEqual(["src/notes.ts"]);
831 // The second search ran on the rescanned live finder, not a rebuild.
apps/server/src/workspace/WorkspaceFinderThread.ts deleted
-116
@@ -1,116 +0,0 @@
1 -// @effect-diagnostics nodeBuiltinImport:off -- fff's native calls block their thread, so each finder owns a Node worker.
2 -import * as NodeModule from "node:module";
3 -import * as NodeWorkerThreads from "node:worker_threads";
4 -
5 -import type { FileFinder, InitOptions, Result } from "@ff-labs/fff-node";
6 -import * as Context from "effect/Context";
7 -
8 -type FinderMethod =
9 - | "destroy"
10 - | "directorySearch"
11 - | "fileSearch"
12 - | "grep"
13 - | "isScanning"
14 - | "mixedSearch"
15 - | "scanFiles"
16 - | "waitForIndexReady";
17 -
18 -export interface ThreadedFinder {
19 - readonly call: <M extends FinderMethod>(
20 - method: M,
21 - ...args: Parameters<FileFinder[M]>
22 - ) => Promise<Awaited<ReturnType<FileFinder[M]>>>;
23 - /** Stops the thread once any native call in flight returns; call `destroy` first. */
24 - readonly close: () => Promise<void>;
25 -}
26 -
27 -export type OpenFinder = (options: InitOptions) => Promise<Result<ThreadedFinder>>;
28 -
29 -// An inline worker needs no extra build entry, so src, dist, the single executable and Electron all load it.
30 -// Eval workers define a global `__dirname` of ".", which fff-node would use to look for its native library.
31 -const FINDER_WORKER_SOURCE = `
32 -delete globalThis.__dirname;
33 -delete globalThis.__filename;
34 -const { parentPort, workerData } = require("node:worker_threads");
35 -const { FileFinder } = require(workerData.fffEntryPath);
36 -const created = FileFinder.create(workerData.options);
37 -parentPort.postMessage({ created: created.ok ? { ok: true } : created });
38 -if (created.ok) {
39 - const finder = created.value;
40 - parentPort.on("message", async ({ id, method, args }) => {
41 - try {
42 - parentPort.postMessage({ id, value: await finder[method](...args) });
43 - } catch (cause) {
44 - parentPort.postMessage({ id, failed: true, cause });
45 - }
46 - });
47 -}
48 -`;
49 -
50 -// Node's watch mode posts its own `watch:require` messages on the same port, so every reply is tagged.
51 -type WorkerMessage =
52 - | { readonly created: Result<undefined> }
53 - | { readonly id: number; readonly value: unknown }
54 - | { readonly id: number; readonly failed: true; readonly cause: unknown };
55 -
56 -// fff-node's native library stays external; single-executables require disk packages instead of importing them.
57 -const requireForFff = NodeModule.createRequire(import.meta.url);
58 -const fffEntryPath = requireForFff.resolve("@ff-labs/fff-node");
59 -// ffi-rs crashes the process when the first thread that loaded it exits, so the main thread loads it first.
60 -requireForFff(fffEntryPath);
61 -
62 -const openWorkerFinder: OpenFinder = (options) =>
63 - new Promise((resolve, reject) => {
64 - const worker = new NodeWorkerThreads.Worker(FINDER_WORKER_SOURCE, {
65 - eval: true,
66 - workerData: { fffEntryPath, options },
67 - });
68 - worker.unref();
69 - const pending = new Map<
70 - number,
71 - { readonly resolve: (value: never) => void; readonly reject: (cause: unknown) => void }
72 - >();
73 - let nextId = 0;
74 - let failure: unknown;
75 - const fail = (cause: unknown) => {
76 - failure ??= cause;
77 - reject(failure);
78 - for (const request of pending.values()) request.reject(failure);
79 - pending.clear();
80 - };
81 - worker.on("error", fail);
82 - worker.on("exit", (code) => fail(new Error(`The fff worker exited with code ${code}.`)));
83 -
84 - const call: ThreadedFinder["call"] = (method, ...args) =>
85 - new Promise((resolveCall, rejectCall) => {
86 - if (failure !== undefined) {
87 - rejectCall(failure);
88 - return;
89 - }
90 - const id = nextId++;
91 - pending.set(id, { resolve: resolveCall, reject: rejectCall });
92 - worker.postMessage({ id, method, args });
93 - });
94 -
95 - worker.on("message", (message: WorkerMessage) => {
96 - if ("created" in message) {
97 - resolve(
98 - message.created.ok
99 - ? { ok: true, value: { call, close: () => worker.terminate().then(() => undefined) } }
100 - : message.created,
101 - );
102 - return;
103 - }
104 - const request = pending.get(message.id);
105 - if (!request) return;
106 - pending.delete(message.id);
107 - if ("failed" in message) request.reject(message.cause);
108 - else request.resolve(message.value as never);
109 - });
110 - });
111 -
112 -/** Opens fff finders off the server's event loop, where a native call can block for as long as a file read. */
113 -export const WorkspaceFinderOpener = Context.Reference<OpenFinder>(
114 - "t3/workspace/WorkspaceFinderThread/WorkspaceFinderOpener",
115 - { defaultValue: () => openWorkerFinder },
116 -);
apps/server/src/workspace/WorkspaceSearchIndex.test.ts
+11 -18
@@ -1,4 +1,10 @@
1 -import type { FileFinder, FileItem, GrepCursor, GrepOptions, GrepResult } from "@ff-labs/fff-node";
1 +import {
2 + FileFinder,
3 + type FileItem,
4 + type GrepCursor,
5 + type GrepOptions,
6 + type GrepResult,
7 +} from "@ff-labs/fff-node";
8 import * as NodeServices from "@effect/platform-node/NodeServices";
9 import { afterEach, expect, it } from "@effect/vitest";
10 import * as HostProcess from "@t3tools/shared/HostProcess";
@@ -7,23 +13,12 @@ import * as FileSystem from "effect/FileSystem";
13 import * as Path from "effect/Path";
14 import { vi } from "vite-plus/test";
15
10 -import { WorkspaceFinderOpener } from "./WorkspaceFinderThread.ts";
16 import * as WorkspaceSearchIndex from "./WorkspaceSearchIndex.ts";
17
18 afterEach(() => {
19 vi.restoreAllMocks();
20 });
21
17 -const withInProcessFinder = (finder: FileFinder) =>
18 - Effect.provideService(WorkspaceFinderOpener, async () => ({
19 - ok: true as const,
20 - value: {
21 - call: async (method, ...args) =>
22 - (finder[method] as (...input: typeof args) => never)(...args),
23 - close: async () => undefined,
24 - },
25 - }));
26 -
22 function fileItem(relativePath: string): FileItem {
23 return {
24 relativePath,
@@ -58,10 +53,9 @@ it.effect("filters image searches before applying the result limit", () =>
53 waitForIndexReady: vi.fn(async () => ({ ok: true as const, value: true })),
54 fileSearch,
55 } as unknown as FileFinder;
56 + vi.spyOn(FileFinder, "create").mockReturnValueOnce({ ok: true, value: finder });
57
62 - const searchIndex = yield* WorkspaceSearchIndex.make("/workspace/project").pipe(
63 - withInProcessFinder(finder),
64 - );
58 + const searchIndex = yield* WorkspaceSearchIndex.make("/workspace/project");
59 const resultWithoutKind = yield* searchIndex.search("", 200, undefined, true);
60 const resultWithDirectoryKind = yield* searchIndex.search("", 200, "directory", true);
61
@@ -122,10 +116,9 @@ it.effect("continues whole-word searches after a filtered grep page", () =>
116 waitForIndexReady: vi.fn(async () => ({ ok: true as const, value: true })),
117 grep,
118 } as unknown as FileFinder;
119 + vi.spyOn(FileFinder, "create").mockReturnValueOnce({ ok: true, value: finder });
120
126 - const searchIndex = yield* WorkspaceSearchIndex.make("/workspace/project", "content").pipe(
127 - withInProcessFinder(finder),
128 - );
121 + const searchIndex = yield* WorkspaceSearchIndex.make("/workspace/project", "content");
122 const result = yield* searchIndex.searchContents({
123 query: "needle",
124 limit: 1,
apps/server/src/workspace/WorkspaceSearchIndex.ts
+24 -33
@@ -1,7 +1,10 @@
1 +import * as NodeModule from "node:module";
2 +
3 import type {
4 DirItem,
5 DirSearchResult,
6 FileItem,
7 + FileFinder as FileFinderType,
8 GrepCursor,
9 MixedItem,
10 MixedSearchResult,
@@ -24,7 +27,9 @@ import type {
27 } from "@t3tools/contracts";
28 import { isProjectFaviconPath } from "@t3tools/shared/projectFavicon";
29
27 -import { type ThreadedFinder, WorkspaceFinderOpener } from "./WorkspaceFinderThread.ts";
30 +// fff-node's native library stays external; single-executables require disk packages instead of importing them.
31 +const requireForFff = NodeModule.createRequire(import.meta.url);
32 +const { FileFinder } = requireForFff("@ff-labs/fff-node") as typeof import("@ff-labs/fff-node");
33
34 const WORKSPACE_INDEX_MAX_ENTRIES = 25_000;
35 const WORKSPACE_INDEX_PAGE_SIZE = WORKSPACE_INDEX_MAX_ENTRIES + 2;
@@ -283,10 +288,9 @@ const createFinder = Effect.fn("WorkspaceSearchIndex.createFinder")(function* (
288 cwd: string,
289 variant: WorkspaceSearchIndexVariant,
290 ) {
286 - const openFinder = yield* WorkspaceFinderOpener;
287 - const result = yield* Effect.tryPromise({
291 + const result = yield* Effect.try({
292 try: () =>
289 - openFinder({
293 + FileFinder.create({
294 basePath: cwd,
295 disableMmapCache: true,
296 // Content indexing costs CPU/memory; path-only consumers use the lightweight index.
@@ -309,11 +313,11 @@ const createFinder = Effect.fn("WorkspaceSearchIndex.createFinder")(function* (
313
314 const waitForIndexReady = Effect.fn("WorkspaceSearchIndex.waitForIndexReady")(function* <E>(
315 cwd: string,
312 - finder: ThreadedFinder,
316 + finder: FileFinderType,
317 onFailure: (input: { readonly reason: string; readonly cause?: unknown }) => E,
318 ): Effect.fn.Return<void, E | WorkspaceSearchIndexScanTimedOut> {
319 const result = yield* Effect.tryPromise({
316 - try: () => finder.call("waitForIndexReady", WORKSPACE_INDEX_SCAN_TIMEOUT_MS),
320 + try: () => finder.waitForIndexReady(WORKSPACE_INDEX_SCAN_TIMEOUT_MS),
321 catch: (cause) =>
322 onFailure({
323 reason: "FileFinder.waitForIndexReady rejected unexpectedly.",
@@ -336,8 +340,8 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
340 variant: WorkspaceSearchIndexVariant = "paths",
341 ) {
342 const finder = yield* Effect.acquireRelease(createFinder(cwd, variant), (finder) =>
339 - Effect.tryPromise({
340 - try: () => finder.call("destroy").finally(finder.close),
343 + Effect.try({
344 + try: () => finder.destroy(),
345 catch: (cause) => new WorkspaceSearchIndexDestroyFailed({ cwd, cause }),
346 }).pipe(Effect.orDie),
347 );
@@ -362,28 +366,15 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
366 }),
367 );
368
365 - const hasIncompleteInitialScan = () =>
366 - initialScanTimedOut
367 - ? Effect.tryPromise({
368 - try: () => finder.call("isScanning"),
369 - catch: (cause) =>
370 - new WorkspaceSearchIndexSearchFailed({
371 - cwd,
372 - queryLength: 0,
373 - pageSize: 0,
374 - reason: "FileFinder.isScanning threw unexpectedly.",
375 - cause,
376 - }),
377 - })
378 - : Effect.succeed(false);
369 + const hasIncompleteInitialScan = () => initialScanTimedOut && finder.isScanning();
370
371 const runSearch = Effect.fn("WorkspaceSearchIndex.runSearch")(function* <A>(
372 query: string,
373 pageSize: number,
374 operation: "directorySearch" | "fileSearch" | "grep" | "mixedSearch",
384 - execute: () => Promise<Result<A>>,
375 + execute: () => Result<A>,
376 ): Effect.fn.Return<A, WorkspaceSearchIndexSearchFailed> {
386 - const result = yield* Effect.tryPromise({
377 + const result = yield* Effect.try({
378 try: execute,
379 catch: (cause) =>
380 new WorkspaceSearchIndexSearchFailed({
@@ -408,8 +399,8 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
399 const refresh: WorkspaceSearchIndex["Service"]["refresh"] = Effect.fn(
400 "WorkspaceSearchIndex.refresh",
401 )(function* () {
411 - const result = yield* Effect.tryPromise({
412 - try: () => finder.call("scanFiles"),
402 + const result = yield* Effect.try({
403 + try: () => finder.scanFiles(),
404 catch: (cause) =>
405 new WorkspaceSearchIndexRefreshFailed({
406 cwd,
@@ -439,9 +430,9 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
430
431 const list: WorkspaceSearchIndex["Service"]["list"] = Effect.fn("WorkspaceSearchIndex.list")(
432 function* () {
442 - const incompleteBeforeQuery = yield* hasIncompleteInitialScan();
433 + const incompleteBeforeQuery = hasIncompleteInitialScan();
434 const result = yield* runSearch("", WORKSPACE_INDEX_PAGE_SIZE, "mixedSearch", () =>
444 - finder.call("mixedSearch", "", { pageSize: WORKSPACE_INDEX_PAGE_SIZE }),
435 + finder.mixedSearch("", { pageSize: WORKSPACE_INDEX_PAGE_SIZE }),
436 );
437 const mapped = mapMixedSearchResult(result, WORKSPACE_INDEX_MAX_ENTRIES);
438 const sortedEntries = withDirectoryAncestors(mapped.entries).toSorted((left, right) =>
@@ -463,23 +454,23 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
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);
466 - const incompleteBeforeQuery = yield* hasIncompleteInitialScan();
457 + const incompleteBeforeQuery = hasIncompleteInitialScan();
458 if (kind === "file" || imageOnly) {
459 const result = yield* runSearch(query, pageSize, "fileSearch", () =>
469 - finder.call("fileSearch", query, { pageSize }),
460 + finder.fileSearch(query, { pageSize }),
461 );
462 const mapped = mapFileSearchResult(result, limit, imageOnly);
463 return { ...mapped, truncated: incompleteBeforeQuery || mapped.truncated };
464 }
465 if (kind === "directory") {
466 const result = yield* runSearch(query, pageSize, "directorySearch", () =>
476 - finder.call("directorySearch", query, { pageSize }),
467 + finder.directorySearch(query, { pageSize }),
468 );
469 const mapped = mapDirectorySearchResult(result, limit);
470 return { ...mapped, truncated: incompleteBeforeQuery || mapped.truncated };
471 }
472 const result = yield* runSearch(query, pageSize, "mixedSearch", () =>
482 - finder.call("mixedSearch", query, { pageSize }),
473 + finder.mixedSearch(query, { pageSize }),
474 );
475 const mapped = mapMixedSearchResult(result, limit);
476 return { ...mapped, truncated: incompleteBeforeQuery || mapped.truncated };
@@ -502,7 +493,7 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
493 do {
494 const remainingTimeBudgetMs = Math.max(1, Math.ceil(deadline - performance.now()));
495 const result = yield* runSearch(input.query, input.limit, "grep", () =>
505 - finder.call("grep", searchQuery, {
496 + finder.grep(searchQuery, {
497 mode: regexMode ? "regex" : "plain",
498 smartCase: !input.caseSensitive && !regexMode,
499 maxMatchesPerFile: Math.min(CONTENT_SEARCH_MAX_MATCHES_PER_FILE, rawPageSize),