From a971ccbf9221088baf766b1bbe911fb5b214dd66 Mon Sep 17 00:00:00 2001 From: Warp Date: Thu, 16 Jul 2026 22:34:58 +0000 Subject: [PATCH 1/3] Demote non-actionable report_error! calls in terminal/view.rs Audit of all report_error! calls in app/src/terminal/view.rs to reduce Sentry noise, per .agents/skills/logging-and-error-reporting/SKILL.md. Only report_error! (and panics) create Sentry issues, so calls that don't represent actionable engineering problems should be plain logs instead. Demote 8 calls to log::warn! (nothing for an engineer to fix): - 4x persistence ModelEvent channel-send failures (UpdateBlockAgentViewVisibility x3, UpdateFinishedCommand): a send error means the receiver is gone during app teardown, a race rather than a bug. - 2x "end_selection dispatched with no pending selection": a benign UI event-ordering condition (end without a matching begin). - "Cannot insert PR comments: not in a git repository": an expected environmental precondition. - "No working directory found for terminal session": an expected environmental condition (e.g. remote / not-yet-bootstrapped sessions). Keep the remaining 13 report_error! calls: they flag genuine invariant violations (missing conversation/session that should exist), settings persistence failures, unexpected agent-view entry failures, and a deliberately-captured unknown OS permission error. Co-Authored-By: Warp --- app/src/terminal/view.rs | 53 +++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/app/src/terminal/view.rs b/app/src/terminal/view.rs index 1f6ae9e9484..82f541d6d87 100644 --- a/app/src/terminal/view.rs +++ b/app/src/terminal/view.rs @@ -5895,9 +5895,13 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }, ) { - report_error!(anyhow::Error::new(e).context( - "Error sending UpdateBlockAgentViewVisibility event" - )); + // A send failure here means the persistence + // receiver is gone (app teardown), not an + // actionable bug — log locally instead of + // reporting to Sentry. + log::warn!( + "Error sending UpdateBlockAgentViewVisibility event: {e:#}" + ); } } } @@ -5930,9 +5934,13 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }, ) { - report_error!(anyhow::Error::new(e).context( - "Error sending UpdateBlockAgentViewVisibility event" - )); + // A send failure here means the persistence + // receiver is gone (app teardown), not an + // actionable bug — log locally instead of + // reporting to Sentry. + log::warn!( + "Error sending UpdateBlockAgentViewVisibility event: {e:#}" + ); } } } @@ -7413,7 +7421,10 @@ impl TerminalView { // Determine DiffMode from the base branch. if self.current_repo_path.is_none() { - report_error!("Cannot insert PR comments: not in a git repository"); + // Not being in a git repository is an expected environmental + // precondition, not an actionable bug — log locally instead of + // reporting to Sentry. + log::warn!("Cannot insert PR comments: not in a git repository"); return; } @@ -10302,8 +10313,10 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }) { - report_error!(anyhow::Error::new(e) - .context("Error sending UpdateBlockAgentViewVisibility event")); + // A send failure here means the persistence receiver is gone + // (app teardown), not an actionable bug — log locally instead + // of reporting to Sentry. + log::warn!("Error sending UpdateBlockAgentViewVisibility event: {e:#}"); } } } @@ -12508,8 +12521,13 @@ impl TerminalView { }, move |_, res, _| { if let Err(err) = res { - report_error!(anyhow::Error::new(err) - .context("Error sending UpdateFinishedCommand event")); + // A send failure here means the persistence + // receiver is gone (app teardown), not an + // actionable bug — log locally instead of + // reporting to Sentry. + log::warn!( + "Error sending UpdateFinishedCommand event: {err:#}" + ); } }, ); @@ -17940,7 +17958,9 @@ impl TerminalView { self.maybe_copy_selection_to_clipboard(ctx); ctx.notify(); } else { - report_error!("end_selection dispatched with no pending selection"); + // A benign event-ordering condition (end without a matching begin), + // not an actionable bug — log locally instead of reporting to Sentry. + log::warn!("end_selection dispatched with no pending selection"); } } @@ -17976,7 +17996,9 @@ impl TerminalView { ctx.notify(); } else { - report_error!("end_selection dispatched with no pending selection"); + // A benign event-ordering condition (end without a matching begin), + // not an actionable bug — log locally instead of reporting to Sentry. + log::warn!("end_selection dispatched with no pending selection"); } } @@ -25895,7 +25917,10 @@ impl TerminalView { #[cfg(feature = "local_fs")] { let Some(working_directory_str) = self.pwd() else { - report_error!("No working directory found for terminal session"); + // A missing working directory is an expected environmental + // condition (e.g. remote or not-yet-bootstrapped sessions), not + // an actionable bug — log locally instead of reporting to Sentry. + log::warn!("No working directory found for terminal session"); return; }; From 7e042ea2a000e4a3eca8988a21771d28e9d71a32 Mon Sep 17 00:00:00 2001 From: Warp Date: Thu, 16 Jul 2026 22:46:15 +0000 Subject: [PATCH 2/3] Address review feedback: drop explanatory comments Remove the explanatory comments added alongside the demoted log::warn! calls, per in-thread review feedback. The log-level changes are unchanged. Co-Authored-By: Warp --- app/src/terminal/view.rs | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/app/src/terminal/view.rs b/app/src/terminal/view.rs index 82f541d6d87..465e55a74fd 100644 --- a/app/src/terminal/view.rs +++ b/app/src/terminal/view.rs @@ -5895,10 +5895,6 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }, ) { - // A send failure here means the persistence - // receiver is gone (app teardown), not an - // actionable bug — log locally instead of - // reporting to Sentry. log::warn!( "Error sending UpdateBlockAgentViewVisibility event: {e:#}" ); @@ -5934,10 +5930,6 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }, ) { - // A send failure here means the persistence - // receiver is gone (app teardown), not an - // actionable bug — log locally instead of - // reporting to Sentry. log::warn!( "Error sending UpdateBlockAgentViewVisibility event: {e:#}" ); @@ -7421,9 +7413,6 @@ impl TerminalView { // Determine DiffMode from the base branch. if self.current_repo_path.is_none() { - // Not being in a git repository is an expected environmental - // precondition, not an actionable bug — log locally instead of - // reporting to Sentry. log::warn!("Cannot insert PR comments: not in a git repository"); return; } @@ -10313,9 +10302,6 @@ impl TerminalView { agent_view_visibility: agent_view_visibility.into(), }) { - // A send failure here means the persistence receiver is gone - // (app teardown), not an actionable bug — log locally instead - // of reporting to Sentry. log::warn!("Error sending UpdateBlockAgentViewVisibility event: {e:#}"); } } @@ -12521,10 +12507,6 @@ impl TerminalView { }, move |_, res, _| { if let Err(err) = res { - // A send failure here means the persistence - // receiver is gone (app teardown), not an - // actionable bug — log locally instead of - // reporting to Sentry. log::warn!( "Error sending UpdateFinishedCommand event: {err:#}" ); @@ -17958,8 +17940,6 @@ impl TerminalView { self.maybe_copy_selection_to_clipboard(ctx); ctx.notify(); } else { - // A benign event-ordering condition (end without a matching begin), - // not an actionable bug — log locally instead of reporting to Sentry. log::warn!("end_selection dispatched with no pending selection"); } } @@ -17996,8 +17976,6 @@ impl TerminalView { ctx.notify(); } else { - // A benign event-ordering condition (end without a matching begin), - // not an actionable bug — log locally instead of reporting to Sentry. log::warn!("end_selection dispatched with no pending selection"); } } @@ -25917,9 +25895,6 @@ impl TerminalView { #[cfg(feature = "local_fs")] { let Some(working_directory_str) = self.pwd() else { - // A missing working directory is an expected environmental - // condition (e.g. remote or not-yet-bootstrapped sessions), not - // an actionable bug — log locally instead of reporting to Sentry. log::warn!("No working directory found for terminal session"); return; }; From 10cd18124366d29bd9cf17431491583ee47f7e88 Mon Sep 17 00:00:00 2001 From: Warp Date: Thu, 16 Jul 2026 22:57:59 +0000 Subject: [PATCH 3/3] Use log::error! for end_selection invariant violation An end-selection dispatched without a matching begin is an invariant violation the code handles locally, so log it at error! rather than warn! (still not a Sentry issue via report_error!). Per in-thread review feedback. Co-Authored-By: Warp --- app/src/terminal/view.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/terminal/view.rs b/app/src/terminal/view.rs index 465e55a74fd..2777f18e539 100644 --- a/app/src/terminal/view.rs +++ b/app/src/terminal/view.rs @@ -17940,7 +17940,7 @@ impl TerminalView { self.maybe_copy_selection_to_clipboard(ctx); ctx.notify(); } else { - log::warn!("end_selection dispatched with no pending selection"); + log::error!("end_selection dispatched with no pending selection"); } } @@ -17976,7 +17976,7 @@ impl TerminalView { ctx.notify(); } else { - log::warn!("end_selection dispatched with no pending selection"); + log::error!("end_selection dispatched with no pending selection"); } }