GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@eXamadeus eXamadeus commented Jan 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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
    • update: metadata() and ask() were added in fix: add missing metadata() and ask() defintions to ToolContext type #8269
  • 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:

Zight Recording 2026-01-13 at 09 43 34 PM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eXamadeus added 2 commits January 13, 2026 20:32
@eXamadeus
feat(plugin): align plugin tool types with built-in tool capabilities
eaa1350
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.
@eXamadeus
Merge remote-tracking branch 'base/dev' into dev
12f67ca
@github-actions

github-actions Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

  • PR feat(plugin): add optional askPermission to ToolContext #6042: feat(plugin): add optional askPermission to ToolContext
    • feat(plugin): add optional askPermission to ToolContext #6042
    • This PR also deals with extending ToolContext for plugins, adding the askPermission field. Your current PR (feat(plugin): align plugin tool types with built-in tool capabilities #8328) expands on this by exposing additional ToolContext fields (callID, extra, metadata(), and ask()).

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

eXamadeus added 4 commits January 13, 2026 21:12
@eXamadeus
Ensure types are exported so plugin devs can import them if needed
07ff576
@eXamadeus
Prefer const over let
da80558
@eXamadeus
Reorder types to minimize diff
9374627
@eXamadeus
Remove Input type, it's not really useful by itself
da3af42
@eXamadeus eXamadeus mentioned this pull request Jan 14, 2026
[FEATURE]: Plugin package tool types should stay aligned #8327
Closed
1 task done
eXamadeus
eXamadeus commented Jan 14, 2026
View reviewed changes
Comment thread packages/plugin/src/tool.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@eXamadeus eXamadeus mentioned this pull request Jan 17, 2026
feat(plugin): align plugin tool types with built-in tool capabilities #9138
Closed
@eXamadeus

eXamadeus commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #9138

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eXamadeus eXamadeus closed this Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Plugin package tool types should stay aligned

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@eXamadeus
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.