Skip to content

[Bug] Compiled prompts fail in native Bun 1.4.2 builds because of a filesystem/search cycle #48398

Description

@kernel-oops

Description

A native minified/split OpenCode build with embedded web UI can pass its health check and then fail on the first prompt before making any provider request:

TypeError: undefined is not an object (evaluating 'a.name')

The failure occurs during SystemPrompt.environment. The affected dependency graph is the runtime cycle between packages/core/src/filesystem.ts and packages/core/src/filesystem/search.ts: the filesystem service depends on the search node, while the search module imported the filesystem service at runtime. In a compiled Bun 1.4.2 build, the cycle can capture an undefined dependency during layer resolution.

The issue was reproduced against fresh upstream dev at 193de13a88d62a6409c6d385831180f1def527dc on Linux x64/glibc with Bun 1.4.2. The draft fix is commit 85f7d23ff78b8127553bbc68db1f4bfe3e945a61 in #48397.

Plugins

None. The regression uses isolated configuration with default plugins and external skills disabled.

OpenCode version

Fresh upstream dev at 193de13a88d62a6409c6d385831180f1def527dc, compiled with embedded Bun 1.4.2.

Steps to reproduce

  1. Build a native single-file executable from the affected tree using Bun 1.4.2 and the repository's frozen lockfile.
  2. Start the compiled executable and submit its first prompt from a clean project and home directory.
  3. Observe that health passes, but prompt preparation fails with the a.name error before the provider is contacted.

The regression harness in #48397 exercises the same compiled prompt path with a local deterministic provider, an authenticated session, a real read tool call, completion, persisted tool output and a second turn. With the fix, it passes and records exactly three provider requests.

Screenshot and/or share link

Not applicable.

Operating System

Linux x64/glibc

Terminal

Not applicable; the regression uses the compiled executable's local HTTP API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions