Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix(tui) ghost snapshot notifications (#6881)

Dylan Hurd84458f12f679
diff --git a/codex-rs/core/src/tasks/ghost_snapshot.rs b/codex-rs/core/src/tasks/ghost_snapshot.rs
index 93830a3059..432fedc712 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(),