Refactor exec to use the shared app-server client (#61706)

## What changed

- Use `AppServerClient` throughout exec and extract turn completion into `finish_turn`, including handling for server and thread-stream disconnections.
- Move remote address parsing and auth-token resolution into `codex-app-server-client`, with re-exports from the TUI.
- Allow human-readable exec output to be initialized without a local `Config`.

## Testing

Move remote address and auth-token tests into `codex-app-server-client`, retaining coverage for WebSocket and Unix socket addresses, invalid addresses, and missing, empty, or whitespace-padded tokens.

GitOrigin-RevId: 465b17a1c03392a7d4e7700d83ce67c2cf5ef021
This commit is contained in:
Eric Traut
2026-11-15 23:50:49 +00:00
committed by copyberry
parent a394ff9cf6
commit 598df2d015
10 changed files with 325 additions and 273 deletions
@@ -44,7 +44,7 @@ pub(crate) struct EventProcessorWithHumanOutput {
impl EventProcessorWithHumanOutput {
pub(crate) fn create_with_ansi(
with_ansi: bool,
config: &Config,
config: Option<&Config>,
last_message_path: Option<PathBuf>,
) -> Self {
let style = |styled: Style, plain: Style| if with_ansi { styled } else { plain };
@@ -57,8 +57,8 @@ impl EventProcessorWithHumanOutput {
magenta: style(Style::new().magenta(), Style::new()),
red: style(Style::new().red(), Style::new()),
yellow: style(Style::new().yellow(), Style::new()),
show_agent_reasoning: !config.hide_agent_reasoning,
show_raw_agent_reasoning: config.show_raw_agent_reasoning,
show_agent_reasoning: config.is_none_or(|config| !config.hide_agent_reasoning),
show_raw_agent_reasoning: config.is_some_and(|config| config.show_raw_agent_reasoning),
last_message_path,
final_message: None,
final_message_rendered: false,