GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Surface MCP server->client custom notifications to the session (push wake-up) · Issue #48855 · anomalyco/opencode

[FEATURE]: Surface MCP server->client custom notifications to the session (push wake-up) #48855

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: Surface MCP server->client custom notifications to the session (push wake-up)#48855
Copy link
Assignees
kitlangton

Description

@liagha
liagha
opened on Sep 13, 2026
Issue body actions

Summary

opencode's MCP client drops every server->client notification except notifications/message (forwarded to the logger) and notifications/tools/list_changed (triggers a tool re-list). Custom notifications like notifications/termgram/message, plus notifications/progress, are received then silently discarded — there is no path for a push-style MCP server to reach the session, the model, or plugin hooks.

This makes it impossible to build an MCP server that asynchronously wakes the agent (e.g. a Telegram assistant server pushing "new message arrived, reply now"). The only workaround today is client-polling tools (wait/watch loops), which are time-boxed (60–110s) and never fire mid-task.

Current behavior

packages/opencode/src/mcp/index.ts (~line 456):

  • client.setNotificationHandler(LoggingMessageNotificationSchema, …) → routes to serverLog() / the opencode logger
  • client.setNotificationHandler(ToolListChangedNotificationSchema, …) → re-fetch tool defs, publish ToolsChanged

No other setNotificationHandler is registered, so custom and progress notifications fall through silently.

Expected behavior

  1. Custom notifications/* from an MCP server should not be dropped: at minimum they should be observable (plugin hook / session event bus / SSE stream) with their method + params intact.
  2. A defined path for a notification to wake the session — forwarded as a steer/synthetic user turn so the current agent model gets it, subject to a per-server opt-in (capability or a session-level setting) so a noisy server cannot spam the model.

Use case

termgram (a personal Telegram MTProto MCP server, grammers-based) already pushes notifications/termgram/message with { chat, id, at, out, from, text, media } on every incoming message via the MCP protocol (verified working with a probe client; Peer::send_notification on rmcp 3.3). The agent never sees it. The goal: someone messages me on Telegram → opencode surfaces it → the assistant replies.

Related issues

  • promptAsync message persisted but session loop never scheduled — async wake prompts to idle session silently dropped #32010 — promptAsync wake prompts to idle sessions are silently dropped (the existing async-wake primitive is broken; any wake path here likely depends on fixing it)
  • [Bug]: TUI does not render externally injected (steer) turns or the assistant's reply while attached — data intact in DB (v1.18.26) #47622 — externally injected (steer) turns not rendered while TUI is attached
  • plugins: event.subscribe delivers no events; context-hook and synthetic injections never reach the model prompt (beta 18050) #44788 — plugin event.subscribe delivers zero events; context/synthetic injections never reach the model prompt
  • [FEATURE]: expose more v2 session APIs to plugins #35443 — feature request: more V2 session APIs for plugins, including session injection

Environment

  • opencode (CLI, current stable at time of report), termgram MCP server as local stdio transport, rmcp 3.3, protocol 2025-06-18
  • Linux x86_64
  • Existing wait tool clamps timeout 1–110s — there is no unbounded wait, so polling cannot substitute for push

Activity

  1. github-actions
    assigned
    kitlangton
    on Sep 13, 2026
  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    opencodejrBot
    on Oct 28, 2026
    Contributor
    More actions

    Thanks for the detailed write-up, @liagha!

    To restate the request: OpenCode should stop dropping custom MCP server→client notifications (e.g. notifications/termgram/message, notifications/progress). They should at least be observable with method and params intact. As an opt-in for each server, they could also wake the session as an injected turn, so a push-style server can trigger the agent.

    The current v2 MCP client (packages/core/src/mcp/client.ts) works the same way you describe. It only handles roots, elicitation and list-changed notifications, and drops everything else. The plugin API doesn't have a hook for incoming MCP notifications yet, so this can't be built as a plugin today either. Maintainers will consider it.

    Related issues:

    • plugins: event.subscribe delivers no events; context-hook and synthetic injections never reach the model prompt (beta 18050) #44788: plugin event.subscribe delivers no events and synthetic injections don't reach the prompt (relevant if a plugin-based wake path were used)
    • [FEATURE]: expose more v2 session APIs to plugins #35443: request to expose more v2 session APIs, including session injection, to plugins
    • promptAsync message persisted but session loop never scheduled — async wake prompts to idle session silently dropped #32010: promptAsync wake prompts to idle sessions dropped
    • [Bug]: TUI does not render externally injected (steer) turns or the assistant's reply while attached — data intact in DB (v1.18.26) #47622: externally injected steer turns not rendered in the attached TUI
  3. mattroe commented on Nov 16, 2026

    @mattroe
    mattroe
    on Nov 16, 2026
    More actions

    OpenCode 2 now has a standard path for this. Since v2.3.0 (#63254, #63269), with the experimental mcp_events flag on, opencode subscribes to a server's MCP Events (SEP-3415) over events/stream: the model calls watch_mcp_event, and each event wakes the session with a message. A watch stops after one event unless it's started with once: false, which matters for a Telegram inbox. So termgram would serve SEP-3415 events with push instead of a custom notification. OpenCode 1, which the default installer still gives, doesn't have it, and we haven't run it end to end or over stdio.

    I'm building Wakeshift (MCP Events for MCP servers) and keep track of which clients subscribe: https://wakeshift.ai/blog/state-of-mcp-events-2026-11

  4. WSHAPER
    added 2 commits that reference this issue on Nov 20, 2026

    feat(mcp): fired waits notify the orchestrating session

    f864128

    feat(mcp): reminder_start — scheduled self-reminders for the calling …

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

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.