Bug: attach --dir works incorrectly when using with remote server #6539

Closed
opened 2026-02-16 18:04:31 -05:00 by yindo · 2 comments
Owner

Originally created by @gricha on GitHub (Jan 16, 2026).

Originally assigned to: @thdxr on GitHub.

Description

opencode attach --dir does not work correctly when you try to use it with a remote server. It performs client side validation of whether a directory is valid in the context of local machine which breaks when you want to pass that flag to the server.

For instance, from my local machine, you cannot run
opencode attach http://docs:4096 --dir /home/workspace/perry

if my $HOME is different locally.

Proposed minimal fix: https://github.com/anomalyco/opencode/pull/8969

Plugins

none

OpenCode version

1.1.24

Steps to reproduce

Set up remote server over tailnet/somehow accessible

Try to attach with a directory that doesn't exist on the local machine. Example:
opencode attach http://docs:4096 --dir /home/workspace/perry

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

Ghostty

Originally created by @gricha on GitHub (Jan 16, 2026). Originally assigned to: @thdxr on GitHub. ### Description opencode attach --dir does not work correctly when you try to use it with a remote server. It performs client side validation of whether a directory is valid in the context of local machine which breaks when you want to pass that flag to the server. For instance, from my local machine, you cannot run opencode attach http://docs:4096 --dir /home/workspace/perry if my $HOME is different locally. Proposed minimal fix: https://github.com/anomalyco/opencode/pull/8969 ### Plugins none ### OpenCode version 1.1.24 ### Steps to reproduce Set up remote server over tailnet/somehow accessible Try to attach with a directory that doesn't exist on the local machine. Example: opencode attach http://docs:4096 --dir /home/workspace/perry ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04 ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:04:31 -05:00
yindo closed this issue 2026-02-16 18:04:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5380: TUI referencing local directory when using attach --dir to connect to a remote server.
  • #4967: opencode attach: File path duplicates client's relative directory, causing ENOENT
  • #4686: TUI sends absolute local paths causing ENOENT on server side

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of existing issues. Please check: - #5380: TUI referencing local directory when using attach --dir to connect to a remote server. - #4967: `opencode attach`: File path duplicates client's relative directory, causing ENOENT - #4686: TUI sends absolute local paths causing ENOENT on server side Feel free to ignore if none of these address your specific case.
Author
Owner

@gricha commented on GitHub (Jan 16, 2026):

Fixed in https://github.com/anomalyco/opencode/pull/8969 - created an issue because it labeled my PR.

@gricha commented on GitHub (Jan 16, 2026): Fixed in https://github.com/anomalyco/opencode/pull/8969 - created an issue because it labeled my PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6539