You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
custom tool with plain-object args silently fails to register #45532
A custom tool whose args are a plain JS object (not a Zod schema) never registers, and no error or warning is printed. tool() expects z.ZodRawShape (packages/plugin/src/tool.ts:45); a plain object is neither coerced nor rejected — it's silently dropped. Expected: either accept a plain JSON-schema object, or emit a clear "args must be a Zod schema" error at registration.
Workaround: use a Zod schema for args.
Plugins
none
OpenCode version
1.18.16
Steps to reproduce
Define a custom tool in .opencode/tools/ with args as a plain object,
e.g. args: { foo: "string" }.
Start OpenCode (or run headless).
The tool is absent from the tool list with no diagnostic message.
Screenshot and/or share link
No response
Operating System
Ubuntu 24.04 (aarch64)
Terminal
non-interactive (openshell sandbox exec -- sh -c, --no-tty)
Activity
fancive commentedon Aug 30, 2026
I can take this. I have a small validation fix with regression coverage and will open a PR shortly.
thdxr commentedon Oct 11, 2026
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊