Skip to content

Sessions created in Desktop app are not visible in CLI TUI session list #29071

Closed as not planned

Description

@hmannekomimi-ctrl2

Description

Sessions created in OpenCode Desktop (Electron app) do not appear in the CLI TUI session list ("Switch session" dialog) when running opencode in the terminal.

Conversely, sessions created in the CLI are visible in the Desktop app. The data is not lost — running opencode export confirms all sessions exist in the shared database.

Steps to Reproduce

  1. Create a session in OpenCode Desktop app
  2. Open the CLI version (opencode command)
  3. Open the "Switch session" dialog
  4. The Desktop-created session does not appear in the list

Expected Behavior

Since the Desktop and CLI share the same database (~/.local/share/opencode/opencode.db), sessions created in either interface should be visible in both.

Root Cause

The CLI TUI session list has directory filtering enabled by default (session_directory_filter_enabled: true), which filters sessions by path (a relative path from the worktree root):

// packages/opencode/src/cli/cmd/tui/context/sync.tsx
function sessionListQuery(): { scope?: "project"; path?: string } {
  if (!kv.get("session_directory_filter_enabled", true)) return { scope: "project" }
  // ...
  return {
    path: path.relative(
      path.resolve(project.data.instance.path.worktree),
      project.data.instance.path.directory
    ).replaceAll("\\", "/"),
  }
}

Meanwhile, the Desktop app retrieves sessions using directory (absolute path) + roots: true, which results in a different path resolution for sessions created in the Desktop app. This mismatch causes Desktop-created sessions to be filtered out of the CLI TUI session list.

Workaround

Add the following to ~/.local/state/opencode/kv.json:

{
  "session_directory_filter_enabled": false
}

This disables directory filtering and shows all sessions within the project.

Suggested Fixes

  1. Change the default for session_directory_filter_enabled to false
  2. Unify path resolution between Desktop and CLI so sessions created in either interface share the same path value
  3. Show filtered-out sessions in a separate "Other sessions" section in the CLI TUI session list

Related Issues

Environment

  • OS: Windows 11
  • OpenCode CLI: v1.15.10 (installed via Scoop)
  • OpenCode Desktop: v1.15.10
  • DB path: ~/.local/share/opencode/opencode.db

Note: This issue was drafted with AI assistance (OpenCode + GLM-5.1) and reviewed by the human reporter.

Activity

  1. hmannekomimi-ctrl2 commented on May 24, 2026

    @hmannekomimi-ctrl2
    Author

    Related to #17183 and #21340 — these issues describe the same underlying problem (path format / path separator mismatch causing directory filtering to hide sessions). This issue focuses specifically on the session_directory_filter_enabled default causing Desktop-created sessions to be invisible in the CLI TUI, with a documented workaround and suggested fixes.

  2. github-actions commented on May 24, 2026

    @github-actions
    Contributor

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

  3. Drewlius commented on Jul 7, 2026

    @Drewlius

    I would like to see this finally resolved there has been no developer comment on this thread yet, however this is a blatant issue effecting every linux distro I have used opencode on and is unavoidable when working with their ecosystem of applications. How this doesn't annoy one of the developers to the point of fixing is beyond me but it really should be fixed and according to the previous users troubleshooting it seems like an easy fix that results in no immediately present downsides.

  4. github-actions commented on Sep 6, 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.

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