fix(mcp): MCP servers cannot block interaction in interactive mode - #3521
Open
meowgorithm wants to merge 3 commits into
Open
fix(mcp): MCP servers cannot block interaction in interactive mode#3521meowgorithm wants to merge 3 commits into
meowgorithm wants to merge 3 commits into
Conversation
The interactive coordinator gated every run on mcp.WaitForInit, which waits for every configured MCP server to finish connecting. Sending a prompt before init completed — typically the first message in a session — froze the UI spinner for the duration of the slowest server's connect timeout (10s by default, up from 120s before #3509), making Crush feel broken on startup. Build the tool list from whatever is registered at send time instead. Servers still connecting publish EventToolsListChanged when ready and their tools appear on the next run; the TUI already surfaces per-server status so nothing fails silently. The non-interactive path (crush run) still waits explicitly in App.RunNonInteractive before starting work — there the user has no status UI and expects the full tool palette, so waiting once up front is correct. 💘 Generated with Crush Assisted-by: Crush:kimi-k3
Interactive sessions no longer freeze while MCP servers are still connecting: prompts send immediately and tools from late servers appear on subsequent turns. One-shot non-interactive runs still wait, bounded by each server's connect timeout, so their tool palette is complete. 💘 Generated with Crush Assisted-by: Crush:anthropic/claude-opus-5
Makes it possible to tell from the debug logs which configured server is slow to start, instead of only learning that one failed. 💘 Generated with Crush Assisted-by: Crush:anthropic/claude-opus-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves UX around slow MCPs in interactive sessions.