Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve updater failure causes in diagnostics #18864

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/18864/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Problem

Desktop updater failures reach persisted diagnostics with only generic messages and error tags. A local trace audit found 15 failed nightly update checks without the underlying reason, so the records could not distinguish a missing release feed from a network failure.

Change

Add bounded cause summaries to the desktop updater's diagnostic logs. The summaries preserve error codes, first-line messages, and nested failure reasons while redacting URLs and credential fields and omitting appended HTTP response bodies and headers. Check, download, install, poller, and updater-event handlers share the formatter.

Scope and approval

This is a focused fix for missing diagnostic information in the existing updater. It adds no setting or workflow and keeps user-visible update messages generic. All changes address the same loss of updater failure causes.

Verification

  • vp test run apps/desktop/src/updates/DesktopUpdates.test.ts apps/desktop/src/updates/DesktopRemoteUpdates.test.ts: 54 tests passed. Regression coverage checks that rejected update checks and updater error events emit redacted causes while retaining generic update state messages. Formatter coverage verifies nested network errors, credential removal, bounded output, cyclic causes, and unreadable error objects.
  • Targeted lint and formatting passed for the two changed files.
  • vp run --filter @t3tools/desktop typecheck passed.

No live Electron update check was run. These changes improve failure diagnostics; the retained traces do not establish the cause of the earlier nightly check failures.

Model: gpt-6.1-sol. Harness: Codex in T3 Code.

Closes #13977

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Team
      • Run ID: 6354d083-41dc-4d51-ada6-fe5c54081098
      📥 Commits

      Reviewing files that changed from the base of the PR and between d64de0a6f523ccd531d53baa10925f6b7dd2d7a8 and 1c50504132a57b218bbb3f1e71d50291fbaa563e.

      📒 Files selected for processing (2)
      • apps/desktop/src/updates/DesktopUpdates.test.ts
      • apps/desktop/src/updates/DesktopUpdates.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

      📝 Walkthrough

      Walkthrough

      Desktop updater failures now produce bounded, redacted cause summaries in logs. The summary helper handles nested causes, sensitive content, long values, cyclic causes, and unreadable error properties. Tests cover the helper and its use in updater logs.

      Changes

      Update error diagnostics

      Layer / File(s)Summary
      Summarize and redact error causes
      apps/desktop/src/updates/DesktopUpdates.ts, apps/desktop/src/updates/DesktopUpdates.test.ts
      Adds describeUpdateErrorCause to summarize causes with depth and length limits, redact sensitive content, and return a fallback when summarization throws. Tests cover nested causes, redaction, limits, cyclic causes, and unreadable properties.
      Use summaries in updater logs
      apps/desktop/src/updates/DesktopUpdates.ts, apps/desktop/src/updates/DesktopUpdates.test.ts
      Updater failure and warning logs now use cause summaries across checks, downloads, installs, pollers, and events. Tests check logged error details, redaction, and update state.

      Priority: ⬇️ Low

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix · Severity of issue fixed: Low

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 1c505

      This change adds bounded, redacted cause details to desktop updater logs and leaves user-facing messages generic. No concrete merge-blocking risk was found.

      Pre-merge checks · Passed 4
      Passed Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues checkPassedDirect issue #13977 requires updater failure logs to record the underlying cause instead of only a fixed message, error tag, and channel. DesktopUpdates.ts adds describeUpdateErrorCause and includ…
      Out of Scope Changes checkPassedThe reviewed changes are limited to apps/desktop updater logging and its tests. The formatter and test coverage directly support issue #13977. The changes add no settings, workflow, or unrelated use…
      Title checkPassedThe title clearly identifies the desktop updater scope and the main change: preserving failure causes in diagnostics.
      Description checkPassedThe description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the focused fix, linked issue, test results, limitations, and agent details.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The PR is a focused updater diagnostics fix with bounded tests and unchanged update behavior, but it changes production logging and introduces handling for URLs, credentials, headers, and response-derived error content. Human validation is warranted for the sensitive-data redaction and logging behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB+24 B (+0.5%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+24 B (+2.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB+41 B (+0.2%)29.3 KiB✅
      ClaudeLive turn messages12+1 (+100.0%)8✅

      Baseline: b03534f · PR result: 1c50504 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign in to join this conversation.