Skip to content

Plugin init and config hook can block the opencode layer indefinitely #46161

Closed as not planned

Description

@CannonRS

Title:
Plugin init and config hook can block the opencode layer indefinitely

Description:
packages/opencode/src/plugin/index.ts loads each internal plugin with await plugin(input)
and notifies each loaded hook with (hook as any).config?.(cfg). Neither call has a timeout
or any per-plugin log line about which plugin is currently being awaited. When a plugin
returns a promise that never resolves (sync throw inside a never-resolving promise, broken
native binding, etc.) the entire plugin layer init blocks until the process is killed; the
existing logError only fires on rejection, not on hang.

The npm-install-related hang from #33905 was fixed in #33905 itself. The two call sites in
plugin/index.ts still have no timeout and are unrelated to that fix.

Plugins: n/a
OpenCode version: dev (dc4449d)

Steps to reproduce:

  1. Add a plugin to the internal plugins list whose plugin(input) returns a never-resolving
    Promise (or whose config hook does the same).
  2. Start opencode against any project directory.
  3. Plugin layer init never returns. No log line identifies which plugin is stuck.

Expected behaviour:

  • The offending call fails or times out within a few seconds.
  • The layer continues with the remaining plugins.
  • The log identifies the plugin by name (or by index) so the misbehaving one is locatable.

Actual behaviour:

  • The layer init blocks indefinitely.
  • No log line is emitted until the process is killed externally.

Operating System: n/a (reproducible on any platform)
Terminal: n/a

Related / duplicate check:

Activity

  1. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    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