fix(web): open remote editors with the environment user #8305
Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/8305/headopened View on GitHub- apps/server/src/environment/RemoteOpenTargets.ts lines 47 to 64OutdatedResolvedby jakeleventhal(GitHub profile, opens in a new tab)@@ -52,12 +53,12 @@5253 Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),5354 );5455 if (magicDnsName !== null) {55- targets.push({ kind: "tailscale", host: magicDnsName });56+ targets.push({ kind: "tailscale", host: magicDnsName, username });5657 }57585859 // os.hostname() may already be an FQDN (macOS often reports5960 // "Name.local"); mDNS names are always `<first-label>.local`.6061 const hostname = yield* HostProcessHostname;6162 const shortHostname = hostname.split(".")[0]?.trim();6263 if (shortHostname !== undefined && shortHostname.length > 0) {63- targets.push({ kind: "mdns", host: `${shortHostname}.local` });64+ targets.push({ kind: "mdns", host: `${shortHostname}.local`, username });
- packages/shared/src/hostProcess.ts line 39Resolvedby jakeleventhal(GitHub profile, opens in a new tab)@@ -23,3 +23,9 @@2323 },2424 );252526+export const HostProcessUsername = Context.Reference<string>(27+ "@t3tools/shared/hostProcess/HostProcessUsername",28+ {29+ defaultValue: () => NodeOS.userInfo().username,30+ },31+);
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelsmacroscope-review
maria-rcks closed this
maria-rcks reopened this
maria-rcks closed this
Sign in to join this conversation.


Important
Review skipped#
We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting
@coderabbitai full review.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
d35a2e0f-2fc0-425e-a176-c1f7885657f6📥 Commits
Reviewing files that changed from the base of the PR and between 28fd0e5d63a841978f7389d161dba1d2b1907725 and 8e0d3d950e4b91e08130aba3f5bd85697545a213.
📒 Files selected for processing (2)
apps/web/src/components/chat/OpenInPicker.tsxpackages/contracts/src/editor.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
The change propagates optional SSH usernames from host discovery and desktop SSH profiles into remote-open targets and editor URLs. It adds username-aware URL construction and permits login usernames in Zed SSH paths. Tests cover username handling and hostname-only targets.
Changes#
Remote SSH username propagation
packages/shared/src/hostProcess.ts,packages/contracts/src/editor.tsHostProcessUsername. Remote-open targets and editor URL construction accept an optional username.apps/server/src/environment/RemoteOpenTargets.ts,apps/server/src/environment/RemoteOpenTargets.test.tsapps/web/src/remoteOpen.ts,apps/web/src/remoteOpen.test.ts,apps/web/src/components/chat/OpenInPicker.tsx,apps/desktop/src/electron/ElectronShell.ts,apps/desktop/src/electron/ElectronShell.test.tsPriority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarmingeMerge Risk
Merge Risk: ⚪ Minimal · up to
8e0d3Remote editor links carry the intended SSH username, and host-only links remain supported when no username is available. No concrete merge-blocking issue is established.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
8e0d3The change selects the intended SSH login while preserving existing route selection and editor restrictions. It does not itself grant SSH access. Unusual username characters and their interpretation by installed editors remain incompletely verified.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
#14102] The web layer takes the username from the desktop SSH connection profile (remoteOpen.ts) and includes it in the resolved remote target. The server advertises its process username for Tailsc…#14102]: username discovery and propagation, remote URL construction, Zed URL validation, and tests for these behaviors. The optional wire field supports compatibility fo…✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.