Skip to content

fix(ssh): treat negative keepalive replies as liveness - #1214

Merged
skevetter merged 1 commit into
mainfrom
fabulous-dragon
Sep 10, 2026
Merged

fix(ssh): treat negative keepalive replies as liveness#1214
skevetter merged 1 commit into
mainfrom
fabulous-dragon

Conversation

@skevetter

@skevetter skevetter commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary\n\n- treat both positive and negative SSH keepalive replies as proof of peer liveness\n- continue reporting genuine SSH transport errors\n- add regression coverage for unsupported keepalive requests against the Devsy SSH server\n\nFixes #1210.

Summary by CodeRabbit

  • Bug Fixes
    • SSH keepalive handling now remains stable when servers accept or reject keepalive requests.
    • Genuine SSH transport failures continue to be reported.
    • Normal SSH session execution remains unaffected when keepalive requests are rejected.

@netlify

netlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 6fd7fe6
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6aa2254ea2e75400081a1a22

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2bb891b3-c660-467c-9472-a1afe98560b0

📥 Commits

Reviewing files that changed from the base of the PR and between b291bd1 and 6fd7fe6.

📒 Files selected for processing (2)
  • cmd/workspace/ssh.go
  • cmd/workspace/ssh_keepalive_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The SSH keepalive handler now ignores rejected replies while preserving transport errors. Tests cover both response types and validate behavior against the production SSH server, including a normal session.

Changes

SSH keepalive handling

Layer / File(s) Summary
Keepalive response behavior
cmd/workspace/ssh.go
checkKeepAliveResponse returns errors only when the transport request fails.
Keepalive test coverage
cmd/workspace/ssh_keepalive_test.go
Unit tests cover accepted and rejected replies, wrapped transport errors, and an integration flow with the production SSH server and a normal session.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 6fd7f

SSH keepalives now recognize both accepted and rejected replies as proof of liveness while continuing to report transport failures. Coverage includes the production server and normal sessions, so the change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: treating negative SSH keepalive replies as evidence of peer liveness.
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
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fabulous-dragon

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.

@netlify

netlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 6fd7fe6
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6aa2254ebe4c880008b1d8f9

@skevetter
skevetter marked this pull request as ready for review September 10, 2026 16:39
@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@skevetter
skevetter merged commit 6db91fb into main Sep 10, 2026
84 of 85 checks passed
@skevetter
skevetter deleted the fabulous-dragon branch September 10, 2026 16:42
@skevetter skevetter linked an issue Sep 11, 2026 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: workspace ssh logs spurious ERROR "keepalive request rejected" every ~55s

1 participant