-
Notifications
You must be signed in to change notification settings - Fork 887
feat(agent): Add SSH max timeout option for coder agent #6596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(agent): Add SSH max timeout option for coder agent #6596
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Exciting! It'd be nice to print out to TTY sessions why the connection is closing as well. Would adding an additional authentication step to keep a connection alive be of interest? We could make this experience super slick in the VS Code extension as well... essentially just hanging all SSH connections until the user refreshes an authentication token. |
I'll have a look 👀
That would be nice user experience. We are using a mix of VS Code and Intellij at the moment but anything would be nice. |
By the way @bensejas we're happy to merge with the functionality this has right now if it's blocking you. No need to wait for a bunch more features! |
Awesome, that would be good. Thanks @kylecarbs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest we add a test, but I don't think that's overly required since the value is just being piped through.
Be weary that users may report disconnection issues though, because this will just terminate things!
agent/agent.go
Outdated
@@ -78,6 +78,7 @@ type Options struct { | |||
EnvironmentVariables map[string]string | |||
Logger slog.Logger | |||
AgentPorts map[int]string | |||
SshMaxTimeout time.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SshMaxTimeout time.Duration | |
SSHMaxTimeout time.Duration |
@kylecarbs I fixed up the linting and updated the test snapshot. It looks like I don't have permission to run the test workflows to check. |
Approved! I'll merge once passing. |
Context
We want to users re-authenticate after a set period of time. This is achievable on the browser side but not once users are connected through SSH.
Changes
Add an option to set a max timeout for SSH connections on the coder agent.
Future work
./provisioner/scripts/*