[codex] Structure web diff worker failures - #3356
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: 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. |
Summary
Adjacent diff parsing and syntax-language fallbacks remain unchanged because they are intentional rendering fallbacks rather than discarded worker failures.
Verification
vp checkvp run typecheckNote
Low Risk
Small observability change in diff rendering setup; no auth, data, or user-facing behavior changes beyond richer error logging.
Overview
Introduces
DiffWorkerError(EffectSchema.TaggedErrorClass) so Pierre diff worker problems carryoperation,themeName, and the underlyingcause.Worker creation in
workerFactorynow wrapsnew DiffsWorker()and rethrows failures ascreate-workererrors instead of a bare exception.Theme sync in
DiffWorkerThemeSynctracks whether failure happened duringget-render-optionsorset-render-options, runs the update in an async IIFE with try/catch, andconsole.errors aDiffWorkerErrorinstead 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
DiffWorkerErrorclassDiffWorkerError(viaeffect/Schema) with fields foroperation,themeName, andcauseto give worker failures a consistent shape.DiffWorkerPoolProvidernow throwsDiffWorkerError(operation:create-worker) whennew DiffsWorker()fails, replacing an untyped error.DiffWorkerThemeSyncnow awaitssetRenderOptionsand logs aDiffWorkerErroron failure instead of silently swallowing errors.setRenderOptionsare now logged toconsole.errorrather than discarded.Macroscope summarized b8a09ab.