Skip to content

Session tab preview shows the same project name for every tab, ignoring the session's directory #51740

Closed as not planned

Description

@ocoomber

Description

Hovering a session tab in the desktop app shows the same project name on every tab, regardless of which directory that session is actually in. The path line in the same card is correct.

A session in directory A, a session in directory B, and a session in the project actually named HomeServer all display the project name HomeServer. Only the path line differs between them.

No project has a custom name set (all 24 rows in the project table have name IS NULL), and displayName() falls back to getFilename(project.worktree) (packages/app/src/pages/layout/helpers.ts:49), so this is projectForSession() resolving to the wrong project rather than a stale name.

Every session in my database has project_id = 'global', and the project table has a row with id = 'global', worktree = '/', vcs = NULL, and zero project_directory rows. projectForSession() (packages/app/src/pages/layout/helpers.ts:96) returns byID.get(session.projectID) immediately and only matches on session.directory if that lookup misses:

const direct = byID.get(session.projectID)
if (direct) return direct
const directory = pathKey(session.directory)
return projects.find(...)

Since every session carries project_id = 'global', the ID path always wins and the directory is never consulted. Note this is a display-only symptom for me, unlike #39667 where sessions were actually reassigned server-side.

I checked for the .git/opencode anchor file described in #39667 and it is absent from all six affected directories, so that particular cause does not apply here.

Steps to reproduce

  1. Configure several projects, start sessions in at least two of them
  2. Open a session tab's preview (hover and hold ~2s)
  3. Observe the project name is identical across tabs while the path line differs correctly

OpenCode version

1.18.32 (desktop)

Operating System

Windows 11

Activity

  1. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Sep 27, 2026
  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    Thanks for updating the issue with the bug description, reproduction steps, and system details!

  3. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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