You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Desktop] Session list is not updating when switching between projects #12262
Hi! I’m seeing what looks like a Web UI-only session list scoping/refresh bug after upgrading OpenCode 1.2.5 -> 1.2.6.
Environment
OpenCode: 1.2.6
OS: Linux
Storage: SQLite at ~/.local/share/opencode/opencode.db
Important: Sessions show correctly in the TUI, but not in the Web UI.
My setup / workflow
I start OpenCode Web from a “neutral” directory (not inside a repo), e.g. ~/safe:
opencode web
In the Web UI, I then select/navigate to various projects.
One of those projects is a git repo that uses multiple git worktrees:
main repo: ~/dev/sfp-3pl-approval
worktrees live under: ~/dev/_wt/sfp-3pl-approval-*
Each worktree directory has its own sessions historically, and Web UI used to show them.
Problem
After upgrading to 1.2.6, when I’m in the Web UI and select the ~/dev/sfp-3pl-approval project:
the Web UI session list shows only 1 (or almost none) of the existing sessions
BUT the TUI/CLI still lists all the sessions correctly, including those in the worktree directories
So sessions don’t seem lost—Web UI just isn’t showing them.
Repro steps
Start web server from a directory outside the project:
opencode web (started from ~/safe)
In the web UI, select project ~/dev/sfp-3pl-approval
Observe the session list (nearly empty / missing lots of sessions)
Compare with TUI/CLI:
(cd ~/dev/sfp-3pl-approval && opencode session list -n 50)
sessions appear as expected there
Evidence: sessions exist in DB for the worktree directories
These show that many sessions exist for the repo + worktrees:
opencode db "SELECT COUNT(*) AS n, directory FROM session WHERE directory LIKE '%sfp-3pl-approval%' GROUP BY directory ORDER BY n DESC;"
Example output (abridged):
~/dev/sfp-3pl-approval -> lots of sessions
~/dev/_wt/sfp-3pl-approval-... -> lots of sessions
Also, opencode debug scrap shows the repo worktree plus sandboxes (worktrees) are known:
opencode debug scrap
Additional clue: duplicate project rows for the same worktree path
In my DB there are two project rows with the same worktree path (~/dev/sfp-3pl-approval) but sessions are mostly associated to one of the two project_ids.
opencode db "SELECT id, worktree, time_updated FROM project WHERE worktree LIKE '%/sfp-3pl-approval' ORDER BY time_updated DESC;"
opencode db "SELECT project_id, COUNT(*) AS n FROM session WHERE directory LIKE '%/dev/_wt/sfp-3pl-approval-%' GROUP BY project_id ORDER BY n DESC;"
It looks like Web UI might be picking the “wrong” project id (the one with very few sessions), so the list looks empty.
Expected
When selecting a project in Web UI, session list should include all sessions for that project/worktree + its worktree sandboxes (as it did previously), consistent with the TUI.
Actual
Web UI shows almost none, while TUI shows all.
If you want, I can provide more DB queries / a minimal DB snapshot (sanitized) or run with debug logging.
Follow-up: I think this is not only a “project switch doesn’t refresh” issue in my case — it’s a Web UI sidebar scoping/filtering issue that hides worktree/sandbox sessions.
What I’m seeing
OpenCode: 1.2.6 (Linux)
Sessions exist and are visible via TUI/CLI and via the web server API
Web UI sidebar only shows sessions for the current directory (e.g. repo root), and hides sessions whose session.directory is a different worktree/sandbox directory.
Server API proof: roots exist across multiple directories (repo + worktrees)
When I query the server in the repo context, GET /session?roots=true returns root sessions whose directory spans multiple worktree dirs:
This exact directory equality check seems to be why sessions from worktree/sandbox directories are not shown when I’m “in” the repo root directory, even though the server can return them.
Expected behavior (for worktree/sandbox repos)
When a project has sandboxes/worktrees, the sidebar should either:
include root sessions across all sandbox/worktree directories (grouped by directory), or
offer a toggle: This directory vs Whole project (incl. sandboxes/worktrees).
If you’d prefer, I can open a separate issue focused specifically on “Web sidebar hides worktree/sandbox sessions due to directory-equality filter” and cross-link it here — but wanted to add the concrete repro + snippets first.
Activity
github-actions commentedon Feb 5, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
benoitheinrich commentedon Feb 17, 2026
Hi! I’m seeing what looks like a Web UI-only session list scoping/refresh bug after upgrading OpenCode 1.2.5 -> 1.2.6.
Environment
~/.local/share/opencode/opencode.dbMy setup / workflow
~/safe:opencode web~/dev/sfp-3pl-approval~/dev/_wt/sfp-3pl-approval-*Problem
After upgrading to 1.2.6, when I’m in the Web UI and select the
~/dev/sfp-3pl-approvalproject:So sessions don’t seem lost—Web UI just isn’t showing them.
Repro steps
opencode web(started from~/safe)~/dev/sfp-3pl-approval(cd ~/dev/sfp-3pl-approval && opencode session list -n 50)Evidence: sessions exist in DB for the worktree directories
These show that many sessions exist for the repo + worktrees:
Example output (abridged):
~/dev/sfp-3pl-approval-> lots of sessions~/dev/_wt/sfp-3pl-approval-...-> lots of sessionsAlso,
opencode debug scrapshows the repo worktree plus sandboxes (worktrees) are known:Additional clue: duplicate
projectrows for the same worktree pathIn my DB there are two
projectrows with the sameworktreepath (~/dev/sfp-3pl-approval) but sessions are mostly associated to one of the twoproject_ids.It looks like Web UI might be picking the “wrong” project id (the one with very few sessions), so the list looks empty.
Expected
When selecting a project in Web UI, session list should include all sessions for that project/worktree + its worktree sandboxes (as it did previously), consistent with the TUI.
Actual
Web UI shows almost none, while TUI shows all.
If you want, I can provide more DB queries / a minimal DB snapshot (sanitized) or run with debug logging.
benoitheinrich commentedon Feb 18, 2026
Follow-up: I think this is not only a “project switch doesn’t refresh” issue in my case — it’s a Web UI sidebar scoping/filtering issue that hides worktree/sandbox sessions.
What I’m seeing
session.directoryis a different worktree/sandbox directory.Server API proof: roots exist across multiple directories (repo + worktrees)
When I query the server in the repo context,
GET /session?roots=truereturns root sessions whosedirectoryspans multiple worktree dirs:Example output shape (counts vary, but note multiple directories):
So the backend can return root sessions for worktree dirs when in the repo project context.
Frontend proof: Web sidebar filters to current directory only
I inspected the downloaded web bundle and found two key pieces:
1) Session list request is directory-scoped + roots-only
2) Sidebar list filters sessions to
session.directory === currentDirectory(+ root + unarchived)This exact
directoryequality check seems to be why sessions from worktree/sandbox directories are not shown when I’m “in” the repo root directory, even though the server can return them.Expected behavior (for worktree/sandbox repos)
When a project has sandboxes/worktrees, the sidebar should either:
If you’d prefer, I can open a separate issue focused specifically on “Web sidebar hides worktree/sandbox sessions due to directory-equality filter” and cross-link it here — but wanted to add the concrete repro + snippets first.
benoitheinrich commentedon Feb 18, 2026
In fact, I believe what I'm experiencing is a really a different issue, so I'll be opening a new ticket and put the details above there.
benoitheinrich commentedon Feb 18, 2026
Created #14082
github-actions commentedon Apr 20, 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.