Skip to content

[FEATURE]: Surface readable error messages when custom tool plugins fail to load #34933

Description

@joaomj

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When a custom tool plugin in ~/.config/opencode/tools/ fails to load (e.g. missing npm dependency, syntax error, or module resolution failure), opencode surfaces a generic "Unexpected server error. Check server logs for details." to the user with no indication of what went wrong.

The server log itself shows a raw ResolveMessage stack trace with no user-friendly explanation:

ResolveMessage: Cannot find module '@opencode-ai/plugin' from '/home/user/.config/opencode/tools/slack_lint.ts'

This requires the user to:

  1. Know that server logs exist at ~/.local/share/opencode/log/opencode.log
  2. Dig through thousands of log lines
  3. Parse a raw Bun module resolution error to understand the problem

Proposed solution

Surface tool-load failures as readable messages in the UI/CLI instead of the opaque "Unexpected server error". At minimum, log the error in a way that clearly states what failed and how to fix it — for example:

Failed to load tool slack_lint: missing dependency @opencode-ai/plugin. Run npm install in your config directory.

This would save users significant debugging time and make custom tool development much more approachable.

Activity

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