Skip to content

Report PowerShell history read failures via report_error! with breadcrumbs#13600

Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
oz/pwsh-history-report-error-breadcrumbs
Draft

Report PowerShell history read failures via report_error! with breadcrumbs#13600
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
oz/pwsh-history-report-error-breadcrumbs

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Description

Follow-up to #9499, adopting the cleaner logging practices from #13483.

#9499 captured a Sentry event (via sentry::with_scope + sentry::capture_message, with the verbose PowerShell error stuffed into a scope context) whenever reading PowerShell history via PowerShell commands failed but the async_fs fallback succeeded — so we have data on how reliable the PowerShell read method is. During the report_error! migration (#13483) that reporting was dropped: on the fallback-success path only a log::error! breadcrumb remains, which never creates a Sentry event on its own.

This restores the signal using the updated report_error! macro, copying the style used in crates/remote_server/src/manager.rs:

  • log::error! logs the verbose PowerShell error (potentially lengthy stderr) — on crash-reporting builds this becomes a Sentry breadcrumb attached to the next event.
  • report_error!("Failed to read history using PowerShell commands") emits the Sentry event with a static message, keeping fingerprinting/grouping stable while the breadcrumb carries the long output.

The fallback-success branch is the sink for the PowerShell error (it stops propagating there), so this reports once at the sink; the Kaspersky/both-failed paths still propagate the registered ReadHistoryContentsError and are reported by the caller as before.

Linked Issue

N/A — follow-up to #9499 / #13483.

Testing

  • cargo check -p warp passes.
  • ./script/format and cargo clippy -p warp --all-targets --tests -- -D warnings pass.
  • Note: the touched code is #[cfg(windows)]; this was validated on Linux (rustfmt parses the cfg'd block, and the constructs mirror existing compiled call sites such as the manager.rs pattern and the non-cfg report_error! usages in the same file), but a Windows CI build is the authoritative compile check.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Conversation: https://staging.warp.dev/conversation/d4bde451-c9f9-4008-b82a-0cbafba636fe
Run: https://oz.staging.warp.dev/runs/019f4ea6-ba5b-79dc-9cf5-c9999e27fc81

This PR was generated with Oz.

…rumbs

PR #9499 captured a Sentry event (via sentry::with_scope + capture_message)
when reading PowerShell history via PowerShell commands failed but the
async_fs fallback succeeded, to collect data on how reliable the PowerShell
method is. That reporting was dropped during the report_error! migration
(#13483), leaving only a log::error! breadcrumb that never creates a Sentry
event on its own.

Restore the signal using the updated report_error! macro in the style of
crates/remote_server/src/manager.rs: log the verbose PowerShell error as a
breadcrumb, then report a static-message error event that the breadcrumb
rides along with, keeping Sentry grouping stable and the lengthy stderr out
of the grouped message.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant