Skip to content

fix(updater): recover Linux .deb/.rpm installs that fail escalation - #12183

Merged
AmethystLiang merged 3 commits into
mainfrom
AmethystLiang/fix-update-issue
Aug 3, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
AmethystLiang/fix-update-issue

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Problem

On the reported machine (neil-ubuntu, .deb install, no polkit authentication agent):

$ pkexec --disable-internal-agent /bin/true
Error executing command as another user: No authentication agent found.
exit=127

electron-updater's BaseUpdater logs the child stderr and then throws an error carrying only the command and exit status, so the error event loses No authentication agent found. Orca surfaced:

Could not restart to install the update. Quit and reopen Orca, then try again.

That advice is wrong for a missing agent, and the card's only action was Retry Download — discarding a verified 161 MB package still sitting in the updater cache.

Approach

Keep the one-click install path (a working polkit agent is unchanged), but make a failed root-package install recoverable without downloading again. Implements linux-deb-update-polkit-failure-2026-07-30.md.

  • Retain the artifact. Capture the downloaded path and its expected SHA-512 from the update-downloaded event, mirroring electron-updater's own cache-name rule. Fails closed on a malformed encoding, an ambiguous file/hash pairing, or a digest that cannot decode.
  • Capture what upstream drops. A logger adapter retains the child stderr during a native install, redacted (ANSI, control bytes, <home>, <package>, <user>, 1 KiB cap) and classified into authentication-agent-unavailable / authentication-denied / package-install-failed. Classification reads the original text — redaction can rewrite a matched phrase.
  • Structured recovery status → a dedicated card: Copy Install Command / Try Automatic Install Again / Show Package, with the redacted diagnostic in a collapsed disclosure.
  • Revalidate every action: cache containment, lstat, streamed SHA-512, timingSafeEqual. Concurrent requests coalesce into one hash pass.
  • Command safety: fixed tokens plus one POSIX-single-quoted absolute path; sudo and the package manager resolved only from /usr/bin, /bin, /usr/sbin, /sbin; no -y. Orca never executes it. The copy explicitly says a system terminal on the computer where Orca is installed — an Orca terminal may be on an SSH host or WSL distro.
  • No implicit quit-time install for .deb/.rpm, which would otherwise fail after the UI is gone.

ErrorCardContent is extracted into UpdateErrorCardContent.tsx so UpdateCard doesn't absorb another stateful surface. No max-lines disable added.

Trust model

The SHA-512 check is an integrity check against the HTTPS release metadata electron-updater already trusts. It is not a package signature and not a privilege boundary — a same-uid process can still replace the file between validation and paste. The card says so. The load-bearing containment check is the lexical cache-root anchor, which stops a manipulated update-info.json fileName from pointing at /tmp or /dev/shm where a different principal could win that race.

Review

Three review rounds (8 reviewer passes). Defects found and fixed, most notably:

  • Retry bricked the card. quitAndInstall() resolves as soon as main schedules the install, so a failed retry never rejects — it arrives later as a status push. The card re-renders rather than remounts, so the busy slot never cleared and every action went inert. Two green tests had asserted the wedged state as correct.
  • Identical repeat failures were deduped, so the preload abort relay never fired and the renderer stayed stuck in its restart checkpoint.
  • The cleanup catch tore down a committed install — Linux installs synchronously, so a throw after the native call disarmed the exit watchdog ([Bug]: Check-for-updates closes app but never relaunches it #4438) and reported failure for an install that had succeeded.
  • Any rejection demoted the copy path (including an untrusted-sender error), pushing users toward the redownload this feature exists to avoid. The IPC now returns a discriminated result.
  • Regression outside Linux: switching to aria-disabled removed the native click block, and the pre-existing HTTP/2 card's "Enable & Restart" had no guard — a double-click fired two app.relaunch() calls.
  • An unredacted local path could reach the renderer; a short username could change the diagnosed reason.

Final round: no P0/P1, correctness or security.

Test plan

632 tests across 34 files. Covers the marker matrix, artifact capture/clear boundaries, cache containment (traversal, symlinks, attacker-owned directories), digest validation and coalescing, POSIX quoting, every package-manager command form, trusted-directory discovery with a user-writable PATH decoy, redaction/classification, the install-failure lifecycle, IPC sender trust against the real isTrustedUIRenderer, and the card's actions, a11y and keyboard behavior.

pnpm run lint, all three typecheck projects, and oxfmt --check are clean.

Not included

  • Packaged CI smoke. PR CI builds Linux --dir only (no marker is emitted); real .deb/.rpm come from release-cut.yml. Added a config-level test instead, so the marker contract can't silently break. Real packaged assertions belong to a release-pipeline change.
  • pacman is out of scope per the design (deb/rpm only) and isn't a shipped target. It would get no recovery card and keep autoInstallOnAppQuit.
  • rpm command forms are untested in production — electron-builder.config.cjs ships ['AppImage', 'deb'], so the Fedora/openSUSE row of the manual matrix can't run against a real Orca rpm.
  • Two pre-existing issues found but left alone: web-preload-api.ts's fallback Proxy answers then (so await window.api hangs), and the error card is minimize-only rather than dismissible.

Manual verification still needed

Per the design's RC matrix — this cannot be exercised in PR CI:

  1. Ubuntu GNOME with a working agent: automatic install still succeeds.
  2. dbus-run-session/seat-less with no agent: Orca stays usable and the copied apt command installs the retained package.
  3. Authentication dismissed: recovery appears, retry works.
  4. Delete and mutate the cached package: copy/reveal fail closed.
  5. AppImage update regression.

🤖 Generated with Claude Code

A `.deb` install fails with `No authentication agent found` when the session
has no polkit agent. Orca reported "Quit and reopen Orca, then try again" —
wrong advice — and its only action was Retry Download, discarding a verified
160 MB package that was still in the updater cache.

Keep the one-click install path, but make a failed root-package install
recoverable without downloading again:

- Retain the downloaded package and its expected SHA-512 from the
  `update-downloaded` event, mirroring electron-updater's cache-name rule.
- Capture the child stderr that BaseUpdater logs but drops from the `error`
  event, redact it (ANSI, control bytes, `<home>`, `<package>`, `<user>`,
  1 KiB cap), and classify the failure. Classification reads the original
  text — redaction can rewrite a matched phrase.
- Send a structured `linux-package-install` recovery status and render a
  dedicated card: Copy Install Command / Try Automatic Install Again /
  Show Package.
- Revalidate on every action: cache containment, lstat, streamed SHA-512,
  timingSafeEqual. Concurrent requests coalesce into one hash pass.
- Build the command from fixed tokens plus one POSIX-single-quoted absolute
  path, resolving sudo and the package manager only from /usr/bin, /bin,
  /usr/sbin, /sbin. Orca never runs it.
- Disable `autoInstallOnAppQuit` for .deb/.rpm so an ordinary quit cannot
  trigger the same failing escalation after the UI is gone.

Extracts the error-card presentation into UpdateErrorCardContent so
UpdateCard does not absorb another stateful surface.

Lifecycle breadcrumbs carry package type, reason, exit code and version —
never a path, command, username or raw child output.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e5ce19c-2540-4ff0-b3cf-2ff84fe0a8ec

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9cb84 and 263fc9d.

📒 Files selected for processing (1)
  • config/scripts/electron-builder-config.test.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/electron-builder-config.test.mjs

📝 Walkthrough

Walkthrough

Adds Linux root-package detection, trusted installation command generation, redacted diagnostics, cached artifact validation, updater recovery state, secure IPC and preload APIs, and web fallbacks. Adds renderer recovery cards with retry, command-copy, package-reveal, release-download, accessibility, localization, and comprehensive test coverage.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes recovery for failed Linux .deb and .rpm installations.
Description check ✅ Passed The description thoroughly explains the change, testing, security review, platform risks, and remaining manual verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/updater-events.ts (1)

232-240: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear the artifact only after the transient-fallback outcome is known.

clearTrackedLinuxPackageArtifact() runs at Line 234, before consumeMissingManifestPrereleaseFallbackResult() and getPublishingWindowLastGoodCheck() are read at Lines 235-236. The same handler treats a last-good "not available" as a transient release-transition outcome (Line 243) and keeps the short retry. In that case the retained package is still valid, but it is already destroyed. A background check that lands while a recovery card is shown then leaves the card visible with a missing artifact, and the next action reports "no longer in the update cache".

Move the clear after the fallback checks, and skip it for the transient branch.

♻️ Proposed reordering
     clearBackgroundCheckLaunchPending()
     resetMacInstallState()
-    clearTrackedLinuxPackageArtifact()
     const missingManifestFallback = consumeMissingManifestPrereleaseFallbackResult()
     const publishingWindowLastGoodCheck = getPublishingWindowLastGoodCheck()
+    // Why: a last-good "not available" is a publishing-window blip, not evidence the package is obsolete.
+    if (!missingManifestFallback && !publishingWindowLastGoodCheck) {
+      clearTrackedLinuxPackageArtifact()
+    }
     const wasUserInitiated = missingManifestFallback?.userInitiated ?? getUserInitiatedCheck()
🧹 Nitpick comments (9)
src/main/updater-linux-package-recovery-actions.test.ts (1)

96-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restore real timers after each test.

beforeEach calls vi.useFakeTimers(), but no hook restores real timers. A failure that aborts a test leaves the fake clock installed for the remaining tests in this file, which turns one failure into a cascade of timeouts.

♻️ Proposed cleanup hook
   describe('linux package recovery actions', () => {
+    afterEach(() => {
+      vi.useRealTimers()
+    })
+
     beforeEach(() => {

Add afterEach to the vitest import.

src/renderer/src/components/LinuxPackageInstallRecoveryCard.test.tsx (1)

105-117: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

footnoteElement couples the tests to the DOM nesting depth.

The helper walks document.body.firstElementChild.firstElementChild and then two lastElementChild hops. Any wrapper added inside UpdateErrorCardContent breaks every footnote assertion with a confusing null, not with a message about the footnote. Consider querying the footnote by text or by a stable data-testid on the footnote paragraph instead.

src/renderer/src/components/UpdateCard.tsx (1)

529-542: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Forward the full UpdateErrorCardModel to the shared card.

UpdateErrorCardModel now declares secondaryAction, tertiaryAction, and footnote, but this call site forwards only a subset. No generic error model sets those fields today, so behavior is unchanged. A future model that sets one would silently render nothing. Spreading the model removes that trap.

♻️ Proposed simplification
     if (errorCard) {
       return (
-        <UpdateErrorCardContent
-          title={errorCard.title}
-          summary={errorCard.summary}
-          explainer={errorCard.explainer}
-          detail={errorCard.detail}
-          releaseUrl={errorCard.releaseUrl}
-          manualLabel={errorCard.manualLabel}
-          variant={errorCard.variant}
-          primaryAction={errorCard.primaryAction}
-          onClose={handleCollapseWithAnimation}
-        />
+        <UpdateErrorCardContent {...errorCard} onClose={handleCollapseWithAnimation} />
       )
     }
src/main/linux-package-install-command.test.ts (2)

96-103: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Unstub the environment in afterEach.

Line 102 calls vi.unstubAllEnvs() inside the test body. If an assertion on line 100 or 101 fails, the test throws first and PATH stays stubbed for the remaining tests in the file. Move the cleanup to the existing afterEach.

♻️ Proposed cleanup move
 afterEach(() => {
   vi.restoreAllMocks()
+  vi.unstubAllEnvs()
 })
     expect(resolveTrustedExecutable('sudo')).toBeNull()
     expect(statSyncMock).not.toHaveBeenCalledWith('/home/user/.local/bin/sudo')
-    vi.unstubAllEnvs()
   })

234-242: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert result.ok before matching the command.

result.ok && result.command evaluates to false when the build fails, and expect(false).not.toMatch(...) throws a type error instead of reporting a clear failure. Assert result.ok first, then match result.command.

src/renderer/src/components/UpdateErrorCardContent.tsx (2)

105-113: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Resolve the conflicting size utilities on the close button.

size-7 sets a 28px box, and min-w-[44px] min-h-[44px] then forces 44px. The minimum wins, so size-7 has no effect and the rendered control is 16px larger than the surrounding header expects. -m-2 removes only 8px per side. Drop size-7, or apply the tap-target padding through a wrapper so the visual icon box stays 28px.


164-174: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Handle a rejected openUrl promise.

void window.api.shell.openUrl(releaseUrl) discards the promise. If the IPC call rejects, the browser reports an unhandled rejection and the user gets no feedback. Attach a catch and surface the failure through the existing footnote path, or at least log it.

src/main/window/updater-package-recovery-ipc.test.ts (1)

172-179: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restore the environment in a teardown hook.

vi.unstubAllEnvs() runs at the end of the test body. If an assertion above it throws, the stubbed ELECTRON_RENDERER_URL and the null trusted id persist into later tests in the same file. Move the cleanup into afterEach so it always runs.

♻️ Proposed change
+  afterEach(() => {
+    vi.unstubAllEnvs()
+  })
+
   it('rejects a foreign-origin renderer when only the dev URL fallback applies', () => {
     actualUi.setTrustedUIRendererWebContentsId(null)
     vi.stubEnv('ELECTRON_RENDERER_URL', 'http://localhost:5173')
 
     expectBothChannelsRejected(webContents({ getURL: () => 'http://evil.invalid/index.html' }))
-
-    vi.unstubAllEnvs()
   })

Import afterEach from vitest.

src/renderer/src/web/web-preload-api.ts (1)

3065-3079: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Create the error per rejection.

desktopOnlyError is one Error instance shared by every rejection from both methods. Its stack points at createUpdaterApi, not at the caller, which makes a real failure harder to trace. The instance is also reachable by renderer code, so a mutation of message affects all later rejections. Build the error inside each method and keep the message in a constant.

♻️ Proposed change
-  // Why: the linux-package-install recovery status can only originate in the native main process, so
-  // the web renderer never reaches these branches — reject loudly rather than resolve a fake result.
-  const desktopOnlyError = new Error(
-    'Linux package install recovery is only available in the desktop app.'
-  )
+  // Why: the linux-package-install recovery status can only originate in the native main process, so
+  // the web renderer never reaches these branches — reject loudly rather than resolve a fake result.
+  const desktopOnlyMessage = 'Linux package install recovery is only available in the desktop app.'
   return {
@@
-    getLinuxPackageInstallInstructions: () => Promise.reject(desktopOnlyError),
-    showLinuxPackage: () => Promise.reject(desktopOnlyError),
+    getLinuxPackageInstallInstructions: () => Promise.reject(new Error(desktopOnlyMessage)),
+    showLinuxPackage: () => Promise.reject(new Error(desktopOnlyMessage)),

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8364583b-a6a1-4001-948f-cc886c9af5aa

📥 Commits

Reviewing files that changed from the base of the PR and between 922268a and 0f9cb84.

📒 Files selected for processing (31)
  • config/scripts/electron-builder-config.test.mjs
  • src/main/linux-package-install-command.test.ts
  • src/main/linux-package-install-command.ts
  • src/main/linux-package-install-diagnostic.test.ts
  • src/main/linux-package-install-diagnostic.ts
  • src/main/linux-package-update-recovery.test.ts
  • src/main/linux-package-update-recovery.ts
  • src/main/linux-update-package-type.test.ts
  • src/main/linux-update-package-type.ts
  • src/main/updater-events.test.ts
  • src/main/updater-events.ts
  • src/main/updater-fallback.ts
  • src/main/updater-linux-package-recovery-actions.test.ts
  • src/main/updater.fallback.test.ts
  • src/main/updater.test.ts
  • src/main/updater.ts
  • src/main/window/attach-main-window-services.ts
  • src/main/window/updater-package-recovery-ipc.test.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/preload/renderer-restart-preparation.test.ts
  • src/preload/updater-package-recovery.test.ts
  • src/renderer/src/components/LinuxPackageInstallRecoveryCard.test.tsx
  • src/renderer/src/components/LinuxPackageInstallRecoveryCard.tsx
  • src/renderer/src/components/UpdateCard.error-card.test.tsx
  • src/renderer/src/components/UpdateCard.tsx
  • src/renderer/src/components/UpdateErrorCardContent.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/web/web-preload-updater-package-recovery.test.ts
  • src/shared/types.ts

@greptile-apps

greptile-apps Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR adds a structured recovery surface for .deb/.rpm installs that fail polkit escalation on Linux. When electron-updater cannot elevate via pkexec, Orca now retains the verified 160 MB artifact, captures and redacts the child stderr, and presents a dedicated card with three actions instead of the previous dead-end "Quit and reopen" advice.

  • Artifact retention & validation: The update-downloaded event captures the download path and SHA-512 from release metadata; every action revalidates containment (lexical + real-path), lstat, and streamed digest before use. Concurrent hash requests coalesce into one pass.
  • Diagnostic capture: A logger adapter intercepts autoUpdater.error calls during the native install window, redacts ANSI escapes, control bytes, home path, package path, and username (≥3 chars), and classifies into authentication-agent-unavailable / authentication-denied / package-install-failed from the original pre-redaction text.
  • Recovery card (LinuxPackageInstallRecoveryCard): offers Copy Install Command (POSIX-single-quoted absolute path, sudo + package manager resolved only from /usr/bin /bin /usr/sbin /sbin), Try Automatic Install Again, and Show Package; autoInstallOnAppQuit is disabled for root packages so implicit quit-time escalation cannot silently fail after the UI exits.

Confidence Score: 5/5

Safe to merge — Linux-only change gated behind the package-type marker file, failing closed at every validation step.

Three previous review rounds addressed lifecycle correctness issues. The remaining code is carefully guarded: artifact capture is idempotent, validation is rerun on every action, cache containment correctly handles symlinked parents and path traversal, timing-safe comparison is used for the digest, and IPC handlers enforce sender trust per-invocation. No gaps found in this round.

Files Needing Attention: No files require special attention. The manual RC matrix noted in the PR description is the only remaining validation gap and is explicitly called out as outside PR CI scope.

Important Files Changed

Filename Overview
src/main/linux-package-update-recovery.ts Core artifact tracking and validation: SHA-512 streaming, lexical + real-path cache containment, in-flight coalescing, and the public instructions/reveal API. All security-relevant paths (containment check, symlink rejection, timing-safe compare) are correctly implemented.
src/main/linux-package-install-diagnostic.ts Logger adapter with redaction pipeline (ANSI+OSC, control chars, home/package/username) and failure classification. Classification correctly reads pre-redaction text; deduplication prevents a later generic exited-with-code-N line from overwriting a specific polkit verdict.
src/main/linux-package-install-command.ts Builds the copy-paste sudo command: executables resolved from trusted directories only via statSync, POSIX single-quoting applied to the path, no shell ever invoked. The invalid-package-path reason is unreachable today but correctly documented.
src/main/updater.ts Major additions: diagnostic capture lifetime, updateInstallCommitted guard preventing false failure reports for a successful Linux install, buildLinuxPackageInstallFailureStatus, and autoInstallOnAppQuit=false for root packages. The synchronous error-event and async catch-block paths are carefully distinguished.
src/renderer/src/components/LinuxPackageInstallRecoveryCard.tsx Recovery card component with three action paths. The pendingAction slot is correctly released via a recovery-watching effect. Clipboard failure keeps the copy path available. mountedRef guards all async state updates.
src/main/window/attach-main-window-services.ts Registers two new IPC handlers behind assertTrustedUpdaterRecoverySender, which checks isTrustedUIRenderer per-invocation against the real predicate — not a mocked stub.
src/main/updater-events.ts Adds captureLinuxPackageArtifact in update-downloaded and clearTrackedLinuxPackageArtifactForOtherVersion in update-available and download-progress. clearTrackedLinuxPackageArtifact in update-not-available correctly clears the artifact when no update is pending.
src/main/linux-update-package-type.ts Reads the package-type marker file from process.resourcesPath and caches the result. pacman is recognized but deliberately excluded from recovery scope; unrecognized markers log a warning rather than defaulting to a guess.

Reviews (2): Last reviewed commit: "Improve Linux package install recovery d..." | Re-trigger Greptile

- Distinguish invalid-package-path errors from missing package manager
- Expand ANSI escape sequence stripping to handle OSC hyperlinks and DCS
- Prevent generic error logs from overwriting specific diagnostic verdicts
- Add error handling for shell.openUrl in update UI
- Fix test isolation with proper afterEach hooks
@AmethystLiang
AmethystLiang merged commit 5887b36 into main Aug 3, 2026
43 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#12183)

* fix(updater): recover Linux .deb/.rpm installs that fail escalation

A `.deb` install fails with `No authentication agent found` when the session
has no polkit agent. Orca reported "Quit and reopen Orca, then try again" —
wrong advice — and its only action was Retry Download, discarding a verified
160 MB package that was still in the updater cache.

Keep the one-click install path, but make a failed root-package install
recoverable without downloading again:

- Retain the downloaded package and its expected SHA-512 from the
  `update-downloaded` event, mirroring electron-updater's cache-name rule.
- Capture the child stderr that BaseUpdater logs but drops from the `error`
  event, redact it (ANSI, control bytes, `<home>`, `<package>`, `<user>`,
  1 KiB cap), and classify the failure. Classification reads the original
  text — redaction can rewrite a matched phrase.
- Send a structured `linux-package-install` recovery status and render a
  dedicated card: Copy Install Command / Try Automatic Install Again /
  Show Package.
- Revalidate on every action: cache containment, lstat, streamed SHA-512,
  timingSafeEqual. Concurrent requests coalesce into one hash pass.
- Build the command from fixed tokens plus one POSIX-single-quoted absolute
  path, resolving sudo and the package manager only from /usr/bin, /bin,
  /usr/sbin, /sbin. Orca never runs it.
- Disable `autoInstallOnAppQuit` for .deb/.rpm so an ordinary quit cannot
  trigger the same failing escalation after the UI is gone.

Extracts the error-card presentation into UpdateErrorCardContent so
UpdateCard does not absorb another stateful surface.

Lifecycle breadcrumbs carry package type, reason, exit code and version —
never a path, command, username or raw child output.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Improve Linux package install recovery diagnostics

- Distinguish invalid-package-path errors from missing package manager
- Expand ANSI escape sequence stripping to handle OSC hyperlinks and DCS
- Prevent generic error logs from overwriting specific diagnostic verdicts
- Add error handling for shell.openUrl in update UI
- Fix test isolation with proper afterEach hooks

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant