-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: handle workspace.agent and agent.workspace.owner in coder ssh
#18093
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
Conversation
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.
Pull Request Overview
This PR fixes the handling of the ssh command input format by adding support for the "workspace.agent" and "agent.workspace.owner" formats, ensuring parity with the existing Coder Connect workflow.
- Updated SSH tests (cli/ssh_test.go) with new cases such as "myworkspace.dev" and "dev.myworkspace.myuser"
- Modified the workspace normalization logic in cli/ssh.go to correctly transform the new input formats
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/ssh_test.go | Added new test cases for handling "workspace.agent" and "agent.workspace.owner" formats |
| cli/ssh.go | Updated input normalization to support the new formats through specific conditional logic |
Comments suppressed due to low confidence (1)
cli/ssh_test.go:117
- Include an assertion comment or additional explicit test expectations for the normalized output of this new input format to verify that the transformation to 'owner/workspace.agent' is correct.
"dev.myworkspace.myuser",
99db25d to
df1ec50
Compare
|
Would this also support |
|
With this PR: |
|
/cherry-pick release/2.22 |

Closes #18088.
The linked issue is misleading --
coder config-sshcontinues to support thecoder.prefix. The reason the commandssh coder.workspace.agentfails is becausecoder ssh workspace.agentwasn't supported. This PR fixes that.We know we used to support

workspace.agent, as this is what we (used to) recommend in the Web UI:This PR also adds support for
coder ssh agent.workspace.owner, such that after runningcoder config-ssh, a command likeworks, even without Coder Connect running. This is done for parity with an existing workflow that uses
ssh workspace.coder, which either uses Coder Connect if available, or the CLI.