fix(tui): skip ACP stdio autostart and suppress MCP child stderr in TUI mode#1730
Merged
fix(tui): skip ACP stdio autostart and suppress MCP child stderr in TUI mode#1730
Conversation
…UI mode ACP stdio transport and TUI mode are mutually exclusive — both own stdin/stdout. When --tui is active, configured_acp_autostart_transport now returns None for Stdio and Both transports (with a warning), and allows Http only when the acp-http feature is enabled. MCP child processes (e.g. mcpls) inherit stderr by default, which bleeds through ratatui's alternate screen and corrupts the display. McpManager gains a suppress_stderr flag (default false) that switches TokioChildProcess::builder().stderr(Stdio::null()) in TUI mode. The flag threads through create_mcp_manager and build_tool_setup; all non-TUI paths (acp, daemon) pass false. Adds 5 unit tests covering all transport/TUI combinations. Fixes #1729
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.
Summary
Fixes #1729 — running
zeph --tuiwith[acp] enabled = true(default transport =stdio) caused the TUI to never open.Two bugs fixed:
configured_acp_autostart_transportnow returnsNonewhen--tuiis active and transport isstdioorboth. HTTP transport is still allowed alongside TUI when theacp-httpfeature is enabled. A warning is logged when autostart is suppressed.McpManagergains asuppress_stderrflag (defaultfalse) that switches MCP child processes toStdio::null()in TUI mode, preventing subprocess logs from bleeding through ratatui's alternate screen.Changes
src/runner.rs— TUI guard inconfigured_acp_autostart_transport; passestui_activeassuppress_mcp_stderrtobuild_tool_setupcrates/zeph-mcp/src/client.rs—McpClient::connectacceptssuppress_stderr: bool; usesTokioChildProcess::builder().stderr()crates/zeph-mcp/src/manager.rs—McpManagergainssuppress_stderrfield andwith_suppress_stderrbuildercrates/zeph-core/src/bootstrap/mcp.rs—create_mcp_manageracceptssuppress_stderr: boolsrc/agent_setup.rs—build_tool_setupacceptssuppress_stderr: boolsrc/daemon.rs,src/acp.rs— passfalsetocreate_mcp_managercrates/zeph-core/src/bootstrap/tests.rs— updated call sitesTest plan
with_suppress_stderrbuildercargo nextest run --workspace --features full --lib --bins: 5427 passed, 12 skippedcargo clippy --workspace --features full -- -D warnings: cleancargo +nightly fmt --check: clean