Skip to content

Custom tools require a restart on first OpenCode start #13887

@demostanis

Description

@demostanis

Description

OpenCode installs @opencode-ai/plugin on first start to ~/.config/opencode/node_modules. However,
when having custom tools in ~/.config/opencode/tools, an error appears on the TUI:
error: Cannot find package 'zod' from '/home/demostanis/.config/opencode/node_modules/@opencode-ai/plugin/dist/tool.js'
(or similar with @opencode-ai/plugin)
A restart is needed for the error to disappear.
This is impactful on temporary systems, where ~/.config/opencode/node_modules will be frequently suppressed (my system runs on a tmpfs)

Plugins

opencode-pty, opencode-gemini-auth (don't think this is related)

OpenCode version

1.2.6

Steps to reproduce

  1. Add a tool to ~/.config/opencode/tools
  2. rm ~/.config/opencode/node_modules && rm ~/.bun
  3. opencode
  4. Prompt anything

Screenshot and/or share link

Image

Operating System

Arch Linux

Terminal

URxvt

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions