Skip to content

Use more idiomatic Effect services and durations#2628

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-cfd7
Draft

Use more idiomatic Effect services and durations#2628
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-cfd7

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 10, 2026

What Changed

  • Added an Effect Context.Service for server environment label command execution and updated tests to use Layer.mock plus assert instead of module mocks/expect.
  • Added a structured Schema.TaggedErrorClass for label command failures.
  • Reworked SSH command/readiness timeout options and constants to use Duration.Input / Duration instead of millisecond-only fields.

Why

This keeps command execution mockable through Effect layers, makes failures typed and structured, and moves timeout policies toward Effect's native duration primitives.

UI Changes

Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web View Automation 

Note

Replace numeric millisecond timeouts and null returns with Effect Duration and Option types

  • Replaces raw millisecond numbers in RunSshCommandOptions and waitForHttpReady with Duration.Input parameters; internal constants in tunnel.ts and command.ts are also converted to Duration values.
  • Replaces string | null returns with Option<string> throughout ServerEnvironmentLabel.ts for normalizeLabel, parseMachineInfoValue, readLinuxMachineInfo, and related helpers.
  • Extracts command execution in ServerEnvironmentLabel into an injectable ServerEnvironmentLabelCommandRunner service, with a live layer backed by ChildProcessSpawner and a structured ServerEnvironmentLabelCommandError type.
  • Behavioral Change: RunSshCommandOptions.timeoutMs is replaced by timeout?: Duration.Input; callers passing a raw number must update to a Duration value.

Macroscope summarized 6240442.

cursoragent and others added 2 commits May 10, 2026 16:09
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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