Skip to content

[codex] Structure desktop network interface failures - #3313

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-network-interface-errors
Jun 20, 2026
Merged

[codex] Structure desktop network interface failures#3313
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-network-interface-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • wrap synchronous operating-system network-interface probe failures in a Schema error
  • retain the host platform and exact underlying cause while preserving the service's existing defect semantics
  • inject the host platform through HostProcessPlatform and construct the error directly
  • add focused success and failure coverage

Validation

  • vp test apps/desktop/src/backend/DesktopNetworkInterfaces.test.ts
  • vp check
  • vp run typecheck

Overlap audit

  • no open pull request touches apps/desktop/src/backend/DesktopNetworkInterfaces.ts or 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.read no longer calls node:os.networkInterfaces() via bare Effect.sync. Failures are caught and wrapped in a new DesktopNetworkInterfacesReadError (platform from HostProcessPlatform, original throwable as cause), then Effect.orDie so callers still see a defect on failure.

Service construction moves from a synchronous make() + Layer.succeed to Effect.gen + Layer.effect, so the layer depends on HostProcessPlatform.

Adds DesktopNetworkInterfaces.test.ts with a mocked node: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 DesktopNetworkInterfaces

  • Introduces DesktopNetworkInterfacesReadError, a Schema.TaggedError carrying platform and cause fields, replacing raw thrown errors from node:os.networkInterfaces.
  • Refactors make into an Effect.gen that reads HostProcessPlatform from the environment and wraps any read failure in the structured error before converting it to a defect via Effect.orDie.
  • Updates layer from Layer.succeed to Layer.effect to match the effectful make.
  • Adds a vitest suite in DesktopNetworkInterfaces.test.ts covering both successful reads and structured defect shape on failure.

Macroscope summarized 4060907.

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: 7eaa8a81-4e57-419b-a829-dbf6b99e7b03

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-network-interface-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:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@juliusmarminge
juliusmarminge merged commit ce0c20b into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/desktop-network-interface-errors branch June 20, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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