desktop: Home hides subdirectory sessions and mixes unrelated global projects

Ouverte
#65,362 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
70/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
desktop, frontend

Piste de recherche

Start with the two files the report names: home/sessions/records.ts (the pathKey exact-match filter) and home/sessions/controller.tsx (directories(project), which merges project.worktree with project.sandboxes). Reproduce via the local session and worktree APIs, then make matching segment-aware for the selected project while excluding unrelated entries from a shared global inventory, preserving Git worktrees and nested projects. Done when the child session appears under its project and the non-Git project no longer lists unrelated conversations.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area/desktop platform/windows reproduced type/bug version/v2
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_PROGRAM and COLORTERM are 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 local whatsapp-notify.ts plugin. 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
  1. Add an existing Git project at C:\work\personal.
  2. Create a conversation whose working directory is C:\work\personal\android-app.
  3. Verify that the session still has the personal project's projectID, is not archived, and has readable message history.
  4. Open Home and select the personal project.
  5. 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
  1. Have a non-Git project rooted at C:\work\work represented by id: "global", plus a separate Git project at C:\work\personal.

  2. Reach a saved inventory state in which GET /api/worktree?projectID=global returns both directories:

    [
      {"directory":"C:\\work\\personal"},
      {"directory":"C:\\work\\work"}
    ]
    
  3. Have separate root-directory conversations for those projects.

  4. In Home, select the non-Git work project.

  5. 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 global inventory.
  • 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
  1. Add an existing Git project at C:\work\personal.
  2. Create a conversation whose working directory is C:\work\personal\android-app.
  3. Verify that the session still has the personal project's projectID, is not archived, and has readable message history.
  4. Open Home and select the personal project.
  5. 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
  1. Have a non-Git project rooted at C:\work\work represented by id: "global", plus a separate Git project at C:\work\personal.

  2. Reach a saved inventory state in which GET /api/worktree?projectID=global returns both directories:

    [
      {"directory":"C:\\work\\personal"},
      {"directory":"C:\\work\\work"}
    ]
    
  3. Have separate root-directory conversations for those projects.

  4. In Home, select the non-Git work project.

  5. 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)

Langage dominant
TypeScript
Étoiles
227k
Forks
30.7k
Merge moyen
3 h 57 min
PR mergées (30 j)
484

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de anomalyco/opencode

Toutes les issues de anomalyco/opencode

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.