Skip to content

Support async updates for MCP prompts in V2 #34541

Closed

Description

@rekram1-node

Summary

MCP prompt support in V2 currently treats prompt discovery as static. Add async update support so servers that emit notifications/prompts/list_changed can refresh prompt-derived state without requiring restart/reload.

Context

PR #34531 adds MCP prompt listing/get support but intentionally does not subscribe to prompt list-change notifications yet. Resource list-change plumbing can be handled separately with the resource work.

Scope

  • Subscribe to MCP prompts/list_changed for servers advertising prompts.listChanged.
  • Refresh any prompt-derived V2 state asynchronously.
  • Avoid blocking unrelated plugin/startup paths on slow MCP startup.
  • Add tests or a small MCP lifecycle fixture for prompt list changes.

Activity

  1. self-assigned this
    on Jun 30, 2026
  2. github-actions commented on Jun 30, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue appears to be a feature request but does not use the Feature Request template. The title should start with [FEATURE]: and include the required verification checkbox confirming the feature hasn't been suggested before.

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


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

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

  3. opencode-agent commented on Jun 30, 2026

    @opencode-agent
    Contributor

    Removed needs:compliance: this author is exempt under the team/opencode-agent automation guard.

  4. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST audit (2026-07-02):

    Current blockers/related work:

    Suggested tracker state: keep this blocked on #34531 plus #34685/#34429. Async prompt list refresh should update prompt-derived command state after the V2 command path exists.

  5. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST (2026-07-02):

    Related command work is now open:

    After #34849 lands, async MCP prompt updates should be re-evaluated against the command-shaped MCP prompt entries. Also see #34860 for MCP prompt optimistic UI.

  6. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST (2026-07-02): Related command work is now open: #34849 — feat(core): port v2 command invocation. After #34849 lands, async MCP prompt updates should be re-evaluated against the command-shaped MCP prompt entries. Also see #34860 for MCP prompt optimistic UI.

  7. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Aiden says V2 command support and V2 MCP prompt support should both be fully supported now; #34849 merged and covers MCP prompts as command-shaped entries plus invocation-time prompt resolution.

    Leaving this open unless/until someone confirms prompts/list_changed async refresh specifically is covered too, since this issue is narrower than basic MCP prompt execution.

    Source: https://discord.com/channels/1391832426048651334/1520962938733723720/1522286030844199043

  8. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Confirmed on latest v2: this is handled now.

    Evidence:

    • packages/core/src/mcp/index.ts has refreshPrompts(...) updating entry.prompts and publishing Command.Event.Updated.
    • watch(...) subscribes connection.onPromptsChanged(() => fork(refreshPrompts(...))), which covers prompt list-change notifications.
    • connect/reconnect also refreshes prompts and publishes command updates when prompt state changes/clears.
    • packages/core/src/command.ts derives MCP prompt commands from mcp.prompts() and evaluates via mcp.prompt(...) at invocation time.
    • TUI data context refreshes commands on command.updated.

    Source confirmation from Aiden: https://discord.com/channels/1391832426048651334/1520962938733723720/1522286269093249217

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions