anomalyco / anomalyco/opencode

v2: plugin tool URL attachments and cancellation signal

Open
#47,458 4 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 5, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Hi, I found two limitations with V2 Promise plugin tools:

  • Code Mode silently drops HTTPS and file: attachments. The tool succeeds, but the outer files array is empty. Base64 data URIs are retained. Could supported references be preserved or resolved, or rejected explicitly if unsupported?
  • The Promise tool context exposes no AbortSignal, so plugins cannot connect their fetch calls to session interruption. Could an execution-scoped signal be provided? This concerns local cancellation, not cancellation of an external vendor job.

Related: #35364. Thank you for considering these.

Plugins

Local Promise plugin registering tools through context.tool.transform and tools.add.

OpenCode version

V2-based fork; checked the same relevant source paths in upstream v2 at 4306c07b340b9a0504e65785f366d2793cd1b169.

Steps to reproduce
  1. Register image_fixture with a string output schema and this return value:
{
  output: "ok",
  content: [{
    type: "file",
    uri: "https://example.com/image.png",
    mime: "image/png",
    name: "image.png",
  }],
}
  1. Call return await tools.image_fixture({}) inside execute.
  2. Observe successful output with files: []. A local Code Mode fixture reproduced the same filtering for file: URIs; base64 data URIs produced one file. No network request is needed.
  3. For cancellation, inspect the Promise tool context and adapter: neither exposes/passes an execution signal to the plugin. This finding is from source inspection.
Screenshot and/or share link

Source references: attachment filtering, tool context, Promise adapter.

Operating System

macOS 15.7.9

Terminal

Bash, running a Bun runtime fixture.

— Eric Guo (@Eric-Guo), with help from GPT 6 Astra.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.