Files
codex/codex-rs/tui/tests/suite/unix_daemon.rs
T
Joe Savona 46f5a1df9f Render selected MCP statusline providers in the TUI footer (#61979)
## What changed

- With `tui_extensions_statusline` enabled, resolve the saved MCP provider and read its resource with a snapshot of the displayed thread's statusline state.
- Show initialization and error messages, validate the JSON UI tree response, and preserve provider content through native statusline refreshes. Ignore stale results when the thread, provider, or working directory changes.
- Request workspace headlines and thread usage for custom providers even when no built-in statusline items are selected.

## Testing

Add unit coverage for response validation and footer lifecycle, plus end-to-end tests for embedded and remote app servers, startup delays, current thread metadata, and rejection of project-level provider overrides.

GitOrigin-RevId: 80a46ec780c1f1536f1fd4749f468629627dedf6
2026-11-17 06:33:13 +00:00

37 lines
1.2 KiB
Rust

//! Launch a real app server for CLI tests that connect over a Unix socket.
use anyhow::Result;
use anyhow::ensure;
use std::path::Path;
use std::process::Stdio;
use std::time::Duration;
use tokio::process::Child;
pub(super) async fn start(home: &Path, extra_args: &[&str]) -> Result<(Child, String)> {
let socket = codex_app_server_client::app_server_control_socket_path(home)?;
let mut daemon = tokio::process::Command::new(codex_utils_cargo_bin::cargo_bin("codex")?)
.args(["app-server", "--listen", "unix://"])
.args(extra_args)
.env("CODEX_HOME", home)
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::inherit())
.kill_on_drop(true)
.spawn()?;
tokio::time::timeout(Duration::from_secs(30), async {
while tokio::net::UnixStream::connect(socket.as_path())
.await
.is_err()
{
ensure!(
daemon.try_wait()?.is_none(),
"app server exited before opening its socket"
);
tokio::time::sleep(Duration::from_millis(20)).await;
}
Ok::<_, anyhow::Error>(())
})
.await??;
Ok((daemon, format!("unix://{}", socket.as_path().display())))
}