Skip to content

fix(tui): skip ACP stdio autostart and suppress MCP child stderr in TUI mode#1730

Merged
bug-ops merged 1 commit intomainfrom
fix/tui-acp-stdio-autostart
Mar 14, 2026
Merged

fix(tui): skip ACP stdio autostart and suppress MCP child stderr in TUI mode#1730
bug-ops merged 1 commit intomainfrom
fix/tui-acp-stdio-autostart

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 14, 2026

Summary

Fixes #1729 — running zeph --tui with [acp] enabled = true (default transport = stdio) caused the TUI to never open.

Two bugs fixed:

  • ACP stdio/TUI conflict: configured_acp_autostart_transport now returns None when --tui is active and transport is stdio or both. HTTP transport is still allowed alongside TUI when the acp-http feature is enabled. A warning is logged when autostart is suppressed.
  • MCP child stderr corruption: McpManager gains a suppress_stderr flag (default false) that switches MCP child processes to Stdio::null() in TUI mode, preventing subprocess logs from bleeding through ratatui's alternate screen.

Changes

  • src/runner.rs — TUI guard in configured_acp_autostart_transport; passes tui_active as suppress_mcp_stderr to build_tool_setup
  • crates/zeph-mcp/src/client.rsMcpClient::connect accepts suppress_stderr: bool; uses TokioChildProcess::builder().stderr()
  • crates/zeph-mcp/src/manager.rsMcpManager gains suppress_stderr field and with_suppress_stderr builder
  • crates/zeph-core/src/bootstrap/mcp.rscreate_mcp_manager accepts suppress_stderr: bool
  • src/agent_setup.rsbuild_tool_setup accepts suppress_stderr: bool
  • src/daemon.rs, src/acp.rs — pass false to create_mcp_manager
  • crates/zeph-core/src/bootstrap/tests.rs — updated call sites

Test plan

  • 5 new unit tests added: stdio suppressed in TUI, both suppressed in TUI, http allowed (acp-http), http suppressed (no acp-http), with_suppress_stderr builder
  • cargo nextest run --workspace --features full --lib --bins: 5427 passed, 12 skipped
  • cargo clippy --workspace --features full -- -D warnings: clean
  • cargo +nightly fmt --check: clean

…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
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 14, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 12:12
@bug-ops bug-ops merged commit d4baaed into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the fix/tui-acp-stdio-autostart branch March 14, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tui): TUI dashboard does not open when ACP stdio autostart is enabled

1 participant