From 84458f12f679be3561c03f315a8d2f935ae920e0 Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Tue, 18 Nov 2025 23:23:00 -0800 Subject: [PATCH] fix(tui) ghost snapshot notifications (#6881) ## Summary - avoid surfacing ghost snapshot warnings in the TUI when snapshot creation fails, logging the conditions instead - continue to capture successful ghost snapshots without changing existing behavior ## Testing - `cargo test -p codex-core` *(fails: default_client::tests::test_create_client_sets_default_headers, default_client::tests::test_get_codex_user_agent, exec::tests::kill_child_process_group_kills_grandchildren_on_timeout)* ------ [Codex Task](https://chatgpt.com/codex/tasks/task_i_691c02238db08322927c47b8c2d72c4c) --- codex-rs/core/src/tasks/ghost_snapshot.rs | 27 +++++++++-------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/codex-rs/core/src/tasks/ghost_snapshot.rs b/codex-rs/core/src/tasks/ghost_snapshot.rs index 93830a305..432fedc71 100644 --- a/codex-rs/core/src/tasks/ghost_snapshot.rs +++ b/codex-rs/core/src/tasks/ghost_snapshot.rs @@ -56,23 +56,18 @@ impl SessionTask for GhostSnapshotTask { .await; info!("ghost commit captured: {}", ghost_commit.id()); } - Ok(Err(err)) => { - warn!( + Ok(Err(err)) => match err { + GitToolingError::NotAGitRepository { .. } => info!( sub_id = ctx_for_task.sub_id.as_str(), - "failed to capture ghost snapshot: {err}" - ); - let message = match err { - GitToolingError::NotAGitRepository { .. } => { - "Snapshots disabled: current directory is not a Git repository." - .to_string() - } - _ => format!("Snapshots disabled after ghost snapshot error: {err}."), - }; - session - .session - .notify_background_event(&ctx_for_task, message) - .await; - } + "skipping ghost snapshot because current directory is not a Git repository" + ), + _ => { + warn!( + sub_id = ctx_for_task.sub_id.as_str(), + "failed to capture ghost snapshot: {err}" + ); + } + }, Err(err) => { warn!( sub_id = ctx_for_task.sub_id.as_str(),