Skip to content

fix: finish windows ssh setup after bridge exit - #3719

Open
Pimpmuckl wants to merge 3 commits into
issue/3651-windows-live-handofffrom
fix/windows-ssh-cold-start
Open

fix: finish windows ssh setup after bridge exit#3719
Pimpmuckl wants to merge 3 commits into
issue/3651-windows-live-handofffrom
fix/windows-ssh-cold-start

Conversation

@Pimpmuckl

Copy link
Copy Markdown
Collaborator

Cold herdr machine add against Windows SSH started the server but never completed: PowerShell's Start-Process -Wait kept waiting for the persistent server descendant after the bridge exited. Wait only for the bridge process, retaining its handle so Windows PowerShell 5.1 preserves the exit code. This applies to both saved and direct bridge launchers.

Stacked on #3715. No protocol or daemon-launch-policy changes.

Validation:

  • A native Windows process test fails on the old launcher and passes with this change, returning exit code 23 while the descendant remains running.
  • Full just check passed.
  • Real jjdesktop cold machine setup completed and saved the profile; the new server remained healthy in SSH session 0 after the setup connection exited.
  • Local Review Suite review and bounded cleanup pass completed. The constrained-PowerShell finding does not apply as a regression: the existing handshake's Console method calls already fail in that mode.

refs #3651

@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: 0d3eaa7f-2e41-4849-b127-bcadebda91c9

📥 Commits

Reviewing files that changed from the base of the PR and between 1466e7e and c5c339c.

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

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


📝 Walkthrough

Walkthrough

The Windows PowerShell bridge now starts applications with -PassThru, retains the process handle, and calls WaitForExit(). Command expectations use this form. A Windows-only test verifies that the bridge returns exit code 23 while a descendant process remains active.

Suggested reviewers: ogulcancelik

Merge Risk: ⚪ Minimal · up to c5c33

Windows SSH bridge launchers now return the launched application's exit code without waiting for its descendants, with coverage for the cold-start behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 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 identifies the Windows SSH setup fix and the bridge exit behavior that the changes address.
Description check ✅ Passed The description directly explains the Windows SSH setup issue, the PowerShell process-waiting fix, affected launchers, and validation results.
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 changes the Windows PowerShell bridge launcher to wait for only the launched bridge process rather than its persistent descendants while preserving the bridge exit code.

  • Retains the process handle for Windows PowerShell 5.1 exit-code reliability.
  • Applies the behavior to both direct and saved bridge launchers.
  • Adds a native Windows regression test that verifies the bridge exits while its descendant remains alive.
  • Ensures timeout cleanup completes before fallible PID-file reads.

Confidence Score: 5/5

The PR appears safe to merge; the revised launcher preserves the bridge exit status without waiting for the long-lived server descendant, and the regression-test cleanup is now bounded.

No actionable new defects remain. Both previous test-cleanup findings are resolved in the current code: temporary PID paths are collision-resistant, and timeout cleanup terminates and waits for the launcher before PID-file reads or assertions.

Important Files Changed

Filename Overview
src/remote/attach.rs Replaces descendant-aware Start-Process waiting with handle-based bridge-only waiting and adds bounded Windows lifecycle coverage.

Sequence Diagram

sequenceDiagram
    participant PS as PowerShell launcher
    participant B as Bridge process
    participant S as Server descendant
    PS->>B: Start-Process -PassThru
    B->>S: Start persistent server
    B-->>PS: Exit with bridge status
    PS->>B: WaitForExit()
    PS-->>PS: Read bridge ExitCode
    Note over S: Continues running after bridge exit
    PS-->>PS: Exit with bridge status
Loading

Reviews (4): Last reviewed commit: "test: clean up bridge launcher before pi..." | Re-trigger Greptile

Comment thread src/remote/attach.rs
@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.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 7, 2026
@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.

Comment thread src/remote/attach.rs Outdated
greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 7, 2026
@Pimpmuckl
Pimpmuckl force-pushed the fix/windows-ssh-cold-start branch from 0a3b882 to c5c339c 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