From a1ed78ccbc540b03725ea2c2168e2ba402d50e11 Mon Sep 17 00:00:00 2001 From: Delicious233 <101502465+DeliciousBuding@users.noreply.github.com> Date: Mon, 17 Aug 2026 18:42:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(edge):=20ACP=20MCP=20=E6=9C=AA=E6=8E=A5?= =?UTF-8?q?=E7=BA=BF=E6=97=B6=E5=8F=91=E5=8F=AF=E8=A7=81=E9=99=8D=E7=BA=A7?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runACPSession 在 rc.MCPConfig 非空时发 BusEventStatusChange(status=degraded, reason=acp_mcp_not_wired)+ slog.Warn,把静默的 MCP 工具不可用变成可见失败。full wiring 留给 #1404。 Co-authored-by: Cursor --- edge-server/internal/adapters/acp_client.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/edge-server/internal/adapters/acp_client.go b/edge-server/internal/adapters/acp_client.go index ca6d9cb52..564b8cf11 100644 --- a/edge-server/internal/adapters/acp_client.go +++ b/edge-server/internal/adapters/acp_client.go @@ -374,7 +374,20 @@ func runACPSession(ctx context.Context, stdout io.Reader, stdin io.Writer, emitt initResp.ProtocolVersion, acp.ProtocolVersionNumber)) } - // 2. session/new. + // 2. session/new. MCP server config from the run profile is not yet wired + // into the ACP session (frame design deferred, #1404). When a profile + // declares MCP servers, surface the gap as a visible status-change event + // + warning log so the user sees *why* MCP tools are unavailable instead + // of a silent absence. + if rc.MCPConfig != "" { + slog.Warn("acp: MCP config present but not wired into ACP session; MCP tools will be unavailable", + "run_id", run.ID, "reason", "acp_mcp_not_wired") + emitter.Emit(BusEventStatusChange, acpRunScope(run), map[string]any{ + "status": "degraded", + "reason": "acp_mcp_not_wired", + "message": "MCP servers configured in this profile are not available in the ACP execution path", + }) + } sessResp, err := conn.NewSession(ctx, acp.NewSessionRequest{ Cwd: rc.WorkDir, McpServers: []acp.McpServer{}, // TODO(#1404): wire RunProcessContext.MCPConfig