[codex] Refactor shared and SSH Effect services#3206
Conversation
|
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 |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityVerdict: Needs human review This major refactor converts error handling from Data.TaggedError to Schema.TaggedErrorClass across SSH, networking, and authentication code, changing runtime behavior in several places (e.g., fallback instead of fail on probe errors). The scope across 30+ files and changes to sensitive authentication/IPC code warrant careful human review. You can customize Macroscope's approvability policy. Learn more. |
0b6d15f to
b04704c
Compare
7106351 to
a4af44e
Compare
a4af44e to
91f873b
Compare
Dismissing prior approval to re-evaluate 91f873b
470e248 to
c20caa0
Compare
Dismissing prior approval to re-evaluate c20caa0
c20caa0 to
6999c3a
Compare
799b906 to
bd827ee
Compare
2d458d2 to
0cc0afd
Compare
8d916bc to
7670d78
Compare
0cc0afd to
683a20e
Compare
7670d78 to
1ed6271
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
NetService,SshPasswordPrompt,SshEnvironmentManager, and the desktop SSH environment on inline service contracts andService["Service"]referencesmakefactories and canonicallayerconstructorsRelayClientabstract while preserving the implementation-specificmakeCloudflaredRelayClientandlayerCloudflaredexportsSchema.TaggedErrorClasserrors, with categorySchema.Unionexports and diagnostic attributes preservedReview fixes
makeCloudflaredRelayClientandlayerCloudflarednaming for the abstract relay client portScope
Orchestration and MCP modules are intentionally untouched. Existing suites changed only for service references and focused behavior/error-chain regressions; this PR adds no broad refactor-only test suite.
Validation
vp check(passes with 20 existing warnings in files outside this PR)vp run typecheckgit diff --check origin/main...HEADNote
High Risk
Large cross-package error-model and SSH/desktop IPC boundary changes affect authentication, remote pairing, relay installation, and command resolution; regressions would surface as misclassified or stripped errors at the renderer.
Overview
Replaces broad
Data.TaggedErrortypes across SSH, shared (Net,shell,relayClient), desktop, contracts, and server withSchema.TaggedErrorClassunions, computedmessagegetters, and structured fields (targets, byte counts, platform, sanitized URL diagnostics) instead of embedding raw stdout/stderr or full command lines in errors.SSH splits monolithic failures into typed variants (
SshCommandSpawnError,SshCommandExitError, password-prompt subclasses, launch/pairing/readiness/HTTP-bridge errors); desktop IPC maps prompt tags explicitly and keeps structural SSH errors at the invoke boundary. Relay install uses many concrete install errors server-side, maps them to wirereasononRelayClientInstallFailedError(internalcausenot serialized). Auth/authorization drops redundantmessagefields from schemas (EnvironmentAuthorizationError, remote request unions).Resilience: desktop legacy user-data and asset
existsprobes log warnings and fall back instead of failing;resolveCommandPathskips failed PATH **stat**s when a later candidate works; loopback port reservation gets distinct listen/address/release errors.Tests shift to
Schema.is, logging assertions, IPC cause identity, and trimmed generator suites.Reviewed by Cursor Bugbot for commit 9ed4bf4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Refactor SSH and shared Effect services to use structured, typed error classes
Data.TaggedErrorerror classes across SSH, Net, relay client, and desktop services withSchema.TaggedErrorClass-based variants carrying structured fields (e.g.target,stdoutBytes,cause,platform) and standardized message getters.SshTunnelSpawnError,SshCommandExitError,SshAuthenticationHelperError, etc.) instead of a singleSshCommandError; raw stdout/stderr are replaced by byte-length metrics in error payloads.reserveLoopbackPortin Net.ts now distinguishes listen, address-unavailable, and release failures with dedicated error classes;resolveCommandPathForPlatformin shell.ts continues past per-candidate PermissionDenied errors and preserves the first failure as cause.DesktopSshEnvironmentRequestError,RelayClientInstallFailedError, andEnvironmentAuthorizationErrorare migrated to schema-backed classes with computed message getters; encoded forms no longer include amessagefield.SshCommandError,SshLaunchError,SshPairingError,SshHttpBridgeError,SshReadinessError,SshPasswordPromptError,NetError,RelayClientInstallError,CommandResolutionError) must be updated to handle the new typed variants.Macroscope summarized 9ed4bf4.