Skip to content

fix: un-deprecate coder_agent dir - #549

Merged
aqandrew merged 2 commits into
mainfrom
andrew/desk-2-remove-filesync-warning
Oct 6, 2026
Merged

aqandrew merged 2 commits into
mainfrom
andrew/desk-2-remove-filesync-warning

Conversation

@aqandrew

@aqandrew aqandrew commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Un-deprecates coder_agent.dir by reverting #507.

#507 (DEVEX-227) added the Deprecated: field, the ~> Warning description block, and the WarnDirNotHome plan-time validator together, solely because a non-$HOME dir broke Coder Desktop file sync. That is fixed in coder/mutagen#10, now released and bundled into the macOS and Windows Desktop clients. @matifali, @code-asher, and @zenithwolf1000 confirmed in this PR that file sync was the only reason for the deprecation.

Tracked in DESK-2.

Changes

  • provider/agent.go: remove Deprecated: and ValidateFunc from dir. The description now notes that SFTP and scp resolve relative and ~/-prefixed paths against dir, so file transfers should use absolute paths. The rest of the file matches its state before chore: warn when coder_agent dir breaks Desktop file sync #507.
  • provider/helpers/validation.go, validation_test.go: delete WarnDirNotHome and TestWarnDirNotHome.
  • docs/resources/agent.md: regenerated with make gen. dir is listed as a plain (String) again.

Why keep a note about scp

Modern OpenSSH scp strips ~/ on the client (prepare_remote_path()), so scp host:~/foo lands in dir. The server can't tell ~/foo from foo, and devcontainer workspaceFolder behaves the same way regardless of dir, so this is documented instead of warned about.

Testing

  • go test ./provider/..., go build ./..., go vet ./provider/..., and gofmt pass.
  • make gen diff is limited to the dir entry.

Follow-up

After this ships in a provider release, a small coder/coder PR will append an update to the dir row in the 2.29–2.34 ESR upgrade notes (keeping the original text) saying dir was un-deprecated in that release.

Decision log
  • First version of this PR only removed the "breaks Coder Desktop file sync" sentence and kept the deprecation.
  • @matifali asked whether dir should be un-deprecated instead. Git history showed dir was not deprecated before chore: warn when coder_agent dir breaks Desktop file sync #507, and chore: warn when coder_agent dir breaks Desktop file sync #507's only stated reason was file sync (DEVEX-227). No separate tracking issue exists.
  • @matifali: "IIRC yes" (file sync was the only reason). @code-asher: file sync was the only reported issue; plain scp still resolves ~/ against dir. @zenithwolf1000 (chore: warn when coder_agent dir breaks Desktop file sync #507 author): "let's clean up the deprecation warning altogether".
  • The scp behavior is an OpenSSH client assumption that the server cannot detect, and devcontainers hit it independently of dir, so removing dir would not remove it. Decision: un-deprecate and document absolute paths.
  • No min-version gate: with the deprecation gone there is no plan-time warning to time. Users on pre-fix Desktop clients get file sync working by updating Desktop.
  • ESR 2.29–2.34 upgrade note: keep the original row as history and append an update line in a follow-up coder/coder PR once the provider version is known.

🤖 Opened by Coder Agents on behalf of @aqandrew.

The coder_agent.dir plan/apply-time warning claimed that setting dir to a
value other than $HOME breaks Coder Desktop file sync. That is no longer
accurate now that the Mutagen fix (coder/mutagen#10) is released and bundled
into the macOS and Windows Desktop clients, which resolve the agent's absolute
home directory and use it for both the scp copy and the ssh exec.

Remove the file-sync sentence from WarnDirNotHome and from the dir field
description, and regenerate docs. The dir deprecation itself is unchanged and
still steers users to $HOME, so no min-version/adoption gate is needed.

Tracked in DESK-2.

Opened by Coder Agents on behalf of @aqandrew.
@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

DESK-2

Comment thread provider/agent.go Outdated
Comment thread provider/helpers/validation.go Outdated
@aqandrew

Copy link
Copy Markdown
Contributor Author

Good catch — you're right that as written this only changes the wording and the provider still emits a deprecation warning.

I dug into the history: dir wasn't deprecated before #507. That PR added the Deprecated: field, the description warning, and the WarnDirNotHome validator together, and its stated reason was Coder Desktop file-sync compatibility (Refs DEVEX-227). I couldn't find any other rationale or a separate tracking issue for the deprecation.

Since the file-sync problem is now fixed (coder/mutagen#10, released and bundled into both Desktop clients), the original justification for the deprecation is gone. So the cleaner change is to fully un-deprecate dir rather than just reword: revert #507 entirely — drop the Deprecated: field, the description warning, and the ValidateFunc, delete WarnDirNotHome and its test, and regenerate the docs.

Before I expand this PR to do that: was file sync the only reason we deprecated dir, or is there a separate intent to keep steering people to $HOME (e.g. Desktop/SFTP consistency)? If file sync was the sole reason, I'll turn this into a full revert of #507. If we want to keep it deprecated for another reason, I'll leave the deprecation and put that reason in the message instead.

🤖 Posted by Coder Agents on behalf of @aqandrew.

Copy link
Copy Markdown
Member

Before I expand this PR to do that: was file sync the only reason we deprecated dir, or is there a separate intent to keep steering people to $HOME (e.g. Desktop/SFTP consistency)

IIRC yes. But lets confirm from @zenithwolf1000 and @ash

@code-asher

code-asher commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

File sync was the only reported issue (as far as I know), but it would be a problem with plain scp still and any other tool that uses scp.

Whether any users will actually try that and run into the issue though...I have no idea. One would think though that someone somewhere will probably use scp at some point. 😆

@aqandrew

aqandrew commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@code-asher Agreed, that matches what we traced: modern OpenSSH scp strips ~/ client-side (prepare_remote_path() assumes cwd is the home dir), so scp host:~/foo lands in dir. coder/mutagen#10 only fixes Mutagen.

I think it's a small problem, though, and not a reason to keep dir deprecated:

  • Only ~/ paths are affected. Relative paths landing in dir is intended ("SFTP and SCP now respect the workspace agent dir setting" in the 2.29–2.34 ESR notes). Absolute paths and scp -O work correctly.
  • The server can't fix it. It receives foo for both ~/foo and foo, so the only full fix would be starting SFTP in $HOME again, undoing that intended change.
  • Deprecating dir wouldn't remove it. Devcontainer workspaceFolder causes the same behavior independently of coder_agent.dir.

Proposal: un-deprecate dir (revert #507) and replace the warning with a short note in its description to use absolute paths for scp/SFTP. I'll wait for @zenithwolf1000 to confirm before updating the PR.

🤖 Posted by Coder Agents on behalf of @aqandrew.

The dir deprecation, its description warning, and the WarnDirNotHome
plan-time validator were all added in #507 (DEVEX-227) solely because a
non-$HOME dir broke Coder Desktop file sync. That is fixed in
coder/mutagen#10, released and bundled into the macOS and Windows Desktop
clients, so the deprecation no longer has a reason to exist. Atif, Asher,
and Sushant confirmed on #549 that file sync was the only reason.

Revert #507: drop the Deprecated field, the description warning, the
ValidateFunc, WarnDirNotHome, and its test, and regenerate docs. Replace
the warning with a short note that SFTP and scp resolve relative and
~/-prefixed paths against dir, so absolute paths should be used for file
transfers (OpenSSH scp strips ~/ client-side).

Opened by Coder Agents on behalf of @aqandrew.
@aqandrew aqandrew changed the title fix: remove "dir breaks Coder Desktop file sync" warning fix: un-deprecate coder_agent dir Oct 5, 2026
@zenithwolf1000

Copy link
Copy Markdown
Contributor

@aqandrew @matifali reminder to update any external docs and update customer material to match before the next release, since this was quite an unpopular deprecation plan.

@matifali matifali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@aqandrew lets also plan a release for the provider.

@aqandrew

aqandrew commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@aqandrew @matifali reminder to update any external docs and update customer material to match before the next release, since this was quite an unpopular deprecation plan.

@aqandrew lets also plan a release for the provider.

Will do x2!

@aqandrew
aqandrew merged commit c4a4316 into main Oct 6, 2026
3 of 7 checks passed
@aqandrew
aqandrew deleted the andrew/desk-2-remove-filesync-warning branch October 6, 2026 22:00
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026

matifali commented Oct 7, 2026

Copy link
Copy Markdown
Member

@linear create an issue for both and set deadline of October 22.
Add to next sprint

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants