Repository navigation
Collect SSH logs directly into the support bundle - #373
Merged
Merged
Conversation
Currently, the plugin guesses where the Coder CLI writes its SSH logs by reimplementing the CLI's platform-specific default directory rules. The SSH log collector then stages copies of the logs in a separate folder, and the support bundle collector copies the bundle, appends the staged files to the copy and swaps it in, with retries for Windows file locks. It also collects rotated and bare PID files, and its handling of reused PIDs and of cleanup is hard to follow. With this change, the plugin chooses the SSH log directory itself and passes it to the CLI's SSH ProxyCommand with --log-dir for CLI 2.4.0 and newer, so collection, cleanup and the ProxyCommand always use the same path. The SSH log collector filters the shared directory down to coder-ssh*-<pid>.log files first, then adds every file modified within the last three days, plus the file of the active SSH process regardless of age, directly into the support bundle using zip4j. Each file is cut to its last 50 MB. When the bundle is missing or invalid, the logs go into a separate coder-ssh.zip instead. Cleanup now follows the same rule as the VS Code extension: only files outside the newest 20 and older than seven days are removed. CLIs older than 2.4.0 write their logs to the CLI default location, which the plugin no longer looks at unless the SSH log directory is configured to point there. The README and changelog describe the new behavior.
fioan89
requested review from
EhabY,
aqandrew,
code-asher,
jeremyruppel and
matifali
and removed request for
code-asher
October 16, 2026 22:29
matifali
approved these changes
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the plugin guesses where the Coder CLI writes its SSH logs by reimplementing the CLI's platform-specific default directory rules. The SSH log collector then stages copies of the logs in a separate folder, and the support bundle collector copies the bundle, appends the staged files to the copy and swaps it in, with retries for Windows file locks. It also collects rotated and bare PID files, and its handling of reused PIDs and of cleanup is hard to follow.
With this change, the plugin chooses the SSH log directory itself and passes it to the CLI's SSH ProxyCommand with --log-dir for CLI 2.4.0 and newer, so collection, cleanup and the ProxyCommand always use the same path. The SSH log collector filters the shared directory down to coder-ssh*-.log files first, then adds every file modified within the last three days, plus the file of the active SSH process regardless of age, directly into the support bundle using zip4j. Each file is cut to its last 50 MB. When the bundle is missing or invalid, the logs go into a separate coder-ssh.zip instead. Cleanup now follows the same rule as the VS Code extension: only files outside the newest 20 and older than seven days are removed.
CLIs older than 2.4.0 write their logs to the CLI default location, which the plugin no longer looks at unless the SSH log directory is configured to point there. The README and changelog describe the new behavior.