Skip to content

opencode web - thinks it is in root (/) path #6336

Closed

Description

@plirof

Description

I have the issue that while opencode recognises the folder that we run (eg we run opencode from folder /opt/myproject) , the web version thinks it is run from root. This behavior exists in all opencode versions -from 1.0.185+

To work in a project from webUi I must always issue the command to opencode (web) chat change to folder /opt/myproject.

Note (this might help): I noticed that when I open opencode web from the terminal ,sometimes for about a split second, it shows the correct folder but it instantly changes to "/".

In the community base appimage of 1.0.185 (https://github.com/pkgforge-dev/opencode-AppImage-Enhanced/releases
) there is the option to "open project" in the lower left panel -right after the connect provider. This would make things easier.

OpenCode version

1.0.185-1.0.207 (all linux versions)

Steps to reproduce

  1. Navigate to your project folder eg /opt/myproject
  2. Run command opencode
  3. opencode terminal correctly shows project path as /opt/myproject
  4. Open WebUI (control-p)
  5. Ask WebUI to list files in the current project path. It responds that it is in root (/) folder

The same thing happens if I run command "opencode web".

Screenshot and/or share link

No response

Operating System

Linux Debian Bookworm

Terminal

sakura,xterm

Activity

  1. github-actions commented on Dec 29, 2025

    @github-actions
    Contributor

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

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

  2. plirof commented on Dec 29, 2025

    @plirof
    Author

    Some extra information that might or might not help...
    Results for /init command :
    -If I run the terminal version of opencode in /opt/myproject then it creates the file /opt/myproject/AGENTS.md normally.

    -If I run /init from the webUI (even after I do a cd /opt/myproject/ ) the AGENTS.md is created on root /AGENTS.md (which could be DANGEROUS)

  3. plirof commented on Jan 2, 2026

    @plirof
    Author

    Just another observation. When I have both TUI and WebUI open they are syncronised (in WebUI I see what is happening to TUI . But, webUi still think he is in root folder (=if I enter a command in TUI and WebUI it will be applied to different folders)

  4. Fun10165 commented on Jan 7, 2026

    @Fun10165

    I encounter the same issue on macOS (M4).

  5. sortofsleepy commented on Jan 19, 2026

    @sortofsleepy

    Just adding my 2 cents here after experiencing this issue this morning as well while prototyping something: I noticed that if you ping the server using curl, it does appear to know what folder it's in even when the web ui still thinks it's in the home folder.

    {"home":"/","state":"/.local/state/opencode","config":"/.config/opencode","worktree":"/","directory":"/root/project"}
    

    In my case, /root/project is where I'm trying to start Opencode; directory appears to hold the correct location. Given that directory is pointing to the correct starting location hopefully it's a simple fix since the data is already there.

  6. foertel commented on Feb 8, 2026

    @foertel

    still broken in v1.1.53 on linux

  7. McKlinton2 commented on Feb 14, 2026

    @McKlinton2

    Same issue on linux with v1.2.1
    Just installed opencode with curl command. Went to my project directory, and ran "opencode web". In the browsers, it shows the root folder.

  8. tacman commented on Feb 14, 2026

    @tacman

    My workaround is to do a git init in that directory and restart opencode on a different port. Then it seems to work.

  9. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions