Skip to content

v2: add optimistic UI while MCP prompt commands resolve #34860

Open

Description

@rekram1-node

Problem

V2 slash commands backed by MCP prompts can take noticeable time to resolve because command submission must call the MCP server's prompt resolution path before the prompt is admitted to the session.

Today there is no optimistic/pending UI for that resolution phase. If an MCP prompt command is slow, the submit experience can look like the prompt input is stalled or in an odd intermediate state before the resolved prompt appears in the session.

Expected behavior

After submitting an MCP prompt slash command, the TUI should immediately show an explicit pending/submitted command state while the server resolves the MCP prompt. The user should not be left looking at an apparently idle or stuck prompt input during that wait.

Reproduction aid

Temporarily add an artificial delay before MCP prompt evaluation:

diff --git a/packages/core/src/command.ts b/packages/core/src/command.ts
@@
-import { Context, Effect, Layer, Schema, Types } from "effect"
+import { Context, Duration, Effect, Layer, Schema, Types } from "effect"
@@
         const prompt = (yield* mcp.prompts()).find((prompt) => mcpCommandName(prompt.server, prompt.name) === input.name)
         if (!prompt) return yield* new NotFoundError({ command: input.name })
+        yield* Effect.sleep(Duration.seconds(3))
         const result = yield* mcp

Then submit an MCP prompt slash command with arguments. The UI should make the command resolution phase obvious and non-confusing during the artificial delay.

Activity

  1. zanemo109 commented on Aug 2, 2026

    @zanemo109

    I’d like to take this on. I’ve traced the current TUI submission path and plan to add a small pending/resolving state that appears immediately after an MCP-backed slash command is submitted, clears when resolution completes or fails, and is covered by a delayed-resolution regression test. Does that interaction and scope match what you had in mind?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions