Skip to content

[FEATURE]:background task notification when long-running tool calls complete #36230

Closed

Description

@ikhwan-Ap

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

When using MCP tools that run async/background jobs (common with AI orchestration servers, CI pipelines,
build tools, etc.), the agent has no way to know when the job completes other than polling a status endpoint
repeatedly.

A typical 2-4 minute background job results in 20-40 redundant polling calls that:

  • Waste tokens and clutter the conversation
  • Make the agent appear stuck/frozen to the user
  • Prevent the agent from doing other productive work while waiting
  • Provide zero value until the final poll returns "finished"

Expected Behavior

The agent should be able to dispatch a background tool call and receive a notification when it completes,
rather than manually polling in a loop.

Possible approaches:
Expected Behavior

The agent should be able to dispatch a background tool call and receive a notification when it completes,
rather than manually polling in a loop.

Possible approaches:

  1. Consume MCP notifications/progress — The MCP spec already defines progress/task notifications for this
    exact purpose. If opencode listened for server-pushed notifications and injected them into the agent
    context, polling would be unnecessary.

  2. Background tool call mode — Allow marking a tool call as async, where the result is delivered later (
    pushed into conversation when ready). Agent continues other work in the meantime.

  3. CLI progress indicator — Show a spinner/status in the terminal while waiting, and alert the agent/user on
    completion.
    Current Behavior

Agent must call a get_status(jobId) tool every 5 seconds in a loop:

status_check → "running" (useless)
status_check → "running" (useless)
status_check → "running" (useless)
... × 20
status_check → "finished" (finally useful)

This is the equivalent of while true; do curl status; sleep 5; done — functional but wasteful.

Use Cases

  • MCP servers that dispatch long-running LLM/AI jobs
  • Build/test pipelines triggered via MCP tools
  • Any async workflow where result takes >30 seconds
Image

Activity

  1. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Add MCP/TUI notification bridge for async plugin results #30020: [FEATURE]: Add MCP/TUI notification bridge for async plugin results — requests MCP notification plumbing so plugins can send async events back to the session when background work finishes, which directly overlaps with the MCP progress/notification approach described here.
    • [feat] True Async/Background Sub-Agent Delegation #5887: [feat] True Async/Background Sub-Agent Delegation — requests a fire-and-forget mechanism with completion notifications so the agent can continue working while background tasks run, closely related to the background tool call mode proposed here.

    Please review those issues and consider adding your use case or upvoting there if they cover your request.

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