Skip to content

[codex] Preserve detached desktop action causes#3371

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

[codex] Preserve detached desktop action causes#3371
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-detached-action-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • replace preformatted Effect causes in detached relaunch and native-menu handlers with structured Schema errors
  • retain relaunch reason or menu action together with the complete Cause object
  • derive stable messages from those structural attributes without reading cause text
  • cover both error contracts with combined fail/defect causes

Validation

  • vp test apps/desktop/src/app/DesktopDetachedActionErrors.test.ts apps/desktop/src/window/DesktopApplicationMenu.test.ts
  • vp check (passes with existing warnings)
  • vp run typecheck

Note

Low Risk
Observability-only change in forked/detached error handlers; no change to relaunch or menu success paths.

Overview
Detached relaunch and native menu failure handlers no longer log only a preformatted Cause.pretty string. They now build Schema tagged errors (DesktopLifecycleRelaunchError, DesktopApplicationMenuActionError) that keep the full Cause, plus reason or menu action, and log with a stable message derived from those fields.

New unit tests assert combined fail/defect causes are retained on both error types and that messages match the structural attributes.

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

Note

Preserve structured causes in detached desktop action errors

  • Introduces DesktopLifecycleRelaunchError and DesktopApplicationMenuActionError tagged error classes, each carrying a structured cause (defect) and an identifying field (reason or action).
  • Replaces pretty-printed cause strings in log output with structured error objects, so the full cause chain is preserved in logs.
  • Behavioral Change: log message format and log field names change — {cause: string} becomes {error: <structured error>} for both relaunch and menu action failures.

Macroscope summarized 4055656.

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: cf7fdab1-9724-4fbe-b7c6-ff95df36c14f

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-detached-action-errors

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

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

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Refactors error handling to use typed error classes that preserve full cause information instead of pretty-printing to strings. The actual runtime operations remain unchanged; this only affects how errors are structured for logging. Includes tests validating the new error classes.

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

@juliusmarminge juliusmarminge merged commit fccecd8 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/desktop-detached-action-errors branch June 20, 2026 18:08
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