GeezerVison is showing github.com — feat(plugin): align plugin tool types with built-in tool capabilities by eXamadeus · Pull Request #8328 · anomalyco/opencode
Conversation
eXamadeus
commented
Jan 14, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What does this PR do?
Fixes: #8327
Related: #8269, #8380
Note This is complementary to the v2 SDK upgrade in #8380. This PR improves type safety of the ToolContext used for developing custom tools in plugins. The other PR is focused on upgrading the client capabilities for plugins. Similar, but slightly different goals.
This PR aligns plugin tool types with the capabilities tools already have. Specifically:
- Exposes
ToolContext fields to plugin tools: callID, extra, metadata(), and ask() to give plugins the correct context types
- Adds
ExecuteResult type allowing plugin tools to return structured result objects with title, metadata, output, and attachments instead of only plain strings
- Updates the registry to handle structured results from plugin tools, bypassing truncation when plugins return an
ExecuteResult directly (assuming tools till truncate...we could add a check here?)
- Exports all useful intermediate-types so plugin authors can use them more ergonomically.
This enables plugins to provide richer tool responses with proper metadata updates, closer matching the flexibility of built-in tools.
How did you verify your code works?
- Ran the test suite
- Ran TypeScript type checking
- Verified locally with a plugin in development that required proper metadata updates from plugin tools
The types all align nicely in the registry:

Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Fix plugin tool types to expose ToolContext fields and ExecuteResult
that built-in tools already have access to. The only functional change
is allowing plugin tools to return structured result objects (with title,
metadata, attachments) instead of only plain strings.
|
The following comment was made by an LLM, it may be inaccurate:
Based on my search, I found one potentially related PR:
Related PR:
This is related but not a duplicate since it's focused on a specific field addition rather than the broader alignment of plugin tool types with built-in capabilities that PR #8328 addresses.
No other duplicate PRs found.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|