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
Plugin tools registered with codemode: true are listed in the session catalog, but calls fail with "Unknown tool" whenever a watcher-triggered plugin reload lands while that turn is in flight. The reload releases the old plugin generation's registrations, so the tool the model is already calling no longer resolves.
Environment
opencode version: 0.0.0-next-16902
OS: Darwin 25.6.0 (arm64)
Terminal: ghostty (xterm-256color)
Shell: /bin/zsh
Install/channel: next (npm)
Active plugins: ~/.config/opencode/plugins/goal.ts, loop.ts, moshi-hooks.ts
Reproduction
Add a plugin registering a tool via ctx.tool.transform with options: { codemode: true }.
Start a turn that will call the tool.
While the turn is running, edit/touch any file under ~/.config/opencode/plugins/ (the config watcher reloads all plugins).
Model calls the tool → runtime rejects with "Unknown tool", even though the tool is in the catalog shown to the model.
Expected Behavior
In-flight tool calls keep working; the session context reflects the post-reload tool registry (or the reload waits for the turn to finish).
Actual Behavior
Intermittent "Unknown tool" failures on exactly the plugin-provided tools, matching the timing of watcher reloads. Recovered on the next turn. Saw this twice in one session, both times tied to plugin file mtime changes mid-turn.
Additional Context
Workaround: restart the service after any plugin file edit. Nothing in the plugin API lets a plugin pin its registration across a reload, so this needs a server-side fix: e.g. reload should not release tool registrations mid-turn, or the session context/tool resolution should rebuild after reload.
This issue might be a duplicate of existing issues. Please check:
fix(core): isolate invalid plugin tools during reload #35963: Closely related — covers plugin reload invalidating tool registrations, breaking session materialization, and the lack of atomic/isolated per-plugin reload semantics. The mid-turn race described here (watcher reload while a tool call is in flight) is a specific manifestation of the broader reload isolation gap tracked there.
Activity
github-actions commentedon Aug 6, 2026
This issue might be a duplicate of existing issues. Please check:
akramdotsh commentedon Aug 6, 2026
Closing as duplicate of #35963, which tracks the broader plugin reload isolation gap. The repro steps here remain a concrete manifestation of it.