Skip to content

[codex] Structure Electron app boundary failures#3301

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-electron-app-errors
Jun 20, 2026
Merged

[codex] Structure Electron app boundary failures#3301
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-electron-app-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add Schema-backed errors for Electron app metadata reads and readiness failures
  • preserve the exact underlying cause while attaching the failed metadata property or packaged state
  • keep construction direct at each boundary and cover both failure paths with focused tests

Verification

  • vp test apps/desktop/src/electron/ElectronApp.test.ts
  • vp check (passes with 20 pre-existing warnings)
  • vp run typecheck

Open PR overlap audit

Audited every open PR with gh pr list --limit 1000 and paginated per-PR files, checking both filename and previous_filename. These files are also touched by unrelated feature/fix PRs #2901, #2916, #2925, and #2679; none belongs to the Effect/error audit series.


Note

Low Risk
Localized to the Electron app adapter and tests; startup already handles whenReady failures via catchCause, and success paths are unchanged.

Overview
The ElectronApp service now surfaces typed, Schema-backed errors at two Electron boundaries instead of letting sync/promise failures escape as untyped defects.

metadata wraps getVersion and getAppPath in Effect.try and fails with ElectronAppMetadataReadError, which records which property (app-version or app-path) failed and keeps the original cause. whenReady uses Effect.tryPromise and maps rejections to ElectronAppWhenReadyError with packaged state and the underlying cause. The service API’s error channels are updated accordingly.

New unit tests assert error type, fields, messages, and cause preservation for a version read failure and a readiness rejection.

Reviewed by Cursor Bugbot for commit 41799e3. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add structured error types for ElectronApp metadata and readiness failures

  • Introduces ElectronAppMetadataReadError and ElectronAppWhenReadyError tagged error classes in ElectronApp.ts, each preserving the original cause and relevant context (property or isPackaged).
  • The metadata effect now individually wraps reads of appVersion and appPath via Effect.try, failing with a typed error instead of defecting on throw.
  • The whenReady effect wraps Electron.app.whenReady() via Effect.tryPromise, mapping rejections to ElectronAppWhenReadyError with the packaging state attached.
  • Tests in ElectronApp.test.ts verify error type, cause propagation, and message content for both failure paths.
  • Behavioral Change: metadata and readiness failures now surface as typed errors in the Effect channel rather than untyped defects.

Macroscope summarized 41799e3.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c271dcdd-5c7b-4c33-8000-6c8f52b67aef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/desktop-electron-app-errors

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

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds structured error classes for Electron app boundary failures without changing runtime behavior - the same Electron API calls are made, now with typed error capture instead of untyped defects. The changes are self-contained, well-tested, and low risk.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit 5a2c92e into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/desktop-electron-app-errors branch June 20, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant