🤖 This was written by an AI agent on behalf of @paolomainardi.
Description
The cavecrew agent files shipped in agents/ use a YAML array for the tools frontmatter field:
tools: [Read, Grep, Bash]
OpenCode expects tools to be an object (map of tool name to boolean) or undefined — not an array. This causes OpenCode to reject the config on startup:
Configuration is invalid at /home/user/.config/opencode/agents/cavecrew-reviewer.md
↳ Expected object | undefined, got ["Read","Grep","Bash"] tools
OpenCode refuses to start until the invalid file is removed. The only workaround is rm -rf ~/.config/opencode/agents/, which also removes any user-created agent files.
Affected files
All three cavecrew agents have the same issue:
agents/cavecrew-reviewer.md — tools: [Read, Grep, Bash]
agents/cavecrew-builder.md — likely same pattern
agents/cavecrew-investigator.md — likely same pattern
Root cause
installOpencode() in bin/install.js copies agent files verbatim from the repo's agents/ directory into ~/.config/opencode/agents/. These agent files were written for Claude Code's frontmatter schema, which accepts a tools array. OpenCode uses a different schema where tools must be an object or omitted entirely.
The correct OpenCode format uses permission instead of tools:
permission:
read: allow
grep: allow
bash: allow
edit: deny
Suggested fix
Either:
- Convert the frontmatter to use OpenCode's
permission schema before copying (transform in installOpencode())
- Ship separate OpenCode-compatible agent files (e.g. in
src/plugins/opencode/agents/)
- Strip the
tools field when copying to the OpenCode agents dir, since OpenCode defaults to allowing all tools when the field is omitted
Environment
- OpenCode latest
- caveman: installed via
node bin/install.js --only opencode
- OS: Linux (Arch)
Description
The cavecrew agent files shipped in
agents/use a YAML array for thetoolsfrontmatter field:OpenCode expects
toolsto be an object (map of tool name to boolean) or undefined — not an array. This causes OpenCode to reject the config on startup:OpenCode refuses to start until the invalid file is removed. The only workaround is
rm -rf ~/.config/opencode/agents/, which also removes any user-created agent files.Affected files
All three cavecrew agents have the same issue:
agents/cavecrew-reviewer.md—tools: [Read, Grep, Bash]agents/cavecrew-builder.md— likely same patternagents/cavecrew-investigator.md— likely same patternRoot cause
installOpencode()inbin/install.jscopies agent files verbatim from the repo'sagents/directory into~/.config/opencode/agents/. These agent files were written for Claude Code's frontmatter schema, which accepts atoolsarray. OpenCode uses a different schema wheretoolsmust be an object or omitted entirely.The correct OpenCode format uses
permissioninstead oftools:Suggested fix
Either:
permissionschema before copying (transform ininstallOpencode())src/plugins/opencode/agents/)toolsfield when copying to the OpenCode agents dir, since OpenCode defaults to allowing all tools when the field is omittedEnvironment
node bin/install.js --only opencode