Skip to content

web: starting from a Git repository subdirectory opens sessions at repository root #54647

Closed as duplicate

Description

@ekworp

Description

When using the OpenCode web interface from a subdirectory of a Git repository, new sessions use the repository root as their working directory instead of the directory from which OpenCode was started.

This makes all subsequent conversations operate in the parent repository directory.

Plugins

No response

OpenCode version

v2.0.26

Steps to reproduce

  1. use a Git repository at /path/to/repository.
  2. start a new session from the subdirectory at '/path/to/repository/subdirectory'
  3. Run:
    pwd
    ls

Expected Behavior

The new session should use the directory from which session was started:

/path/to/repository/subdirectory

Actual Behavior

The session uses the Git repository root instead:

/path/to/repository

For example, when starting a new session from a subdirectory named B inside the repository A, ls shows the contents of A rather than the contents of B.

This behavior does not occur when session is started from a directory that is not inside a Git repository.

Additional Context

The issue is consistently reproducible with the web interface. It appears that OpenCode automatically resolves the working directory to the Git repository root when the launch directory is inside a repository.

Screenshot and/or share link

No response

Operating System

Linux aarch64

Terminal

xterm-256color zsh

Activity

  1. opencode-agent commented on Oct 11, 2026

    @opencode-agent
    Contributor

    Thanks for the report, @ekworp! I think this is a duplicate of #51191, which is still open. It describes the same problem: in the web UI, a new session for a folder inside a Git repository is created at the repository root instead of that folder. It has also been confirmed on v2.0.16.

    Possible duplicates and related issues, ordered from most to least likely:

    It would help to add a comment on #51191 confirming you still see this on v2.0.26, with the exact command you use to start the web UI (for example opencode web or opencode serve, run from the subdirectory). That way all the details are in one place.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #51191. A day has passed with no reply saying how this differs: in both, new web UI sessions for a subdirectory of a Git repository are created at the repository root.

    Please follow #51191 for updates. It would help to add a comment there confirming you still see this on v2.0.26, with the command you use to start the web UI. If your problem does turn out to be different, reply here and we can reopen this. Thanks, @ekworp!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions