anomalyco / anomalyco/opencode

First launch can stall on project .opencode dependency install

Open
#47,212 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 4, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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:

  • #33905 describes the same unbounded Config.waitForDependencies() mechanism, but was closed as a duplicate of an unrelated no-plugin rendering issue.
  • #31463 covers cold-cache Arborist hangs while installing npm-specifier plugins into the global cache. This report concerns the generated project .opencode install.
  • #30337 covers generated .opencode/node_modules, but attributes the delay to scanning an existing dependency tree.
  • #44684 reports related plugin installation and boot hangs in 1.18.21.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.