Repository navigation
Description
Description
Summary
The Desktop Home project filter can both hide sessions whose working directory is a normal subdirectory of the selected project and display sessions from an unrelated project when the selected non-Git project uses a shared global worktree inventory.
This makes existing conversations appear lost and undermines separation between work and personal projects. The affected session metadata and messages remain available through the local API.
Environment
- opencode version:
opencode v2.3.0(verified on the reporting machine). The same symptoms were previously observed on Desktop 2.2.5. - OS: Windows 11,
Microsoft Windows NT 10.0.26200.0, x64. - Terminal: Desktop UI; diagnostic shell has
TERM=xterm-256color;TERM_PROGRAMandCOLORTERMare unset. - Shell: PowerShell 7.6.2;
ComSpec=C:\WINDOWS\system32\cmd.exe. - Install/channel: packaged Windows Desktop, standard release installation. No prerelease suffix in the reported version; the exact updater channel was not independently verified.
- Active plugins: configured globally:
opencode-supermemory,opencode-firecrawl,opencode-tavily,opencode-daytona,opencode-background-agents,opencode-vibeguard,opencode-notificator, and a localwhatsapp-notify.tsplugin. This lists configuration, not independently verified plugin runtime state. A plugin-disabled/clean-profile reproduction has not been performed.
Reproduction
The following paths and names are sanitized examples, not the reporter's real project data.
A. A child-directory session disappears from its own project filter
- Add an existing Git project at
C:\work\personal. - Create a conversation whose working directory is
C:\work\personal\android-app. - Verify that the session still has the personal project's
projectID, is not archived, and has readable message history. - Open Home and select the personal project.
- Observe that a root-directory session is listed, but the normal child-directory session is omitted.
The real affected Android-app session was confirmed through the session API with the correct project ID, a child working directory, and readable history. The corresponding folder and APK were also still present.
B. A shared global worktree inventory mixes unrelated projects
-
Have a non-Git project rooted at
C:\work\workrepresented byid: "global", plus a separate Git project atC:\work\personal. -
Reach a saved inventory state in which
GET /api/worktree?projectID=globalreturns both directories:[ {"directory":"C:\\work\\personal"}, {"directory":"C:\\work\\work"} ] -
Have separate root-directory conversations for those projects.
-
In Home, select the non-Git work project.
-
Observe personal conversations appearing in the work project's list.
The inventory state above was observed through the local API. The precise minimal sequence that first populated the shared inventory with both directories has not been isolated.
Expected Behavior
- Selecting a project should include its own ordinary subdirectory sessions, not only sessions whose directory exactly equals a root/worktree path.
- Selecting a non-Git project should not implicitly include every unrelated directory present in a shared
globalinventory. - Separately added nested projects and normal Git worktrees should retain their correct grouping.
- Showing a conversation should not require changing its working directory or moving its files.
Actual Behavior
- The Android-app conversation was absent from the personal Home list even though its session, project association, files, and messages still existed.
- The non-Git work project's Home list included personal conversations.
- There was no API deletion or archive operation associated with the missing conversation.
The shipped 2.3.0 renderer source map contains this exact-match filter in home/sessions/records.ts:
const selected = input.projectDirectories()
const directories = selected ? new Set(selected.map(pathKey)) : undefined
const sessions = directories
? input.sessions().filter((session) => directories.has(pathKey(session.location.directory)))
: input.sessions()The corresponding helper in home/sessions/controller.tsx returns:
function directories(project: LocalProject) {
return [project.worktree, ...(project.sandboxes ?? [])]
}The exact-match filter excludes ordinary child directories. When a shared global inventory supplies unrelated entries as sandboxes, returning all of them also allows cross-project root-directory matches.
Additional Context
- Both symptoms were observed on this installation before applying a local workaround. They reappeared after upgrading from 2.2.5 to 2.3.0, which replaced the locally modified renderer with the official one. This is not a request for the updater to preserve unsupported package modifications.
- A local renderer-only workaround limits a global selection to its selected canonical directory and allows segment-aware descendant matching for the selected project's own sessions, while excluding separately added nested projects and preserving Git worktree behavior.
- The workaround was tested against extracted packaged functions: 21 regression checks passed, including the real child session metadata; six additional repair-tool safety checks passed.
- After applying it, the Android-app session was observed in the personal Home UI tree. The final 2.3.0 work-project UI verification was interrupted by the machine locking and is not claimed as completed. Earlier 2.2.5 verification had confirmed the analogous work-child conversation visible and separate from personal conversations.
- Session IDs, project associations, parent relationships, and working directories were not changed by the workaround. Local checks preserved all 145 inventoried sessions, all preexisting messages in the two specifically checked conversations, and all 101 checked project files.
- A local workaround is not a durable fix because an official application update replaces the renderer. Please address the filtering/grouping behavior upstream.
- No private conversation content, account credentials, full user configuration, or private screenshots are attached.
Plugins
opencode-supermemory; opencode-firecrawl; opencode-tavily; opencode-daytona; opencode-background-agents; opencode-vibeguard; opencode-notificator; local whatsapp-notify.ts (configured; not independently isolated)
OpenCode version
2.3.0 (also observed on 2.2.5)
Steps to reproduce
The following paths and names are sanitized examples, not the reporter's real project data.
A. A child-directory session disappears from its own project filter
- Add an existing Git project at
C:\work\personal. - Create a conversation whose working directory is
C:\work\personal\android-app. - Verify that the session still has the personal project's
projectID, is not archived, and has readable message history. - Open Home and select the personal project.
- Observe that a root-directory session is listed, but the normal child-directory session is omitted.
The real affected Android-app session was confirmed through the session API with the correct project ID, a child working directory, and readable history. The corresponding folder and APK were also still present.
B. A shared global worktree inventory mixes unrelated projects
-
Have a non-Git project rooted at
C:\work\workrepresented byid: "global", plus a separate Git project atC:\work\personal. -
Reach a saved inventory state in which
GET /api/worktree?projectID=globalreturns both directories:[ {"directory":"C:\\work\\personal"}, {"directory":"C:\\work\\work"} ] -
Have separate root-directory conversations for those projects.
-
In Home, select the non-Git work project.
-
Observe personal conversations appearing in the work project's list.
The inventory state above was observed through the local API. The precise minimal sequence that first populated the shared inventory with both directories has not been isolated.
Screenshot
No response
Operating System
Windows 11 x64, Windows NT 10.0.26200.0
Terminal
OpenCode Desktop; diagnostics from PowerShell 7.6.2 (TERM=xterm-256color)
Activity
opencodejr commentedon Nov 21, 2026
Thanks for the detailed report. I reproduced the cause of the first problem (part A) on 2.3.0, at the server API level. It still happens on the latest
dev(844a6aa).The script below:
personalwith one commit and a subfolderpersonal/android-app.android-app. Both get the same project ID.android-appsession only appears when you ask for that folder.The server matches the directory exactly, and Home's own filter (in
home/sessions/records.ts, as you found) matches exactly too, so subfolder sessions of the selected project never appear in Home. I could not open the Home screen itself in my sandbox, so that last step is from reading the code, not from seeing the UI.I did not try the second problem (the non-git
globalproject showing other projects' sessions). It looks like the same problem tracked in #55133, where unrelated folders end up in one sharedglobalproject; related: #50979.Reproduction script (repro.sh)
Run it:
bash repro.shMykolaBiron commentedon Nov 21, 2026
I'd like to work on part A (child-directory sessions missing from their own project in Home). Here is my plan: in home/sessions/records.ts, match sessions whose directory is the selected project's worktree/sandbox or a path-segment descendant of it, while excluding descendants that belong to a separately added nested project. So nested projects and git worktrees keep their own grouping. I'll add regression tests for a child dir, a sibling with a shared prefix (
personal2), and a nested project. Part B looks like #55133, so I'll leave it out of this PR unless a maintainer prefers otherwise.roberto-ajolfi commentedon Nov 28, 2026
Still reproduces on 2.4.2 (macOS) — API evidence and a renamed-directory variant
Confirming part A on the latest v2 channel release, and adding one case the current fix approach should account for.
Environment
2.4.2(desktop app + bundled service; updater reports up to date)/bin/zshConfirmation (sanitized paths)
Project root
~/dev/proj(projectIDP); recent sessions run in~/dev/proj/suband carrylocation.directory = "~/dev/proj/sub",subpath = "sub", sameprojectID P.GET /api/session?limit=114&order=desc&parentID=null&directory=<abs project root>returns 30 sessions; the threesubsessions (including the most recent two, created on consecutive days) are absent.GET /api/session?...&directory=<abs project root>/subreturns exactly those three.GET /api/session?limit=500&order=desc&parentID=null(global) includes all 40 sessions of projectP.The API documents
directoryas "Only sessions whose directory is exactly this absolute path", so the server matches its spec; the Home project list consumes this exact-match query and drops child-directory sessions. Symptom from the user side: the project list looks permanently stale ("the same old session" stays on top) while the global search box finds everything, since search is not directory-scoped. Deleting the desktop app's HTTP caches and relaunching does not change it.Additional variant: renamed project directory
After the project folder was renamed (
~/dev/oldname→~/dev/proj), 7 older sessions keeplocation.directory = "~/dev/oldname"with the sameprojectID P, and are hidden the same way. A path-descendant match alone (as in #65443'srecords.tschange) does not recover these, since the old path is not a descendant of the new root. The project-ID fetch added in #65443'squeries.tschange would return them, so the client-side filter likely needssession.projectIDmatching (as also suggested in the review) rather than path containment only — this covers both subfolder and renamed-path sessions.Workarounds that work today
~/dev/proj/sub) as its own project folder.Secondary observation (separate issue candidate)
The service's JSON API responses (e.g.
GET /api/session) carry noCache-Control/ETag/Last-Modifiedheaders. The desktop app's Chromium HTTP cache stores them (observed list responses cached for months).Cache-Control: no-storeon API responses would prevent stale-cache rendering paths.epicwhale commentedon Nov 30, 2026
+1, this hits me hard. Almost all of my sessions start in a subfolder of the repository. When I select the project on Home, it lists only the few sessions I opened at the repository root. Hundreds of my sessions in that project are missing. The sessions are fine: GET /api/session?project= returns all of them. Only the Home list drops them, because it matches the session's folder exactly. it looks like #65443 fixes this for me locally. Could someone help bump up thie priority of this papercut?