Skip to content

[codex] Preserve desktop backend log failures#3375

Open
juliusmarminge wants to merge 1 commit into
mainfrom
codex/desktop-backend-output-log-errors
Open

[codex] Preserve desktop backend log failures#3375
juliusmarminge wants to merge 1 commit into
mainfrom
codex/desktop-backend-output-log-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Keep the backend child log best-effort without discarding why it failed. Setup, record encoding/writes, console mirroring, and size-resynchronization now carry structured operation/path data and exact underlying causes. Only missing log files are treated as an empty initial size; other filesystem failures reach the structured boundary logger.

The rotating writer now propagates failures to that boundary while preserving its size-recovery behavior, including both the original and recovery causes when resynchronization also fails.

Validation:

  • vp test apps/desktop/src/app/DesktopBackendOutputLog.test.ts
  • vp check
  • vp run typecheck

Note

Low Risk
Observability-only changes in desktop logging; public service API still returns void and falls back to noop on setup failure.

Overview
Desktop backend child output logging stays best-effort (noop on setup failure), but failures are no longer silently dropped. Setup, encode/write, dev console mirroring, and post-write size recovery now emit structured tagged errors with log path, operation, and the exact underlying cause attached for the boundary logger—user-facing messages stay generic and omit low-level diagnostics.

The rotating file writer stops swallowing filesystem errors via ignore / orElseSucceed; only a missing log file is treated as size 0. After a write failure it still resyncs tracked size, then re-fails with the original error, or surfaces a recovery error that carries both causes.

New Vitest coverage asserts setup and write-record failures log DesktopBackendOutputLogSetupError / DesktopBackendOutputLogWriteError with the expected path and cause identity.

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

Note

Preserve and log desktop backend output log failures instead of silently ignoring them

  • Write failures in DesktopBackendOutputLog are now caught and logged as structured errors (DesktopBackendOutputLogSetupError, DesktopBackendOutputLogWriteError) instead of being silently ignored.
  • refreshFileSize now propagates non-NotFound PlatformError instead of defaulting to 0; failed writes attempt a size refresh and may emit DesktopLogFileWriterRecoveryError.
  • Console mirroring errors (writeDevelopmentConsoleOutput) are captured and logged as DesktopBackendConsoleWriteError instead of being ignored.
  • File operations during pruning and rotation now propagate PlatformError rather than being swallowed.
  • Behavioral Change: setup failures now explicitly return Option.none and log a structured error rather than silently falling back to noop.

Macroscope summarized e87c2f4.

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: 318bf79c-1ac0-4148-84c7-b4bddc5297de

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-backend-output-log-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:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds structured error handling to desktop backend logging, replacing silent error swallowing with proper error classes and logging. The changes are self-contained observability improvements with comprehensive tests added.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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