anomalyco / anomalyco/opencode

[FEATURE]: Support the MCP Tasks extension (SEP-2663)

Open
#49,227 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 15, 2026.

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

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Describe the enhancement you want to request

Summary

Add client support for the MCP Tasks extension (io.modelcontextprotocol/tasks, SEP-2663, spec in modelcontextprotocol/ext-tasks) so that an MCP tool call which returns a task handle is treated as background work: the session keeps going (or goes idle), OpenCode polls the task, and when it completes the result is delivered to the session that made the call as if the tool had just returned.

Why

Some MCP tools can't answer immediately: CI/deploy jobs, batch processing, or anything that needs a human approval step (e.g. an internal server that gates network/credential access behind an out-of-band operator approval). Today an MCP server has exactly two options with OpenCode, and both are bad:

  1. Block inside tools/call until the work finishes. This holds the model turn hostage (it can't do independent work), relies on long timeouts, and a dropped connection loses the call. In the 2026-07-28 revision there is no stream resumability any more, so a broken response stream means the request is simply gone.
  2. Return "pending" immediately and ask the model to poll a status tool. This burns tokens and turns while the agent sleeps-and-retries, and once the agent decides to return control to the user there is nothing that wakes the session when the work finishes.

The Tasks extension exists precisely for this. The extension docs list "human approvals" and "approval gates, review steps" as first-class use cases, and explain "why not just block". With client support, the wake-up problem is solved in a harness-independent, spec-conformant way instead of each server needing OpenCode-specific hooks.

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.