Skip to content

Make SSH Effect usage more idiomatic#2930

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

Make SSH Effect usage more idiomatic#2930
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-55ca

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented Jun 3, 2026

What Changed

  • Converted @t3tools/ssh error classes from Data.TaggedError to schema-backed Schema.TaggedErrorClass definitions and added SSH error union schemas.
  • Added Duration-first timeout fields for SSH command and tunnel readiness flows while keeping the old millisecond fields as deprecated compatibility inputs.
  • Replaced schema-error instanceof checks with hoisted Schema.is guards and added focused coverage for serializable SSH errors.

Why

This keeps the SSH package aligned with idiomatic Effect practices: native Duration values flow into timeout/schedule/process APIs, and tagged errors now have structured schemas for serialization and schema-aware narrowing.

UI Changes

Not applicable; no UI changes.

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 instanceof checks and numeric millisecond timeouts with Effect Duration and schema-based predicates in SSH packages

  • Rewrites SSH error classes in packages/ssh/src/errors.ts from Data.TaggedError to Schema.TaggedErrorClass, making them encodable/decodable and checkable via Schema.is instead of instanceof.
  • Replaces raw millisecond constants with Duration constants throughout packages/ssh/src/tunnel.ts and packages/ssh/src/command.ts; effective timeout durations are unchanged.
  • Adds a timeout?: Duration.Input field to RunSshCommandOptions and waitForHttpReady, deprecating the old *Ms numeric fields while retaining backwards compatibility.
  • Risk: callers that relied on instanceof checks against SSH error classes may need to switch to Schema.is-based predicates.

Macroscope summarized c66a839.

cursoragent and others added 2 commits June 3, 2026 16:06
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 vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jun 3, 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