anomalyco / anomalyco/opencode
custom tool with plain-object args silently fails to register
Open
@nexxeln is already working on this.
Since Aug 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.