installDependencies incorrectly resolves home directory path when $HOME is a symlink #8578

Closed
opened 2026-02-16 18:10:18 -05:00 by yindo · 1 comment
Owner

Originally created by @shiw-yang on GitHub (Feb 5, 2026).

Originally assigned to: @thdxr on GitHub.

Description

Description

When running opencode on a system where $HOME is a symlink, the installDependencies function incorrectly resolves the data directory path, causing a permission denied error.

The path /data_volume/home/users/shiwei01.yang/.opencode/ is incorrectly resolved to /data_volume/home/users/.opencode/, losing the username directory component.

Error Message

{
  "name": "UnknownError",
  "data": {
    "message": "Error: EACCES: permission denied, open '/data_volume/home/users/.opencode/package.json'\n    at write (unknown)\n    at installDependencies (src/config/config.ts:243:17)\n    at processTicksAndRejections (native:7:39)"
  }
}

Expected Behavior

The path should be /data_volume/home/users/shiwei01.yang/.opencode/package.json (with the username directory).

Actual Behavior

The path is /data_volume/home/users/.opencode/package.json (missing the username directory).

Plugins

oh-my-opencode@3.2.3

OpenCode version

1.1.51

Steps to reproduce

  1. Set up a system where $HOME is a symlink to another location (e.g., /home/users/username -> /data_volume/home/users/username)
  2. Configure opencode with a plugin in opencode.json:
    {
      "plugin": ["oh-my-opencode@3.2.3"]
    }
    
  3. Run opencode
  4. Observe the permission denied error with incorrect path

Screenshot and/or share link

No response

Operating System

Linux 3.10.0-1160.el7.x86_64 (CentOS 7)

Terminal

all

Originally created by @shiw-yang on GitHub (Feb 5, 2026). Originally assigned to: @thdxr on GitHub. ### Description ## Description When running `opencode` on a system where `$HOME` is a symlink, the `installDependencies` function incorrectly resolves the data directory path, causing a permission denied error. The path `/data_volume/home/users/shiwei01.yang/.opencode/` is incorrectly resolved to `/data_volume/home/users/.opencode/`, losing the username directory component. ## Error Message ```json { "name": "UnknownError", "data": { "message": "Error: EACCES: permission denied, open '/data_volume/home/users/.opencode/package.json'\n at write (unknown)\n at installDependencies (src/config/config.ts:243:17)\n at processTicksAndRejections (native:7:39)" } } ``` ## Expected Behavior The path should be `/data_volume/home/users/shiwei01.yang/.opencode/package.json` (with the username directory). ## Actual Behavior The path is `/data_volume/home/users/.opencode/package.json` (missing the username directory). ### Plugins oh-my-opencode@3.2.3 ### OpenCode version 1.1.51 ### Steps to reproduce 1. Set up a system where `$HOME` is a symlink to another location (e.g., `/home/users/username` -> `/data_volume/home/users/username`) 2. Configure opencode with a plugin in `opencode.json`: ```json { "plugin": ["oh-my-opencode@3.2.3"] } ``` 3. Run `opencode` 4. Observe the permission denied error with incorrect path ### Screenshot and/or share link _No response_ ### Operating System Linux 3.10.0-1160.el7.x86_64 (CentOS 7) ### Terminal all
yindo added the bug label 2026-02-16 18:10:18 -05:00
yindo closed this issue 2026-02-16 18:10:18 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

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

  • #11001: Custom tools via symlinks fail to resolve @opencode-ai/plugin module
  • #10365: Symlinked directories not visible in project picker (opencode serve)
  • #6343: EACCES: permission denied, mkdir '/Users/user/.local/share/opencode'
  • #10556: Plugin bun-pty cannot find librust_pty.so when installed in .opencode/ - missing search path
  • #8389: EACCES: permission denied, mkdir /.opencode
  • #7498: Grep Tool Fails on Symlinks

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

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #11001: Custom tools via symlinks fail to resolve @opencode-ai/plugin module - #10365: Symlinked directories not visible in project picker (opencode serve) - #6343: EACCES: permission denied, mkdir '/Users/user/.local/share/opencode' - #10556: Plugin bun-pty cannot find librust_pty.so when installed in .opencode/ - missing search path - #8389: EACCES: permission denied, mkdir `/.opencode` - #7498: Grep Tool Fails on Symlinks Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8578