Skip to content

First launch can stall on project .opencode dependency install #47212

Closed as not planned

Description

@Seigiard

Description

On the first OpenCode launch in a fresh git worktree containing .opencode/skills, the TUI stayed completely blank and could not accept input. The OpenCode process remained alive.

The last logs for that run were the config paths loaded during bootstrapping; the usual LSP and formatter initialization logs never appeared. During the stall, OpenCode generated .opencode/package.json and node_modules, then wrote .opencode/package-lock.json 61 seconds after bootstrap began.

opencode --pure --print-logs --log-level DEBUG debug config later completed the same bootstrap in 216 ms. After the generated dependency files existed, a normal non-pure run completed in 254 ms.

This appears to be the per-directory Npm.install() for @opencode-ai/plugin blocking Plugin.init() through Config.waitForDependencies() whenever local plugins exist. The first launch provides no progress or timeout while waiting.

Expected behavior: the TUI should render promptly, or show dependency-install progress and fail within a bounded time.

Related issues:

Plugins

Four local file plugins under ~/.config/opencode/plugins: herdr-agent-state.js, herdr-worktree-identity.ts, test-oracle-guard.ts, and zsh-reserved-name-guard.ts.

OpenCode version

1.18.20

Steps to reproduce

  1. Configure at least one local file plugin under ~/.config/opencode/plugins.
  2. Open a fresh checkout or git worktree containing .opencode/skills, with no generated .opencode/package.json, package-lock.json, or node_modules yet.
  3. Run opencode in that worktree.
  4. Observe the blank TUI while the per-directory dependencies are installed.
  5. Start OpenCode again after the dependency files exist; startup is fast.

Screenshot and/or share link

The affected pane was entirely blank, and no share session was created.

Operating System

macOS 14.7.4

Terminal

Herdr 0.8.2

Activity

  1. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing open issues. Please check:

    These cover the same unbounded Npm.install() / bootstrap hang you've described. If your report adds new context (the per-directory .opencode install path specifically, as distinct from the global cache path in #31463), it may still be worth keeping open — but please check those issues first and comment there if they already capture the problem.

  2. benjaminshafii commented on Oct 3, 2026

    @benjaminshafii
    Contributor

    Another data point for the same mechanism, this time for the global config dir and file-path plugins, on Windows (OpenCode 1.18.30, opencode serve).

    When an embedder configures plugins as absolute file paths (self-contained bundles that don't import @opencode-ai/plugin), the first instance bootstrap on a fresh profile still waits for Npm.install(Global.Path.config, { add: ["@opencode-ai/plugin@<version>"] }) through Config.waitForDependencies() before it loads any plugin.

    First request for a folder on a fresh profile:

    Machine First request Second request
    Windows (2 vCPU, Defender on) 9.5–15 s ~0.4 s
    GitHub windows-2022 runner 34–50 s ~0.4 s
    GitHub macos-15 4–6 s <1 s

    With the same tree pre-installed in ~/.config/opencode, the first request takes 0.4 s on Windows. The install is 3,669 files, mostly effect. On Windows, a warm npm cache and a Defender exclusion each save only 1–5 s, so arborist's file writes account for most of the time.

    Suggestion: skip waitForDependencies() (or don't block on it) when every configured plugin is a local file path, or at least bound it and log progress. As a workaround we now ship the pre-resolved tree and unpack it on fresh profiles.

  3. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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