[codex] Preserve desktop asset probe failures#3373
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 improves error handling by preserving filesystem probe failures instead of silently swallowing them. The change is small, well-tested, and limited to desktop asset resolution with no broader side effects. You can customize Macroscope's approvability policy. Learn more. |
Desktop asset lookup no longer treats filesystem probe failures as missing files. The service now returns a structured error with the requested filename, candidate path, and exact underlying cause, while keeping a stable message independent of cause text.
Also exports make to match the single-file service convention.
Validation:
Note
Medium Risk
Startup paths that load
iconPathscan now fail on I/O errors instead of continuing with no icon; callers must handleDesktopAssetProbeErrorwhere they previously assumed infallible resolution.Overview
Desktop asset resolution no longer treats
FileSystem.existsfailures as “file not found.”resolveResourcePathand Darwin dev dock icon probing now fail with a newDesktopAssetProbeErrorthat carries the requested filename, the candidate path, and the original cause, while exposing a stable user-facing message that does not leak cause text.The
DesktopAssetsservice typing is updated so these paths can error withDesktopAssetProbeError, andmakeis exported to align with other single-file Effect services. A unit test asserts the error shape and message behavior when a probe fails (e.g. permission denied).Reviewed by Cursor Bugbot for commit 36d521d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve filesystem errors in
DesktopAssets.resolveResourcePathasDesktopAssetProbeErrorDesktopAssetProbeError, a structured tagged error carryingfileName,candidatePath, and the original filesystemcause, with a stable message format.resolveResourcePathandresolveIconPathto fail withDesktopAssetProbeErroron filesystem errors instead of silently treating them as non-existence (previously viaorElseSucceed(() => false)).DesktopAssets.makecan now fail during initialization if any icon probe encounters a filesystem error, andresolveResourcePathcallers must now handleDesktopAssetProbeErrorin the error channel.Macroscope summarized 36d521d.