Skip to content

Commit c5a9fd5

Browse files
committed
fix(core): break filesystem search import cycle
filesystem.ts and filesystem/search.ts import each other and read the other's exports at module-eval time (FileSystem.node deps include FileSystemSearch.node). Bun 1.4's bundler resolves this cycle in an order that leaves FileSystemSearch.node undefined, so every prompt fails in LayerNode.walk ("undefined is not an object (evaluating 'node.name')") when SystemPrompt.environment builds the location layer. Bun 1.3.14, the version pinned in packageManager, happens to resolve the cycle in a working order. Import FileSystem type-only in search.ts and take Entry and Match values straight from @opencode-ai/schema/filesystem so the runtime back-edge is gone. Verified with local builds using both Bun 1.3.14 and 1.4.2.
1 parent 4a7d8df commit c5a9fd5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/core/src/filesystem/search.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import path from "path"
55
import { Context, Effect, Layer, Scope } from "effect"
66
import { Fff } from "#fff"
77
import fuzzysort from "fuzzysort"
8-
import { Entry, Match } from "@opencode-ai/schema/filesystem"
98
import type { FileSystem } from "../filesystem"
9+
import { Entry, Match } from "@opencode-ai/schema/filesystem"
1010
import { FSUtil } from "../fs-util"
1111
import { Location } from "../location"
1212
import { Ripgrep } from "../ripgrep"

0 commit comments

Comments
 (0)