Skip to content

Server plugins that fail to load are silently dropped (no stderr output) #34742

Description

@zaninime

Description

When a configured server plugin (the plugin key in config) fails to load, opencode drops it with no visible diagnostic. The failure only surfaces as a session Error event (easy to miss), and the "no entrypoint" case is swallowed entirely by a no-op missing reporter. The result: a plugin that is present and correctly resolved but throws at import() time looks exactly like a plugin that was ignored.

This makes plugin problems very hard to diagnose. In my case a file:// plugin appeared to be "ignored" while npm plugins worked, which led me to suspect the file:// resolution logic. It was actually fine - the plugin's module threw ENOENT during evaluation (a top-level readFileSync of an asset that was missing from the package). Nothing was printed to stderr, so there was no signal pointing at the real cause.

Plugins

No response

OpenCode version

1.17.12

Steps to reproduce

  1. Configure a file:// (or npm) server plugin whose module throws during evaluation — e.g. a top-level readFileSync/import of a file that doesn't exist at runtime.
  2. Start opencode.
  3. Observe: the plugin's hooks never run, and there is no error on stderr indicating why.

Screenshot and/or share link

No response

Operating System

macOS 26.5.1

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions