anomalyco / anomalyco/opencode
v2: plugin tool URL attachments and cancellation signal
Open
@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 outerfilesarray 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
fetchcalls 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
- Register
image_fixturewith 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",
}],
}
- Call
return await tools.image_fixture({})insideexecute. - Observe successful output with
files: []. A local Code Mode fixture reproduced the same filtering forfile:URIs; base64 data URIs produced one file. No network request is needed. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.