Skip to content

feat(desktop): open SSH worktrees in local Zed - #4362

Open
DeclanRiedel wants to merge 3 commits into
pingdotgg:mainfrom
DeclanRiedel:feature/zed-remote-worktree-open
Open

feat(desktop): open SSH worktrees in local Zed#4362
DeclanRiedel wants to merge 3 commits into
pingdotgg:mainfrom
DeclanRiedel:feature/zed-remote-worktree-open

Conversation

@DeclanRiedel

@DeclanRiedel DeclanRiedel commented Jul 23, 2026

Copy link
Copy Markdown

Fixes #4361

What Changed

  • Show the Open control for SSH-backed threads in the desktop app, limited to Zed.
  • Launch the local zed or zeditor CLI through desktop IPC with an encoded SSH workspace URI.
  • Preserve SSH aliases, usernames, custom ports, IPv6 literals, and home-relative paths.
  • Route Ctrl+O through the same remote launch path and show a toast when launch fails.
  • Keep launch errors free of SSH connection details.
  • Add focused coverage for URI construction, IPv6, command preference, zeditor fallback, detached launching, missing CLI behavior, and picker visibility.

Why

The existing Open action runs in the environment that owns the worktree. For an SSH-backed thread, that environment is remote and cannot launch the user's local graphical editor.

Zed supports opening a remote project from its local CLI through an SSH URL. Launching Zed from the desktop process extends the existing Open and Ctrl+O workflow without changing server-side editor launching.

UI Changes

Before

After

Open control available for an SSH-backed worktree

Interaction

Screencast.From.2026-07-23.12-26-34.mp4

Validation

  • vp test run apps/desktop/src/shell/DesktopZedLauncher.test.ts apps/web/src/components/chat/ChatHeader.test.ts
  • vp run --filter @t3tools/desktop typecheck
  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/contracts typecheck
  • Targeted formatting and lint checks for changed files
  • Manually verified against an SSH-backed worktree with local Zed

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

Note

Low Risk
Adds a bounded desktop-only path that spawns a local Zed CLI with SSH targets from IPC; no auth or server changes, and user-facing launch errors stay generic.

Overview
Adds Open in Zed for SSH-backed projects in the desktop app when the thread has an active project cwd and desktopBridge is available.

A new DesktopZedLauncher resolves zed / zeditor on PATH, builds an encoded ssh:// URI from the SSH connection target and workspace path, and spawns a detached zed -r … process. Launch failures surface generic messages (no SSH details in the launch error path).

The feature is wired through openRemoteZed on the desktop IPC bridge (DesktopOpenRemoteZedInput in contracts). ChatHeader extends shouldShowOpenInPicker so the picker appears on SSH environments (not only the primary local env) and limits editor choices to Zed when an SSH profile is active. OpenInPicker routes those opens to desktopBridge.openRemoteZed instead of the usual shell openInEditor mutation, with error toasts on failure.

Reviewed by Cursor Bugbot for commit 50b3f5c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add 'Open in Zed' support for SSH worktrees via local Zed CLI

  • Adds a DesktopZedLauncher service that searches PATH for zed or zeditor, builds an ssh:// URI from the active SSH environment, and spawns the CLI in detached mode to open the remote workspace.
  • Exposes the launcher via a new openRemoteZed IPC channel, bridged to the renderer as window.desktopBridge.openRemoteZed(input).
  • Updates ChatHeader to detect SSH environments in desktop context and restrict the 'Open in' picker to Zed, routing clicks through the desktop bridge instead of the local editor flow.
  • OpenInPicker handles the remoteZedTarget prop by calling the bridge and showing an error toast on failure.
  • Risk: if neither zed nor zeditor is on PATH, the operation fails with DesktopZedCommandNotFoundError and surfaces an error toast to the user.

Macroscope summarized 50b3f5c.

@coderabbitai

coderabbitai Bot commented Jul 23, 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 Plus

Run ID: 9b5fd285-6582-46f4-b64f-08acb7208a29

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 23, 2026
Comment thread apps/desktop/src/shell/DesktopZedLauncher.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effect service review: one convention violation in the new DesktopZedLaunchError. See inline comment.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/desktop/src/shell/DesktopZedLauncher.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0fca57b. Configure here.

Comment thread apps/desktop/src/shell/DesktopZedLauncher.ts
@macroscopeapp

macroscopeapp Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (opening SSH worktrees in local Zed) with new service components, IPC channels, and UI workflow changes. New features with external process integrations warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@DeclanRiedel
DeclanRiedel force-pushed the feature/zed-remote-worktree-open branch from 0fca57b to 50b3f5c Compare August 3, 2026 08:12
@DeclanRiedel DeclanRiedel changed the title Feature/zed remote worktree open (Issue #4361) feat(desktop): open SSH worktrees in local Zed Aug 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:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Open SSH worktrees in local Zed

1 participant