Skip to content

fix(v2): point models at Code Mode for goal tools - #86

Merged
william-ricchiuti merged 3 commits into
mainfrom
wr/85-v2-tool-registration
Oct 19, 2026
Merged

william-ricchiuti merged 3 commits into
mainfrom
wr/85-v2-tool-registration

Conversation

@william-ricchiuti

Copy link
Copy Markdown
Owner

Fixes #85

Root cause

The tools are registered. OpenCode 2 runs Code Mode: the model gets one direct tool, execute, and every plugin tool is listed in a Code Mode catalog and callable only inside execute code as tools.goal_status(), tools.goal_complete({...}) and so on. The plugin's own prompts (the goal block, continuations, the goal agent) name the tools bare, so some models called goal_status directly, got a tool-not-found, and reported the goal tools as unavailable.

Reproduced with the reporter's exact setup: "plugins": ["opencode-goal-plugin@0.11.0"] in an isolated global config, on live OpenCode 2.0.31 and 2.0.16. On both, for both the build and goal agents, the direct tool list was edit, glob, grep, question, read, shell, skill, subagent, webfetch, websearch, write, execute, and the Code Mode catalog listed all 9 goal tools. This is not a 2.0.31 regression.

Change

  • src/v2-bridge.js: when the core registered its tools and a request offers execute but no direct goal tool, append one system note telling the model the goal tools are called inside execute (e.g. return await tools.goal_status()) with the catalog's signatures. Requests without Code Mode, with direct goal tools, or with registerTools: false are unchanged, and host system parts are preserved. The verifier (read/glob/grep only) gets no note.

Verification

Note: #83, #84 and this PR each add a CHANGELOG "Unreleased" entry, so later merges need small changelog rebases.

🤖 Generated with Claude Code

william-ricchiuti and others added 3 commits October 18, 2026 22:51
OpenCode 2 exposes plugin tools only inside the execute tool. The goal
prompts name tools bare, so models called goal_status directly and
reported the goal tools unavailable. Add a system note when a request
offers execute but no direct goal tool.

Fixes #85

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@william-ricchiuti
william-ricchiuti merged commit ac03d29 into main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCode 2.0.31: goal tools unavailable although /goal and goal agent register

1 participant