From 3db2d03bb3cfc4ad8acaa2d644519d2470599d7f Mon Sep 17 00:00:00 2001 From: Xipeng Jin <56369076+xipeng-jin@users.noreply.github.com> Date: Mon, 15 Dec 2025 02:22:58 -0500 Subject: [PATCH] Stop spawning ACP/MCP servers with interactive shells (#44826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary: - Ensure the external agents with ACP servers start via non-interactive shells to prevent shell startup noise from corrupting JSON-RPC. - Apply the same tweak to MCP stdio transports so remote context servers aren’t affected by prompts or greetings. ### Description: Switch both ACP and MCP stdio launch paths to call `ShellBuilder::non_interactive()` before building the command. This removes `-i` on POSIX shells, suppressing prompt/title sequences that previously prefixed the first JSON line and caused `serde_json` parse failures. No functional regressions are expected: both code paths only need a shell for Windows/npm script compatibility, not for interactivity. Release Notes: - Fixed external agents that hung on “Loading…” when shell startup output broke JSON-RPC initialization. --- crates/agent_servers/src/acp.rs | 2 +- crates/context_server/src/transport/stdio_transport.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent_servers/src/acp.rs b/crates/agent_servers/src/acp.rs index 41aff48a2092645764d598684d13c1ce61704c44..e99855fe8a7241468e93f01fe6c7b6fee161f600 100644 --- a/crates/agent_servers/src/acp.rs +++ b/crates/agent_servers/src/acp.rs @@ -89,7 +89,7 @@ impl AcpConnection { cx: &mut AsyncApp, ) -> Result { let shell = cx.update(|cx| TerminalSettings::get(None, cx).shell.clone())?; - let builder = ShellBuilder::new(&shell, cfg!(windows)); + let builder = ShellBuilder::new(&shell, cfg!(windows)).non_interactive(); let mut child = builder.build_command(Some(command.path.display().to_string()), &command.args); child diff --git a/crates/context_server/src/transport/stdio_transport.rs b/crates/context_server/src/transport/stdio_transport.rs index 031f348294c04381f1e259b20c7cc818844953b4..e675770e9ee50df9993076e6d71c70befa118c4b 100644 --- a/crates/context_server/src/transport/stdio_transport.rs +++ b/crates/context_server/src/transport/stdio_transport.rs @@ -32,7 +32,7 @@ impl StdioTransport { cx: &AsyncApp, ) -> Result { let shell = cx.update(|cx| TerminalSettings::get(None, cx).shell.clone())?; - let builder = ShellBuilder::new(&shell, cfg!(windows)); + let builder = ShellBuilder::new(&shell, cfg!(windows)).non_interactive(); let mut command = builder.build_command(Some(binary.executable.display().to_string()), &binary.args);