Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@osm1892
Copy link
Contributor

@osm1892 osm1892 commented Oct 14, 2025

OpenSSH's ServerAliveInterval and ConnectTimeout are in seconds, while Tabby handles them as milliseconds.
To fix this incompatibility, the import process now multiplies these values by 1000, converting them from seconds to ms.

Copilot AI review requested due to automatic review settings October 14, 2025 05:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes a unit conversion issue where OpenSSH configuration values for ServerAliveInterval and ConnectTimeout (measured in seconds) were being imported into Tabby as-is, despite Tabby expecting these values in milliseconds.

  • Separated handling of KeepaliveInterval and ReadyTimeout from other integer properties
  • Added conversion logic to multiply these time-based values by 1000 during import

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Eugeny
Copy link
Owner

Eugeny commented Oct 16, 2025

I don't see any runtime changes that your PR could introduce?

@osm1892
Copy link
Contributor Author

osm1892 commented Oct 17, 2025

I don't see any runtime changes that your PR could introduce?

The ServerAliveInterval and ConnectTimeout directives in the standard SSH config are originally specified in seconds, and OpenSSH clients interpret them as such. However, Tabby internally handles its corresponding fields—KeepAliveInterval and ReadyTimeout—in milliseconds (ms).

During the config import process, Tabby currently assigns the ServerAliveInterval and ConnectTimeout values directly to its internal fields. This mismatch in units causes problems:

If a user sets a standard parameter like 60 (1 minute) in their OpenSSH config, Tabby treats this as 60ms. Furthermore, if there is a subsequent division by 1000 internally, the field value becomes 0 because the value is less than 1000. This results in a connection error when attempting to connect using the imported SSH profile.

To set a functional value, a user must currently specify a value of 1000 or greater. The core issue is that setting the ServerAliveInterval to, say, 1000 seconds (to satisfy Tabby's ms requirement) virtually disables the heartbeat in any other standard SSH program, as the default SSH server timeout is usually around 300 seconds.

Therefore, to eliminate this unit discrepancy and ensure compatibility, I've added logic to multiply the value by 1000 for these specific fields during the config import process.

@Eugeny
Copy link
Owner

Eugeny commented Oct 20, 2025

Oh nevermind - I was accidentally looking at a diff of a single commit only - thanks!

@Eugeny Eugeny merged commit bbcb026 into Eugeny:master Oct 20, 2025
9 of 10 checks passed
@Eugeny
Copy link
Owner

Eugeny commented Oct 20, 2025

@all-contributors add @osm1892 for code

@osm1892 osm1892 deleted the ssh-aliveinterval-fix branch October 21, 2025 01:05
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