Skip to content

fix: keep windows endpoint writes progressing - #3721

Open
Pimpmuckl wants to merge 2 commits into
fix/windows-ssh-cold-startfrom
fix/windows-endpoint-paste
Open

fix: keep windows endpoint writes progressing#3721
Pimpmuckl wants to merge 2 commits into
fix/windows-ssh-cold-startfrom
fix/windows-endpoint-paste

Conversation

@Pimpmuckl

@Pimpmuckl Pimpmuckl commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Windows clients can disconnect a remote endpoint when pasting about 7 KB: a nonblocking named-pipe write can make no progress while the SSH bridge polls its 512-byte pipe buffer. Write Windows frames in 512-byte chunks and reset the five-second stall deadline whenever bytes advance. Unix transports keep their existing full-frame writes.

The existing native flush test now uses a polling peer and verifies a complete 1 MiB frame followed by detach. It fails with the old writer and passes with this change. Full just check passed: 2,851 Rust tests plus maintenance, architecture, integration-asset and documentation checks.

Runtime acceptance with one optimized Windows client and five connected servers passed Unicode routing/isolation, 64 KB pastes to both WSL servers and the Windows desktop, Windows SSH/desktop live handoff with shell PID retention, profile rename/disable/enable, client restart, output burst, and idle recovery. The 64 KB pastes completed in 7.5–13.7 seconds in the nested Windows terminal; this fixes the disconnect, but does not claim fast large-paste performance.

Stacked on #3719; this PR changes only the endpoint writer and its existing regression test. Current-head CI, deep local review, CodeRabbit and Greptile are complete and clean.

refs #3651

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

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: Team

Run ID: cd501361-8e29-4baa-9738-d4ae72469342

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

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: dbca8a75-1b2f-46ef-9550-0e2c99075aab

📥 Commits

Reviewing files that changed from the base of the PR and between 205dbdc and 8b9e159.

📒 Files selected for processing (1)
  • src/client/endpoint/writer.rs

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


📝 Walkthrough

Walkthrough

The endpoint writer limits Windows writes to 512-byte chunks and keeps full-frame writes on other platforms. Each successful partial write refreshes the timeout deadline. The large-frame flush test now uses a PollingPeer that polls for available bytes and handles pending or closed stream states.

Suggested reviewers: ogulcancelik

Merge Risk: ⚪ Minimal · up to 8b9e1

Windows endpoint writes are now chunked to keep large pastes progressing while successful writes refresh the stall deadline. The updated large-frame flush coverage supports the intended polling behavior, with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: keeping Windows endpoint writes progressing.
Description check ✅ Passed The description directly explains the Windows write issue, the 512-byte chunking fix, the timeout behavior, regression testing, and validation results.

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.

@kangal-bot

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@kangal-bot: I will review the changes in #3721.

✅ 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

Updates the native endpoint writer to prevent Windows named-pipe writes from stalling when the peer polls a small pipe buffer.

  • Limits Windows writes to 512-byte chunks while retaining full-frame writes on other platforms.
  • Resets the write deadline whenever bytes advance, making it a no-progress timeout.
  • Extends the native flush regression test to model a polling peer and verify complete large-frame delivery before detach.

Confidence Score: 5/5

The pull request appears safe to merge; the endpoint writer now preserves progress under Windows pipe backpressure without changing Unix write behavior.

The Windows writer sends bounded chunks and renews its timeout only after actual progress, while the existing stop flag and no-progress timeout still terminate stalled writes. The regression test exercises a polling peer and verifies that a complete large frame is received before detach.

Important Files Changed

Filename Overview
src/client/endpoint/writer.rs Adds Windows-specific chunked endpoint writes, progress-based stall timeout renewal, and a polling-peer regression test.

Sequence Diagram

sequenceDiagram
  participant W as Endpoint writer
  participant P as Windows named pipe
  participant B as Polling SSH bridge
  loop Until frame is drained
    W->>P: Write up to 512 bytes
    alt Bytes written
      P-->>W: Written byte count
      W->>W: Advance frame and reset stall deadline
    else WouldBlock or zero progress
      W->>W: Poll until progress, cancellation, or timeout
    end
    B->>P: Poll and read available bytes
  end
Loading

Reviews (4): Last reviewed commit: "fix: compile endpoint chunks only on win..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 7, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review September 7, 2026 17:37

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@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 in #3721.

✅ 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 in #3721.

⚠️ Action not completed

No files to review.

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
Pimpmuckl force-pushed the fix/windows-endpoint-paste branch from 0549abc to 6bc877e 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 in #3721.

⚠️ Action not completed

No files to review.

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.

hdosys pushed a commit to hdosys/herdr-win that referenced this pull request Sep 9, 2026
hdosys added a commit to hdosys/herdr-win that referenced this pull request Sep 9, 2026
Append eleven coherent mailboxes without changing stable BASE. Preserve the reviewed foundation except total-count subjects, retain source credit and provenance, and reproduce accepted source 53fd505 at tree 66dcebc. All 24 Windows prefixes compile; the current installer is unchanged.

Refs herdrdev#3661, herdrdev#3701, herdrdev#3721, herdrdev#3651, herdrdev#3592, herdrdev#3589, herdrdev#3770, herdrdev#3779, herdrdev#3742, herdrdev#3735, herdrdev#3781, herdrdev#3778, herdrdev#3787, herdrdev#3766, herdrdev#3755, herdrdev#3754, herdrdev#3807, herdrdev#3764, herdrdev#3760, herdrdev#3746, herdrdev#3744, herdrdev#3819, herdrdev#3759
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