Repository navigation
Sessions created in Desktop app are not visible in CLI TUI session list #29071
Description
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
- Create a session in OpenCode Desktop app
- Open the CLI version (
opencodecommand) - Open the "Switch session" dialog
- 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
- Change the default for
session_directory_filter_enabledtofalse - Unify
pathresolution between Desktop and CLI so sessions created in either interface share the samepathvalue - Show filtered-out sessions in a separate "Other sessions" section in the CLI TUI session list
Related Issues
- [BUG][Windows][global project] Root directory sessions can disappear after a new session is created from another client because session matching is still path-format sensitive #17183 — Path format mismatch causes directory filter to hide sessions on Windows
- [Windows] Web UI not showing sessions - path separator mismatch (backslash vs forward slash) #21340 — Web UI not showing sessions due to path separator mismatch (backslash vs forward slash)
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
hmannekomimi-ctrl2 commentedon May 24, 2026
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_enableddefault causing Desktop-created sessions to be invisible in the CLI TUI, with a documented workaround and suggested fixes.github-actions commentedon May 24, 2026
This issue might be a duplicate of an existing issue. Please check:
session_directory_filter_enabledbehavior causing sessions to be hidden in the TUI session listDrewlius commentedon Jul 7, 2026
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.
github-actions commentedon Sep 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.