Repository navigation
fix(dsh): gate MCP bridge on daemon health - #250
Merged
Merged
Conversation
Mount the official MCP client only while the lifecycle reports up. Await the child fiber so mounted means connected and registered, and dispose it on daemon loss so last-known tools cannot hang calls. Retry after recovery without restarting DSH or duplicating serverName. Update panel guidance and DSH docs, and cover attach/managed transitions, peer-missing, panel:false, disposal, and a real official-peer mount/dispose cycle.
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.
Follow-up to the reviewer feedback on awesome-dsh-plugin#9167.
问题
默认
attach模式下 daemon 未运行时,面板显示「Mebular 未运行」,但 MCP bridge 仍被挂载:官方 client 初次连接失败后保持激活并后台重试,已连接后掉线时还会保留 last-known tools,工具调用可能等到 60s 超时,表现为“静默等待”。根因:
apply()在lifecycle.start()后立即mountMcp(),没有等待健康状态。mountMcp()固定failOnStartupError: false,且立即记录mcp client mounted。mountMcp()丢弃了ctx.plugin()的 fiber,无法在 daemon 掉线时卸载。/mebular/embed-info走 lifecycle,MCP bridge 走独立链路,二者没有同步。修复
up时挂载官方 client;starting/down不挂载。ctx.plugin()fiber dispose,注销工具,并记录mcp bridge detached (daemon_unreachable)。mountMcp()改为failOnStartupError: true,await fiber settle 并检查 active;只有真正连接/注册成功后才记录 mounted。失败时 dispose 子 fiber、返回稳定错误码,由 supervisor 重试,不影响父插件。managed的starting不挂载;managed_start_failed/managed_cli_missing有稳定日志且不挂载。验证
npm test -- --runInBand tests/dsh:4 suites / 91 tests passednpm run verify:dsh-plugin:129 checks passednpm run lint:passednpm run check:docs:7/7@deepseek-ai/dsh-mcp-client+ 本地 Streamable HTTP MCP server;验证工具注册、dispose 注销、相同 serverName 重挂、不可达 daemon 快速失败。范围
v0.1.1。