[codex] Structure desktop network interface failures - #3313
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 Adds a structured error class for network interface read failures with accompanying tests. The core network reading behavior is unchanged - only error representation is improved. Low-risk, self-contained enhancement. You can customize Macroscope's approvability policy. Learn more. |
Summary
HostProcessPlatformand construct the error directlyValidation
vp test apps/desktop/src/backend/DesktopNetworkInterfaces.test.tsvp checkvp run typecheckOverlap audit
apps/desktop/src/backend/DesktopNetworkInterfaces.tsor its new focused test.Note
Low Risk
Localized desktop backend error-handling change with no auth or data-path impact; behavior on success is unchanged and failures remain defects via orDie.
Overview
DesktopNetworkInterfaces.readno longer callsnode:os.networkInterfaces()via bareEffect.sync. Failures are caught and wrapped in a newDesktopNetworkInterfacesReadError(platform fromHostProcessPlatform, original throwable ascause), thenEffect.orDieso callers still see a defect on failure.Service construction moves from a synchronous
make()+Layer.succeedtoEffect.gen+Layer.effect, so the layer depends onHostProcessPlatform.Adds
DesktopNetworkInterfaces.test.tswith a mockednode:os, covering a successful read and asserting squashed failure shape/message for probe errors.Reviewed by Cursor Bugbot for commit 4060907. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure network interface read failures as typed defects in
DesktopNetworkInterfacesDesktopNetworkInterfacesReadError, aSchema.TaggedErrorcarryingplatformandcausefields, replacing raw thrown errors fromnode:os.networkInterfaces.makeinto anEffect.genthat readsHostProcessPlatformfrom the environment and wraps any read failure in the structured error before converting it to a defect viaEffect.orDie.layerfromLayer.succeedtoLayer.effectto match the effectfulmake.Macroscope summarized 4060907.