Repository navigation
Description
Summary
OpenCode 1.17.1 TUI exits shortly after rendering the home prompt when started from a large home directory. The terminal shows only:
Error: Unexpected server error. Check server logs for details.
at <anonymous> (/$bunfs/root/chunk-j3wpssn9.js:8:7615)
at processTicksAndRejections (native:7:39)
Downgrading to 1.17.0 fixes the crash.
Reproduction
Environment:
- macOS / darwin arm64
- OpenCode 1.17.1 installed via
bun - Start directory is the user's home directory (
/Users/joscha), which is large and contains many project directories
Steps:
cd ~
opencode --print-logsObserved: TUI renders the initial prompt, then exits with Unexpected server error after a few seconds.
Expected: TUI should remain open, or at minimum a file-search/indexing failure should not crash the TUI.
Log evidence
With 1.17.1, startup from ~ repeatedly logs server defects like:
timestamp=2026-06-10T14:29:00.949Z level=ERROR run=108389c9 message=failed ref=err_dc6a4eb1 error="fff scan timed out" cause="Error: fff scan timed out\n at KU (/$bunfs/root/chunk-kxc6dk47.js:12:2852)"
timestamp=2026-06-10T14:29:00.949Z level=ERROR run=108389c9 message=failed ref=err_adf6278e error="fff scan timed out" cause="Error: fff scan timed out\n at KU (/$bunfs/root/chunk-kxc6dk47.js:12:2852)"
Disabling external TUI plugins does not fix it. Running with --pure still crashes. Setting OPENCODE_DISABLE_FFF=1 also did not prevent the TUI exit in my local repro.
Downgrading fixes it:
opencode upgrade 1.17.0
cd ~
opencodeThe same home-directory TUI stays open on 1.17.0.
Suspected regression
The relevant 1.17.0 -> 1.17.1 change appears to be in packages/opencode/src/agent/agent.ts.
1.17.1 added reference directory expansion while constructing agent permissions:
const referenceDirs = yield* Effect.gen(function* () {
yield* (yield* PluginBoot.Service).wait()
return (yield* (yield* Reference.Service).list()).map((reference) => reference.path)
}).pipe(Effect.provide(locations.get(Location.Ref.make({ directory: AbsolutePath.make(ctx.directory) }))))That means the /agent path now boots a LocationServiceMap for the current directory. From ~, this initializes location services and file search/indexing over the home directory. On a large home directory, this can produce fff scan timed out, which the HTTP error middleware converts into a generic 500. The TUI client then exits with Unexpected server error.
Why this matters
Starting OpenCode from $HOME is a normal workflow. A slow or failing file index should be degraded or isolated, not make the whole TUI exit.
Possible fixes might be:
- avoid doing reference-dir expansion on
/agenthot path unless needed - do not bootstrap full location file-search services just to list reference paths
- treat
fff scan timed outin file/autocomplete/agent-reference contexts as recoverable - ensure
OPENCODE_DISABLE_FFF=1avoids this crash path
Activity
github-actions commentedon Jun 10, 2026
This issue might be a duplicate of existing issues. Please check:
fff scan timed outcrash when running opencode from the home directory on v1.17.x — identical error message, same regression, same root cause analysis.JosXa commentedon Jun 10, 2026
Closing as a duplicate of #31682. The bot correctly identified it, and #31682 is already closed by a maintainer as fixed in an upcoming release.