Skip to content

Compiled binary hangs on LLM stream with tools — works fine via bun dev #21457

Closed as not planned

Description

@TinBane

Description

The compiled/packaged opencode binary (installed via brew or npm) hangs indefinitely when sending messages to LLM providers. The spinner runs but no tokens ever arrive. Title generation (which uses small=true / no tools) works fine — only the main completion stream (with tools, small=false) hangs.

Critically: the exact same code works perfectly when run via bun dev from source, with no code changes and identical dependencies. This strongly suggests the issue is in the build/bundling process (script/build.ts), not the application logic.

Tested across:

  • Providers: OpenAI (Codex OAuth), OpenRouter
  • Models: GPT-5.4, GPT-5.3-codex, GLM-5
  • Versions: v1.3.10 (brew), v1.4.0 (npm)
  • All exhibit the same behavior

Note: The project directory was inside a Dropbox-synced folder (~/Library/CloudStorage/Dropbox/...). The logs show very frequent file.watcher.updated events (~every 10 seconds), which may be relevant if the file watcher is contending with the streaming pipeline in the compiled binary.

Plugins

None (clean install, all data wiped and reinstalled between tests)

OpenCode version

Tested on v1.3.10 (brew) and v1.4.0 (npm). Both hang. Dev build (bun dev from source at HEAD) works with no code changes — just git clone, bun install, bun dev.

Steps to reproduce

  1. Install opencode via brew or npm
  2. Authenticate with OpenAI: opencode auth login
  3. Open a project directory (ours was in a Dropbox-synced folder)
  4. Send any message, e.g. "say hello"
  5. Title updates (e.g. "Greeting") confirming auth works, but spinner runs indefinitely with no tokens
  6. Clone the repo, bun install, then bun dev -- run "say hello" --model openai/gpt-5.3-codex — works immediately, no code changes needed, same dependencies

Log evidence (compiled binary v1.3.10)

Both streams initiate but main stream hangs silently — no errors, no tokens, just file.watcher.updated events every ~10 seconds for minutes until the process is killed.

Log evidence (compiled binary v1.4.0)

The main LLM stream (small=false) never even initiates. The resolveTools step that should appear between the loop start and the LLM call is missing from logs entirely. Only the title stream (small=true) fires.

Log evidence (bun dev from source — WORKS)

Tools resolve in ~77ms, streamText returns successfully, tokens stream back, model responds. No code changes from HEAD, no dependency changes — identical bun.lock.

Operating System

macOS 26.3.1 (Apple Silicon)

Terminal

Various (reproduced in multiple terminals including Mac OS Terminal, cmux, iTerm2 , Claude Code's terminal)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 8, 2026
  2. dennisrutjes-1 commented on Apr 10, 2026

    @dennisrutjes-1

    Experiencing the same issue

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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