Skip to content

session: new session created from a project binds to the service default location and is missing from that project's history #51196

Description

@telles0808

Description

In the desktop app, clicking New session while a project is selected creates the session bound to the shared service's default location (the user home) instead of the selected project directory. The session runs and is open in a tab, but that project's session list stays empty ("Nada por aqui ainda", badge 0), so the chat looks lost.

Plugins

None.

OpenCode version

2.0.16 (desktop app, channel latest)

Steps to reproduce

  1. Make the shared service's default location be the user home (here it was C:\Users\<user> after the app restarted with cleared persisted state).
  2. In the desktop app select project D:\<path>\00 - Pesca and click New session.
  3. Send one message so the session is persisted.
  4. Inspect the API: GET /api/session/<id> returns location.directory = C:\Users\<user> (not the selected project), and GET /api/session?directory=D:\<path>\00 - Pesca returns []. The project UI shows 0 sessions while the session tab is open.

Screenshot and/or share link

N/A - described above.

Operating System

Windows 11 - Windows NT 10.0.26200 (win32 x64)

Terminal

OpenCode Desktop (Electron 44 / Chrome 152), not a terminal.

Additional context

  • Server log: worktree discovery failed directory="C:\Users\<user>" strategy=git.
  • Workaround: POST /api/session/<id>/move {"directory":"D:\<path>\00 - Pesca"} (the session_move tool) rebinds the session; it then appears in the project list.
  • Expected: the client should pass the selected project directory when creating a session and the server must not silently fall back to its default location; a session open in a tab should always be listed under its project.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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