Skip to content

fix: recover blocked shared ssh connections - #5252

Merged
JJLiebig merged 3 commits into
masterfrom
issue/4721-shared-ssh-recovery
Oct 14, 2026
Merged

JJLiebig merged 3 commits into
masterfrom
issue/4721-shared-ssh-recovery

Conversation

@JJLiebig

Copy link
Copy Markdown
Collaborator

Recover blocked shared SSH reuse when a fresh connection to the same host works, while preserving existing sessions. Saved TUI attach checks reuse up front; healthy API/status calls stay unchanged and recover only after a read-only failure. Connection setup retries once, and remote mutations are never replayed.

Validated with just check, focused Unix tests/lint, and real WSL OpenSSH loopback tests for frozen TCP, two active channels, concurrent replacement, ProxyJump, slow healthy shells, and host-key/authentication failures. Physical macOS sleep and WAN/load were not tested.

@kangal-bot

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d85bbb2d-83a0-4bba-88ce-6d856ad9da55
📥 Commits

Reviewing files that changed from the base of the PR and between c61b9f5 and 4b81847.

📒 Files selected for processing: 1
  • src/remote/process.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Saved SSH connections now check whether the managed transport can be reused and can retry setup under defined conditions. CLI status and API commands use transport recovery after an initial read-only connection failure. Unix transport preparation pins and probes the managed control socket, tests a fresh connection, and retires a stale master when appropriate. Bounded SSH diagnostic capture and tests for recovery outcomes were added.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 4b818

This change adds recovery for managed SSH connections without replaying remote mutations. No verified material failure remains to block merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: recovery of blocked shared SSH connections.
Description check Passed The description explains the SSH recovery behavior, retry limits, session preservation, and reported validation.
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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 Oct 13, 2026 •

Copy link
Copy Markdown
✅ 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 Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High impact] The cancellation-test change appears safe to merge.

Summary

The PR adds recovery for blocked shared SSH connections while keeping existing sessions open. Since the previous review, only the cancellation test changed.

  • Saved SSH reconnects when a shared connection stops opening channels.
  • Machine API retries connection setup without repeating remote commands.

Reviews (3) · Last reviewed commit: "test: separate ssh cancellation from tim..." · Reviewed by Greptile

Comment thread src/remote/attach.rs Resolved
greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 13, 2026
@JJLiebig JJLiebig added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Oct 14, 2026
@JJLiebig

Copy link
Copy Markdown
Collaborator Author

@greptileai

@JJLiebig
JJLiebig merged commit 6521382 into master Oct 14, 2026
8 checks passed
aceitw added a commit to aceitw/herdr that referenced this pull request Oct 18, 2026
Keep our fork features (federation, gram, api-bridge, guest, push,
notifications, agent archive/forget/transfer, accounts, staged updates)
alongside upstream's v0.9.4, v0.9.5 and unreleased fixes. Most source
conflicts keep our fork's Method enum (upstream's define_operations!
macro cannot express our cfg-gated and serde-skipped variants). Detection
manifests keep our extra rules; Codex integration scripts switch to
upstream's canonical version.

Upstream highlights:
- Persistent macOS/Linux server (SIGHUP no longer stops it)
- Session saves on system shutdown/restart
- Plugin update command
- Keyboard/IME fixes (non-Latin layouts, Ctrl+Shift, accents)
- Windows improvements (PowerShell 7 default, clipboard, notifications)
- SSH compression and bandwidth improvements
- Performance fixes (CPU, memory, hidden pane improvements)
- Codex, Claude Code, Pi, Antigravity, Grok detection updates
- New platform modules (launchd spawn, power/shutdown)
- Vendor patches (libghostty-vt cursor hyperlink, portable-pty Windows dir)

refs herdrdev#5310, herdrdev#5278, herdrdev#5236, herdrdev#5303, herdrdev#5308, herdrdev#5275, herdrdev#5280, herdrdev#5282,
     herdrdev#5277, herdrdev#5276, herdrdev#5270, herdrdev#5269, herdrdev#5252, herdrdev#5249, herdrdev#5247, herdrdev#5241,
     herdrdev#5242, herdrdev#5192, herdrdev#5232, herdrdev#5212, herdrdev#5174, herdrdev#5173, herdrdev#5171, herdrdev#5092
maciejul pushed a commit to maciejul/herdr-supercharged that referenced this pull request Oct 28, 2026
* fix: recover blocked shared ssh connections

refs herdrdev#4721

* test: support shared ssh checks in client fixtures

refs herdrdev#4721

* test: separate ssh cancellation from timeout scheduling

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

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants