Skip to content

Integrate MCP plugin fixes / 集成 MCP 插件修复#4866

Merged
SivanCola merged 11 commits into
esengine:main-v2from
SivanCola:fix/mcp-plugin-integration-4788
Jun 19, 2026
Merged

Integrate MCP plugin fixes / 集成 MCP 插件修复#4866
SivanCola merged 11 commits into
esengine:main-v2from
SivanCola:fix/mcp-plugin-integration-4788

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

This integration PR combines the MCP/plugin-related work from:

It is intended to supersede those individual PRs with one rebased integration branch on top of the latest main-v2.

Closes #4734.

Repository contributors

Authorship note: original commits preserve their primary authors where practical. @SivanCola contributed as a collaborator by reviewing the implementation, fixing follow-up issues found during review, integrating the related PRs, and verifying the final state.

Verification

  • GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test ./internal/plugin ./internal/config ./internal/fileutil ./internal/control ./internal/agent ./internal/bot -count=1 passed
  • GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test -race ./internal/plugin -run TestHTTPTransportReinitializesExpiredSession -count=1 passed
  • GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test ./... -count=1 passed in desktop/
  • pnpm --dir desktop/frontend check:css passed with the bundled runtime
  • git diff --check passed

Local note: pnpm --dir desktop/frontend typecheck could not complete in this worktree because the Wails generated binding module was absent; the reported generated-binding import is not introduced by this integration diff.

Cache impact

Cache-impact: low - this touches cache-sensitive MCP/plugin, boot, and config code, but the intended behavior changes are runtime/session recovery, desktop/runtime hardening, config migration/parsing, and resource limits; no provider-visible prompt prefix, memory prefix, or tool schema ordering change is intended.
Cache-guard: focused MCP/plugin tests and the HTTP reinitialize race test were run; git diff --check passed, and the PR body explicitly documents the cache-sensitive surface.
System-prompt-review: @SivanCola reviewed the integrated boot/config/plugin changes for provider-visible prefix impact; no system prompt, memory prefix, output style, or skill index text change is intended.

Xio-Shark and others added 6 commits June 20, 2026 00:09
Two code paths were splitting MCP server commands on whitespace
without the shouldSplitPluginCommand guard that NormalizePluginCommandLine
has, which truncated any command path with spaces.

1. Frontend AddServerForm / EditServerForm (CapabilitiesPanel.tsx):
   split(/\s+/) on the command field before sending to the Go backend.
   A path like "C:\Program Files\MyApp\server.exe" became command
   "C:\Program" with args ["Files\MyApp\server.exe"].

2. Legacy config parser (mcpjson.go parseLegacyMCPSpec):
   Always split the body on spaces.  The v0.x config.json format uses
   "name=command args..." lines; for paths with spaces like
   "ida=C:\PersonalData\Software\Learn\IDA Pro\ida_bridge.bat", this
   truncated the command to "C:\PersonalData\Software\Learn\IDA".

Fix: in the frontend, pass the full command string through and let
NormalizePluginCommandLine handle the split on the Go side.  In
parseLegacyMCPSpec, only split when shouldSplitPluginCommand returns
true (known runner like npx/node, or quoted command), otherwise keep
the full body as the command.

Fixes e.g. IDA Pro MCP server configuration where the binary path
contains spaces.
Keep startup capability flags immutable during runtime HTTP session refreshes so expired-session recovery does not race with concurrent capability readers.

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
Keep the integrated migration test file gofmt-clean after combining the MCP-related PRs.

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
@SivanCola SivanCola requested a review from esengine as a code owner June 19, 2026 16:18
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) agent Core agent loop (internal/agent, internal/control) mcp MCP servers / plugins (internal/plugin, codegraph) config Configuration & setup (internal/config) labels Jun 19, 2026
Run gofmt on the integrated bot and control changes so the CI formatting gate passes.

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
Skip Unix permission-bit assertions on Windows, where os.FileMode only reflects limited permission state.

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3791f7a37f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/frontend/src/components/CapabilitiesPanel.tsx
Comment thread internal/config/mcpjson.go
Comment thread internal/config/edit.go Outdated
Comment thread internal/plugin/plugin.go Outdated
Comment thread internal/config/migrate.go Outdated
Comment thread internal/plugin/lazy.go
@SivanCola SivanCola merged commit db43de8 into esengine:main-v2 Jun 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) mcp MCP servers / plugins (internal/plugin, codegraph) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MCP Streamable HTTP 有状态模式下,会话过期后客户端未自动重新初始化

4 participants