Skip to content

[codex] Structure web diff worker failures - #3356

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/web-diff-worker-errors
Jun 20, 2026
Merged

[codex] Structure web diff worker failures#3356
juliusmarminge merged 1 commit into
mainfrom
codex/web-diff-worker-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add a structured diff worker error with operation, theme, and exact cause
  • distinguish worker construction, render-option reads, and theme updates
  • preserve the existing UI behavior while making rejected theme synchronization observable

Adjacent diff parsing and syntax-language fallbacks remain unchanged because they are intentional rendering fallbacks rather than discarded worker failures.

Verification

  • vp check
  • vp run typecheck

Note

Low Risk
Small observability change in diff rendering setup; no auth, data, or user-facing behavior changes beyond richer error logging.

Overview
Introduces DiffWorkerError (Effect Schema.TaggedErrorClass) so Pierre diff worker problems carry operation, themeName, and the underlying cause.

Worker creation in workerFactory now wraps new DiffsWorker() and rethrows failures as create-worker errors instead of a bare exception.

Theme sync in DiffWorkerThemeSync tracks whether failure happened during get-render-options or set-render-options, runs the update in an async IIFE with try/catch, and console.errors a DiffWorkerError instead of swallowing rejections via .catch(() => undefined)—user-visible behavior stays the same, but failed theme updates are observable in the console.

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

Note

Structure diff worker failures with a typed DiffWorkerError class

  • Adds DiffWorkerError (via effect/Schema) with fields for operation, themeName, and cause to give worker failures a consistent shape.
  • DiffWorkerPoolProvider now throws DiffWorkerError (operation: create-worker) when new DiffsWorker() fails, replacing an untyped error.
  • DiffWorkerThemeSync now awaits setRenderOptions and logs a DiffWorkerError on failure instead of silently swallowing errors.
  • Behavioral Change: errors during setRenderOptions are now logged to console.error rather than discarded.

Macroscope summarized b8a09ab.

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: 277d7378-455e-4c51-a56c-626acb05f3fb

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/web-diff-worker-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

This PR adds structured error handling for diff worker operations, replacing silent error swallowing with properly typed error classes and console logging. The changes are self-contained, don't alter runtime behavior beyond improved error observability, and carry minimal risk.

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

@juliusmarminge
juliusmarminge merged commit 08650a7 into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/web-diff-worker-errors branch June 20, 2026 18:02
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