Skip to content

feat: host remote servers in the signed-in windows desktop - #3713

Open
Pimpmuckl wants to merge 14 commits into
issue/3651-windows-remote-installfrom
issue/3651-windows-desktop-host
Open

feat: host remote servers in the signed-in windows desktop#3713
Pimpmuckl wants to merge 14 commits into
issue/3651-windows-remote-installfrom
issue/3651-windows-desktop-host

Conversation

@Pimpmuckl

Copy link
Copy Markdown
Collaborator

Windows SSH starts Herdr outside the signed-in desktop, so its panes cannot use desktop apps. Add --remote-desktop to direct remote attach and saved-machine setup. After default-No confirmation, Herdr starts the final server through a temporary same-user Windows task, verifies the actual pipe peer account and active Windows session, then removes the task.

Compatible desktop servers reconnect without consent or a new task. Background saved reconnect only attaches. A same-name server outside the eligible desktop is reported as a conflict before stop or handoff consent. Saved profiles store desktop intent, never consent or a Windows session/task identity. Scheduler servers in a non-killing job now correctly report detached lifecycle support.

Depends on #3687. Refs #3651.

Validation: full Windows just check; focused desktop tests; native Windows OpenSSH direct install, default-No refusal, cold start, silent reuse, saved setup/background reconnect, absent reconnect, same-name Session 0 conflict, pane output and resize, and owned-task/environment cleanup. Server and pane ran in Windows session 1, the task was absent after readiness, and reconnect kept the server PID.

Limits: native SSH acceptance used an elevated token; ordinary-user Scheduler registration was not tested. A brief console flash before process initialization remains possible. Desktop hosting does not sign in, unlock Windows, or move existing pane processes between Windows sessions.

Saved reconnect regression: with an older endpoint-capable binary first on PATH, discovery now requires desktop capability and selects the managed binary. Native before/after executable-path inspection proved the selection change while preserving the same desktop server PID; a stopped server stayed stopped.

@kangal-bot

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 7af730b7-a184-443d-b25d-1af3236a3ef3

📥 Commits

Reviewing files that changed from the base of the PR and between fa0b723 and 5bec36c.

📒 Files selected for processing (1)
  • src/remote/attach.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

Adds --remote-desktop support for Windows SSH machines and direct remote attachment. The setting persists in saved profiles and appears in machine listings. Remote preparation validates desktop-host capability and forwards the requirement through bridge and reconnect commands. Windows support inspects user sessions, validates peer identity, and starts the server through a one-time Task Scheduler task. Bootstrap arguments restore configuration and working-directory state. Non-Windows builds return unsupported errors.

Merge Risk: ⚪ Minimal · up to 5bec3

This adds Windows signed-in desktop hosting for remote servers and saved machines, with placement validation and compatibility-aware reconnect discovery. No concrete current-head merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 103 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: hosting remote servers in the signed-in Windows desktop.
Description check ✅ Passed The description directly explains the remote desktop feature, saved-machine behavior, validation, limitations, and related issue references.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

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.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@kangal-bot I will review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds opt-in hosting of remote Herdr servers in the signed-in Windows desktop.

  • Adds --remote-desktop to direct remote attachment and saved-machine setup.
  • Launches cold desktop servers through a temporary same-user Task Scheduler task.
  • Verifies the named-pipe peer’s Windows account and active session before attachment.
  • Persists desktop-hosting intent while keeping background reconnect attachment-only.
  • Requires desktop capability when discovering a compatible managed remote binary.
  • Improves Windows SCP URI encoding and managed ControlPath handling.
  • Corrects detached-server detection for processes in non-terminating Windows jobs.

Confidence Score: 5/5

The PR appears safe to merge; no actionable new failures or outstanding previous findings remain.

The changes since the previous review correctly address managed SCP path handling and test-fixture protocol framing. The earlier desktop-server cleanup concern was manually resolved after the implementation evidence was accepted and Greptile withdrew the finding.

Important Files Changed

Filename Overview
src/platform/windows/desktop_host.rs Implements active-session discovery, peer identity verification, temporary task launch, readiness checks, and task cleanup.
src/remote/attach.rs Integrates desktop capability discovery and placement checks into direct and saved remote setup, with corrected SCP path handling.
src/remote/desktop.rs Adds internal desktop inspection/start commands and transfers the SSH environment into the scheduled desktop server.
src/remote/host.rs Prevents desktop-required background bridges from starting ordinary Session 0 servers and verifies the connected server.
src/client/endpoint/catalog.rs Persists desktop-hosting intent with backward-compatible deserialization for existing catalogs.
src/platform/windows.rs Recognizes servers in non-terminating Windows jobs as detached lifecycle-capable.

Sequence Diagram

sequenceDiagram
    participant C as Local Herdr client
    participant S as Windows SSH session
    participant T as Task Scheduler
    participant D as Desktop Herdr server

    C->>S: Inspect named session and desktop placement
    alt Compatible desktop server exists
        S-->>C: Ready with verified PID and session
    else No eligible server exists
        S-->>C: Start in unique active desktop session
        C->>C: Request explicit confirmation
        C->>S: Start desktop server
        S->>T: Register one-time same-user task
        T->>D: Launch server in selected session
        S->>D: Verify named-pipe peer SID and session
        S->>T: Delete temporary task
        S-->>C: Desktop server ready
    else Same-name server conflicts
        S-->>C: Report conflict without stopping server
    end
    C->>D: Attach with desktop requirement
Loading

Reviews (4): Last reviewed commit: "fix: require desktop support during save..." | Re-trigger Greptile

Comment thread src/platform/windows/desktop_host.rs
@Pimpmuckl
Pimpmuckl force-pushed the issue/3651-windows-desktop-host branch from 215f379 to 1a53b82 Compare September 7, 2026 14:03
@Pimpmuckl

Copy link
Copy Markdown
Collaborator Author

@greptileai re-review the final diff pls and suggest changes for a 5/5 score

@Pimpmuckl
Pimpmuckl force-pushed the issue/3651-windows-desktop-host branch from 1a53b82 to fa0b723 Compare September 7, 2026 18:07
@Pimpmuckl

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@Pimpmuckl I will review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Pimpmuckl
Pimpmuckl force-pushed the issue/3651-windows-desktop-host branch from fa0b723 to 0b8605d Compare September 7, 2026 18:14
@Pimpmuckl
Pimpmuckl force-pushed the issue/3651-windows-desktop-host branch from 0b8605d to 5bec36c Compare September 7, 2026 18:43
@Pimpmuckl

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@Pimpmuckl I will review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants