[APP-5168] Demote harness-availability refresh failure from Sentry to a warn log - #14703
Closed
warp-agent-staging[bot] wants to merge 1 commit into
Closed
[APP-5168] Demote harness-availability refresh failure from Sentry to a warn log#14703warp-agent-staging[bot] wants to merge 1 commit into
warp-agent-staging[bot] wants to merge 1 commit into
Conversation
`HarnessAvailabilityModel::refresh` is a best-effort background refresh: on failure the model keeps the cached (or default) harness list and the UI stays usable. Its error arm nonetheless called `report_error!`, which is reserved for actionable defects, so every transient transport failure became a Sentry issue — ~275k events / ~112k users, dominated by `HttpError: received non-OK response code 408 Request Timeout`. Per the repo's logging-and-error-reporting guidance, an external failure the app proceeds through belongs at `log::warn!`, so log the error chain locally instead of capturing a Sentry event. Fallback behavior is unchanged. Co-Authored-By: Warp <agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
HarnessAvailabilityModel::refresh(app/src/ai/harness_availability.rs) is a best-effort background refresh of the harness list. On failure the model keeps using the cached list — ordefault_harnesses()(Oz enabled) — and the picker stays usable. Its error arm nonetheless calledreport_error!, which is reserved for actionable defects and is the only path (besides panics) that creates a Sentry issue.The result is Sentry issue WARP-CLIENT-BETA-STABLE-7M3C: ~275k events across ~112k users, overwhelmingly
HttpError: received non-OK response code 408 Request Timeout. The cause is external transport failure, not a client bug, and unlike the auth-secret fetches in the same file this path uses a barectx.spawnwith no retry, so every timeout becomes its own event.Per
.agents/skills/logging-and-error-reporting/SKILL.md, an external failure the app proceeds through belongs atlog::warn!(breadcrumb only), notreport_error!. This PR makes that one-line demotion and keeps the full error chain in the log line via{e:#}.warp_errors::report_errorimport stays: the other call sites in this file (auth-secret fetch/create/delete) still use it and are out of scope.Deliberately out of scope: triage also flagged that
GraphQLError(crates/graphql/src/client.rs) is notregister_error!'d and has noErrorExt::is_actionable, so 408/429/5xx bypass the non-actionable classification for otherreport_error!sinks too. Registering it would change Sentry classification globally for every GraphQL call site — a much wider observability change than this XS ticket, and one worth its own review. It is intentionally left for a follow-up rather than folded in here.Linked Issue
APP-5168 (
triage-done; spec skipped as an obvious fix)Testing
No regression test — testing-exempt (observability-only change). The diff changes which sink a failure is reported to; there is no behavioral logic to assert. A test could only re-state that this call site calls
log::warn!rather thanreport_error!, which is tautological. This matches the precedent for the identical demotion in #14289 (next-command suggestion), which also shipped without a test.Checks run locally, scoped to the touched crate (full-suite CI on this PR is the backstop):
./script/format --check— passed.cargo clippy -p warp --lib -- -D warnings— passed, 0 warnings.cargo clippy -p warp --all-targets --tests -- -D warnings— passed, 0 warnings.cargo nextest run -p warp --no-fail-fast— 6151 tests: 6148 passed, 3 failed, 7 skipped. All 3 failures are pre-existing and environmental, not caused by this change: I re-ran exactly those 3 against unmodifiedmaster(git checkout origin/master -- app/src/ai/harness_availability.rs) and got3 tests run: 0 passed, 3 failed. They areserver::server_api::ai::tests::ambient_agent_headers_for_task_overrides_existing_cloud_agent_header(thenscCLI returnsaccess deniedin this sandbox),terminal::input::tests::test_histignorespace_support_in_zsh, andterminal::input::decorations::tests::test_decorations_with_multibyte_chars(syntax-highlight styling differs without bundled assets). None touch the changed code path.Before → after on the real path: a failed
get_available_harnesses(e.g. HTTP 408) previously produced a Sentry event plus anError-level line; it now produces aWarn-level breadcrumb lineFailed to fetch available harnesses: <error chain>and no Sentry event, with the cached/default harness list still in use.No UI surface changes, so no visual proof applies (headless logging change).
Originating thread: https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785869638922449