fix(plugins): 加固插件更新、服务与 MCP Gateway 生命周期#462
Merged
Conversation
TGGgbone
force-pushed
the
fix/plugin-runtime-update-lifecycle
branch
from
July 19, 2026 08:35
702cd58 to
53b0049
Compare
TGGgbone
force-pushed
the
fix/plugin-runtime-update-lifecycle
branch
from
July 19, 2026 14:50
53b0049 to
61698c5
Compare
TGGgbone
force-pushed
the
fix/plugin-runtime-update-lifecycle
branch
from
July 20, 2026 04:47
61698c5 to
8aeb043
Compare
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.
一句话总结
收口插件运行时替换、PM2 服务、link 开发模式和 MCP Gateway 的生命周期,并把 #459 的会话识别修复合入本 PR。
关键变更
1. 安装、更新、卸载使用同一条受锁生命周期
botmux plugin service stop <id>。2. PM2 与 link 开发模式
kill_timeout。dist/botmux-build,缺失时回退dist。3. MCP Gateway 生命周期与会话身份
botmux mcp serve只作为 stdio ↔ Unix socket relay,不读取 runtime snapshot 或插件密钥。resolveSessionContext恢复 Botmux session;Codex/Claude 显式转发BOTMUX_SESSION_ID、SESSION_DATA_DIR和 Gateway socket 环境。SESSION_DATA_DIR均可解析;diagnostics 写入失败不会中断 MCP 服务。4. MCP 私密配置与隔离
plugins-registry.json只保存 MCP 的name、transport和privateRef。~/.botmux/plugins/<id>/private/mcp.json,目录0700、文件0600。plugin-mcp-runtime.json,但该 snapshot、private descriptor 和安装源dist/mcp/index.json均保持 host-only,不向 CLI 开放。timingSafeEqual的认证握手。/run,同时隐藏 snapshot/private/install source。bmcp-*Gateway 目录,再只读放行当前 session socket/token,并拒绝写入。dist/mcp/index.json仍由插件作者按原约定提供。影响面
验证
BOTMUX_NO_CLAIM=1 pnpm build:TypeScript、Dashboard bundle、dist audit 通过。pnpm exec tsc --noEmit:通过。initialize -> tools/list -> tools/call;snapshot、private descriptor、其它 session snapshot 和安装源均不可读。scanned=1, accepted=0。git diff --check:通过。origin/master的本地 merge-tree:无冲突。PR 关系