feat(mcp): show loading pill and gate tool dispatch on readiness#687
Merged
esengine merged 1 commit intoMay 12, 2026
Conversation
Tool calls invoked during MCP handshake were surfacing transport errors because the bridge had no signal that the server was still connecting. A per-server readiness deferred lets dispatches wait (capped at 30s) instead of failing, and a status-bar pill makes the otherwise-invisible background load legible to the user.
This was referenced May 12, 2026
esengine
added a commit
that referenced
this pull request
May 12, 2026
…il, CardStream fix (#705) npm-only release. The Tauri desktop source is in the repo and the CLI subcommand works, but installer bundles for macOS / Windows / Linux don't ship this round (separate release once signing's settled). Highlights: - Tauri desktop client with multi-tab concurrent runtimes (#689) plus a near-full polish pass: wallet balance, version chip, active- plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n, shared pause-policy module dedup'd with the CLI TUI (#701) - checkpoint API + git-changes panel in the embedded dashboard (#682) - outside-sandbox file access approval modal (#696) - MCP loading pill + readiness gate on tool dispatch (#687) - escalate-after flag for flash → pro threshold (#699) Fixes: - CardStream Maximum-update-depth crash, quantize window so boundary cards stop oscillating (#700, #702) - `reasonix code` bridges config key to env + lazy subagent client so fresh installs can reach the setup wizard (#703) - pinned-mode scroll shrinks coalesced (#666), generic CSI key decode (#692), shell-confirm preview clamp (#691), frontmatter BOM/folded lines (#690), MCP error classification (#688), and more
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…ngine#687) Tool calls invoked during MCP handshake were surfacing transport errors because the bridge had no signal that the server was still connecting. A per-server readiness deferred lets dispatches wait (capped at 30s) instead of failing, and a status-bar pill makes the otherwise-invisible background load legible to the user.
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…il, CardStream fix (esengine#705) npm-only release. The Tauri desktop source is in the repo and the CLI subcommand works, but installer bundles for macOS / Windows / Linux don't ship this round (separate release once signing's settled). Highlights: - Tauri desktop client with multi-tab concurrent runtimes (esengine#689) plus a near-full polish pass: wallet balance, version chip, active- plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n, shared pause-policy module dedup'd with the CLI TUI (esengine#701) - checkpoint API + git-changes panel in the embedded dashboard (esengine#682) - outside-sandbox file access approval modal (esengine#696) - MCP loading pill + readiness gate on tool dispatch (esengine#687) - escalate-after flag for flash → pro threshold (esengine#699) Fixes: - CardStream Maximum-update-depth crash, quantize window so boundary cards stop oscillating (esengine#700, esengine#702) - `reasonix code` bridges config key to env + lazy subagent client so fresh installs can reach the setup wizard (esengine#703) - pinned-mode scroll shrinks coalesced (esengine#666), generic CSI key decode (esengine#692), shell-confirm preview clamp (esengine#691), frontmatter BOM/folded lines (esengine#690), MCP error classification (esengine#688), and more
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.
Summary
Tool calls dispatched while an MCP server is still handshaking were surfacing transport errors because the bridge had no signal that the connection wasn't ready yet. This adds a per-server readiness gate that dispatches await (capped at 30s) before invoking
live.callTool, plus a status-bar pill so the otherwise-invisible background load is legible to the user.Changes
src/cli/commands/chat.tsx: track a per-serverreadydeferred increateMcpRuntime, resolve it on theconnectedlifecycle event, and reject it ondisabled/failedso awaiting dispatches fail fast with a meaningful reason. Passreadythrough tobridgeMcpTools.src/mcp/registry.ts: extendBridgeOptions/BridgeEnvwithready,readyTimeoutMs, andserverName. Add awaitForReadyhelper that races the readiness promise against the timeout and the call'sAbortSignal, and await it at the top of every bridgedcallToolclosure. Default timeout isDEFAULT_READY_TIMEOUT_MS(30_000ms).src/cli/ui/App.tsx: dispatch amcp.loadingevent from the lifecycle sink — initialised at{ ready: 0, total: specs.length }, bumped onconnected/disabled/failedso the pill clears once every server reaches a terminal state.src/cli/ui/state/events.ts,src/cli/ui/state/reducer.ts,src/cli/ui/state/state.ts: add themcp.loadingaction, its zod schema, and anmcpLoading?: { ready, total }field onStatusBar. The reducer drops the field whentotal <= 0and short-circuits no-op updates.src/cli/ui/layout/StatusRow.tsx: render a⌁ MCP n/mpill (newMcpLoadingPillcomponent) only whileready < total.src/i18n/EN.ts,src/i18n/zh-CN.ts,src/i18n/types.ts: add thestatusBar.mcpLoadingtranslation key ("MCP"in both locales) with a JSDoc note describing the rendered format.Testing
npm test -- tests/mcp/registry-readiness.test.ts— covers acallToolinvoked mid-handshake resolving once the readiness deferred settles.Notes
readyTimeoutMsonBridgeOptionsfor callers that want to override it.ready.catch(() => undefined)is attached at construction so a server that fails before any tool is invoked doesn't trigger an unhandled rejection.ready < total; once every server reachesconnected/disabled/failedit disappears, so there's no separate teardown event to manage.Closes #638