Skip to content

[BUG] If certain errors occurr during form elicitation, the elicitation dialog is stuck open #1604

@sbj42

Description

@sbj42

Issue

The elicitation dialog has an 'X' button which does nothing. See onOpenChange={() => {}} in ElicitationDialog.ts. That button should probably be hidden, or considered equivalent to the "Cancel" button.

The other buttons at the bottom attempt to complete the elicitation. If successful, the dialog closes. But if something goes wrong, those buttons fail to complete the elicitation and the dialog stays open.

In my case, I experienced a timeout during elicitation (see #1603). I think that timeout made the elicitation no longer active, and then I could not close the dialog.

If an error interferes with the elicitation, or at the very least if the elicitation is no longer active, then it might be a good idea to automatically close the dialog, or report an error and allow the user to close the dialog.

How to reproduce

  1. Connect to an MCP server with a tool that requests a form elicitation. My own code for this is fairly complicated. If you need a simple example I may be able to produce one. But you might be able to reproduce this with the example at https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/server/src/elicitationFormExample.ts
  2. Make sure the timeout for that server is the default 10 seconds.
  3. Run the tool that requests elicitation. The Elicitation Request dialog appears.
  4. Wait 15 seconds
  5. Press 'Cancel' at the bottom of the dialog. It does not close.
  6. Press the 'X' in the top-right of the dialog, it still does not close.

Expected Behavior

It should always be possible to close the dialog somwhow. At the very least, 'Cancel' should always lead to the dialog closing, even if an error occurs while trying to cancel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions