Skip to content

Desktop GUI reopens an existing session with the wrong workspace path after selecting a different project directory #29714

Closed as not planned

Description

@hbyswanliang

Description

Environment

  • Product: OpenCode Desktop GUI
  • GUI version: v0.15.11
  • OS: Windows
  • Expected project path: E:\Code\xingsen\mes\mes_general_dev\operate-backend
  • Unexpected project path used by the session: D:\Code\xingsen\mes\merge-dev\operate-backend
  • CLI version on PATH: 1.14.41 via npm, likely unrelated to the Desktop GUI issue

Description

When I open the OpenCode Desktop GUI and select the project directory:

E:\Code\xingsen\mes\mes_general_dev\operate-backend
the GUI does not start or attach to a session using that workspace. Instead, it keeps jumping back to an existing session whose server-side workspace is:

D:\Code\xingsen\mes\merge-dev\operate-backend
Inside the agent session, the injected working directory and all default tool operations still point to the D: project path, even though I selected the E: project path in the GUI.

Both directories exist on disk, which makes this dangerous because file reads and edits silently happen in the wrong repository instead of failing.

Steps to Reproduce
Start OpenCode Desktop GUI on Windows.
Select/open this project directory:
E:\Code\xingsen\mes\mes_general_dev\operate-backend
Start or continue a chat/session.
Ask the agent to inspect the current working directory or read project files.
Observe that the session is still bound to:
D:\Code\xingsen\mes\merge-dev\operate-backend
Close/open a new GUI session and select the E: path again.
The GUI still returns to or reuses the wrong D: workspace session.
Expected Behavior
When the user selects a project directory in the Desktop GUI, the session should be created or attached with that exact workspace root:

E:\Code\xingsen\mes\mes_general_dev\operate-backend
The server-side working directory, workspace root, and tool execution context should all match the selected GUI path.

Actual Behavior
The GUI appears to reuse or reconnect to an existing server-side session whose workspace root is different:

D:\Code\xingsen\mes\merge-dev\operate-backend
As a result, the agent reads and modifies files in the wrong repository.

Impact
This can cause accidental edits in the wrong project when two similar repositories exist locally. Since both paths are valid, the problem is not obvious until the user notices path mismatches in tool output.

Additional Notes
This looks like the Desktop GUI or backend server may be reusing a stale session/project mapping instead of honoring the newly selected workspace path.

It would be helpful if OpenCode Desktop displayed and validated the effective server-side workspace root for the active session, and either refused to attach to a mismatched workspace or prompted the user before reconnecting to an existing session. 

### Plugins

_No response_

### OpenCode version

_No response_

### Steps to reproduce

_No response_

### Screenshot and/or share link

_No response_

### Operating System

_No response_

### Terminal

_No response_

Activity

  1. github-actions commented on May 28, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about the directory query param being ignored when creating sessions, #23607 may be the same root cause.

  2. belisoful commented on Jul 2, 2026

    @belisoful

    Confirmed! Still an issue in Version 1.17.13.

    This is a missing "check" in the "open project" methods on checking if an existing project is what is being opened. The missing condition is if the filePath is NOT the same, then it is NOT the same project even if it is technically "the same repo."

    This is a serious non-starter for OpenCode, btw.

  3. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

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

  4. Hona commented on Sep 2, 2026

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions