Skip to content

fix: SSH connection sometimes doesn't read until EOF#375

Merged
BinaryMuse merged 2 commits intomainfrom
mkt/fix-only-once-ssh
Feb 3, 2026
Merged

fix: SSH connection sometimes doesn't read until EOF#375
BinaryMuse merged 2 commits intomainfrom
mkt/fix-only-once-ssh

Conversation

@BinaryMuse
Copy link
Member

Don't stop reading from SSH session until EOF

Previously, we breaked when receiving the ExitStatus message, but per RFC 4254 §6.10, this doesn't mean all data has arrived. We now log and continue reading data until we get the actual EOF.

It's not clear to me if this affects #373 at all; I'm not able to reproduce that exact issue, but I was able to reproduce a somewhat similar one with script blocks that this does fix.

Call exec_finished when SSH command fails

This is just a failure mode that we didn't handle correctly - if the SSH command failed to run, we never called exec_finished.

@BinaryMuse BinaryMuse marked this pull request as ready for review January 29, 2026 21:03
@BinaryMuse BinaryMuse requested a review from ellie January 29, 2026 21:03
@BinaryMuse BinaryMuse changed the title fix: Misc. script and terminal block SSH fixes fix: SSH connection sometimes doesn't read until EOF Jan 29, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

Fixed two SSH session handling issues: ensured exec_finished is called when command execution fails, and corrected RFC 4254 §6.10 compliance by continuing to read data until EOF instead of breaking early on ExitStatus.

  • Added missing exec_finished call in error path when channel.exec() fails
  • Removed premature loop exit on ExitStatus message to prevent data loss
  • Added explanatory comment about RFC 4254 §6.10 requirement

Important Files Changed

Filename Overview
crates/atuin-desktop-runtime/src/ssh/session.rs Fixed missing exec_finished call on command failure and corrected RFC 4254 compliance by waiting for EOF instead of breaking on ExitStatus

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@BinaryMuse BinaryMuse enabled auto-merge (squash) January 29, 2026 22:24
@BinaryMuse BinaryMuse merged commit af15d97 into main Feb 3, 2026
10 checks passed
@BinaryMuse BinaryMuse deleted the mkt/fix-only-once-ssh branch February 3, 2026 18:35
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants