OpenCode breaks on FreeBSD/ZFS: BigInt dev field overflow bug fixed upstream in Effect 4.0.5

asomers · ghdev · 2026-10-21

A developer filed a reproduced issue showing OpenCode's filesystem layer fails almost entirely on FreeBSD hosts with ZFS datasets: the /cd command and file pickers return nothing, GET /api/fs/list, /find, and /read return HTTP 500, and POST /api/session/{id}/move claims existing directories don't exist.

Root cause: OpenCode's Node filesystem layer comes from @effect/platform-node-shared, whose stat calls fs.stat(path, { bigint: true }) then converts the BigInt dev field to a Number. FreeBSD reports 64-bit stdev values for ZFS datasets (e.g. 8599779474788709465), which exceed the safe integer range and throw a RangeError.

Status: Effect fixed this upstream in @effect/platform-node-shared 4.0.5 by keeping dev as BigInt, but OpenCode still pins 4.0.1 across its workspace catalog, v2.0.32, v2.1.1, and dev. Reproduced on FreeBSD 15.1-RELEASE with ZFS 2.4.2, opencode 2.0.32 (embedded Bun v1.4.2).

Original post →

More from coding & agent

coding & agent channel →