-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(agent/agentssh)!: use configured directory for SFTP connections #21194
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
base: main
Are you sure you want to change the base?
Conversation
Previously, SFTP connections always landed in the user's home directory, ignoring the agent's configured working directory. This was inconsistent with SSH sessions and rsync, which respected the configured directory. Now SFTP connections use the same logic: check the configured working directory first, falling back to home directory only when not set.
|
We could consider tagging this change breaking. |
|
I agree it's inconsistent, but I do worry about this being a breaking change. We had to modify Mutagen for Coder Desktop to fix it's assumption that The RFC says it is "usually" the home directory, but leaves room for it to be something else. If we merge this we could find that scripts that Is there some particularly compelling reason we need this? |
That's fair. If we do it, we should flag it with
To me this actually argues in favor of fixing this. Tooling shouldn't need to patch around our quirks. If people integrating with Coder end up hitting the same gotcha over and over, that's a sign the behavior is surprising and worth correcting.
Since it's not guaranteed, it leaves room for us to make the behavior match the rest of our SSH flow. That feels like supporting evidence, not a blocker.
This is a real risk. The question is how common the pattern actually is. For breakage to happen, all of these have to line up:
It's possible, but the overlap seems small.
Consistency and meeting expectations. We understand the system better than most users, yet we trip over this internally (mutagen, I in everyday use, etc.). Customers won't have that context. If two similar commands land files in different places depending on the tool, that's a problem. The SSH directory change was added in 8701e00, but when |
|
For me the Mutagen thing is an argument to drop the whole But, I do take your point that if we take as given that feature won't be going away, having consistency between shells and SFTP is better than inconsistency. You can mark me down as in favor of making the breaking change, but we absolutely need to call it out in the release notes. cc @david-fraley |
I very much agree 👍🏻. I don't see us removing the feature, but we could perhaps discourage its use in the terraform documentation (or note that it introduces non-standard behavior). |
When a workspace agent has a configured directory, SSH sessions and
rsyncland there, but SFTP/SCP land in$HOME. This meansrsync file.txt coder:.andscp file.txt coder:.put the file in different places, which is confusing.The SFTP handler was hardcoded to use the home directory instead of checking the configured working directory like SSH does. Now it checks the config first and falls back to home only if unset.