Skip to content

v2: plugin tool URL attachments and cancellation signal #47458

Open

Description

@Eric-Guo

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.

Activity

  1. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please re-submit using one of the three required templates: Bug Report, Feature Request, or Question. Each template has required fields (e.g., a Description field for bugs, or a verification checkbox and description for features).

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Sep 5, 2026
  3. Eric-Guo commented on Sep 5, 2026

    @Eric-Guo
    ContributorAuthor

    Thanks for the guidance. I've updated this issue to use the Bug Report template, including the description, reproduction steps, version, and environment. Could a maintainer please recheck it and remove needs:compliance if it now meets the requirements?

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

  4. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! It now includes all the required information — clear description, reproduction steps, source references, and system details. The needs:compliance label has been removed.

  5. imarshallwidjaja commented on Sep 13, 2026

    @imarshallwidjaja

    Posting my use case. I'm porting a V1 plugin whose tools observe the V1 abort signal, and the missing execution-scoped signal is the one thing a Promise-only port cannot express. Wrapping everything in the Effect API works, but it means rewriting the tool layer, which is a lot to ask of plugins that just want to wire their fetch calls to session interruption. Related: #48838 (interruption during shell command creation has a similar ownership gap).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions